@tomisakae/chatstoryai-mcp
v0.0.3
Published
MCP dành cho ChatStoryAI.
Readme
ChatStoryAI MCP Server
Giới thiệu
MCP Server dành cho ChatStoryAI - cho phép tương tác với API ChatStoryAI thông qua Model Context Protocol.
Tính năng
📚 Quản lý Truyện
- Lấy danh sách truyện của người dùng
- Tạo, cập nhật, xóa truyện
- Xuất bản truyện
- Quản lý ảnh bìa
📖 Quản lý Chương
- Lấy danh sách chương theo trạng thái
- Tạo, cập nhật, xóa chương
- Quản lý thứ tự chương
👥 Quản lý Nhân vật
- Tạo, cập nhật, xóa nhân vật
- Quản lý ảnh đại diện
- Phân loại vai trò (chính/phụ)
💬 Quản lý Hội thoại
- Tạo, cập nhật, xóa hội thoại
- Sắp xếp thứ tự hội thoại
- Phân loại loại hội thoại
📝 Quản lý Đại cương
- Tạo, cập nhật, xóa đại cương
- Sắp xếp theo thứ tự
🔖 Quản lý Bookmark & Lịch sử
- Bookmark/unbookmark truyện
- Xem lịch sử đọc
Cài đặt
- Clone repository:
git clone https://github.com/TomiSakae/chatstoryai-mcp.git
cd chatstoryai-mcp- Cài đặt dependencies:
npm install- Build project:
npm run buildCấu hình API Key
Cách 1: Biến môi trường
Tạo file .env trong thư mục gốc:
CHATSTORYAI_API_KEY=your_api_key_hereCách 2: Biến môi trường hệ thống
# Windows
set CHATSTORYAI_API_KEY=your_api_key_here
# macOS/Linux
export CHATSTORYAI_API_KEY=your_api_key_hereCấu hình với Model Context Protocol (MCP)
Claude Desktop
- Mở Claude Desktop và vào Settings
- Chọn mục Developer và bật Developer Mode
- Tìm file cấu hình tại:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
- Thêm cấu hình MCP vào file:
{
"mcpServers": {
"chatstoryai-mcp": {
"command": "node",
"args": ["đường/dẫn/đến/build/index.js"],
"env": {
"CHATSTORYAI_API_KEY": "your_api_key_here"
}
}
}
}Sử dụng
Development
npm run devProduction
npm startCác công cụ có sẵn
Stories Management
getStories- Lấy danh sách truyệngetStoryDetail- Lấy chi tiết truyệncreateStory- Tạo truyện mớiupdateStory- Cập nhật truyệndeleteStory- Xóa truyệnpublishStory- Xuất bản truyện
Bookmarks
checkBookmark- Kiểm tra trạng thái bookmarktoggleBookmark- Toggle bookmark
Chapters
getChapters- Lấy danh sách chươnggetChapterDetail- Lấy chi tiết chươngcreateChapter- Tạo chương mớiupdateChapter- Cập nhật chươngdeleteChapter- Xóa chương
Characters
getCharacters- Lấy danh sách nhân vậtgetCharacterDetail- Lấy chi tiết nhân vậtcreateCharacter- Tạo nhân vật mớiupdateCharacter- Cập nhật nhân vậtdeleteCharacter- Xóa nhân vật
Dialogues
getDialogues- Lấy danh sách hội thoạicreateDialogue- Tạo hội thoại mớiupdateDialogue- Cập nhật hội thoạideleteDialogue- Xóa hội thoạimoveDialogue- Di chuyển hội thoại
Outlines
getOutlines- Lấy danh sách đại cươnggetOutlineDetail- Lấy chi tiết đại cươngcreateOutline- Tạo đại cương mớiupdateOutline- Cập nhật đại cươngdeleteOutline- Xóa đại cương
Account
getBookmarks- Lấy danh sách bookmarkgetViewHistory- Lấy lịch sử xem
Categories & Tags
getCategoriesAndTags- Lấy danh sách thể loại và taggetCategories- Lấy danh sách thể loạigetTags- Lấy danh sách tag
Ví dụ sử dụng
Lấy danh sách truyện
Sử dụng công cụ getStories để lấy tất cả truyện của bạnTạo truyện mới
Sử dụng công cụ createStory với:
- title: "Tên truyện"
- description: "Mô tả truyện"
- mainCategoryId: "1"
- tagIds: "[1,2,3]"Tạo nhân vật
Sử dụng công cụ createCharacter với:
- storyId: ID truyện
- name: "Tên nhân vật"
- description: "Mô tả nhân vật"
- role: "main" hoặc "supporting"Lỗi thường gặp
401 Unauthorized
- Kiểm tra API key có đúng không
- Đảm bảo API key được cấu hình trong biến môi trường
404 Not Found
- Kiểm tra ID truyện/chương/nhân vật có tồn tại không
- Đảm bảo bạn có quyền truy cập vào tài nguyên
Đóng góp
- Fork repository
- Tạo feature branch
- Commit changes
- Push to branch
- Tạo Pull Request
License
MIT License - xem file LICENSE để biết thêm chi tiết.
