Slima MCP
OfficialSlima MCP
MCP(模型上下文协议)服务器,适用于 Slima —— 面向小说作者的 AI 写作集成开发环境。
将您的 Slima 书籍连接到 任何兼容 MCP 的 AI 工具 —— 一个服务器,全平台覆盖。
支持的平台
桌面应用(本地 MCP - stdio)
平台 | 状态 | 备注 |
Claude Desktop | ✅ | 原生 MCP 支持 |
ChatGPT Desktop | ✅ | 开发者模式 (2025.10+) |
Gemini CLI | ✅ | 原生 MCP 支持 |
Cursor | ✅ | 原生 MCP 支持 |
VS Code | ✅ | 通过 MCP 扩展 |
网络应用(远程 MCP - HTTP)
平台 | 状态 | 备注 |
Claude.ai | ✅ | OAuth 登录,无需令牌 |
ChatGPT Web | ✅ | OAuth 登录,无需令牌 |
MCP 于 2025 年 12 月成为行业标准,当时 Anthropic、OpenAI 和 Block 在 Linux 基金会下共同创立了 Agentic AI 基金会。
Related MCP server: scrumdo-mcp
功能
书籍管理
创建 新书
列出并查看您的书籍
获取文件/文件夹结构
跟踪写作统计
文件操作
读取 任何文件(按路径)
编辑 特定文本(搜索并替换)
写入(替换)文件内容
创建 新文件
删除 文件
追加 内容到文件
搜索 所有文件
AI Beta Reader
从虚拟读者角色获取反馈
以不同读者视角分析章节
快速开始
选择与您使用 AI 的方式相匹配的路径:
推荐:claude.ai / ChatGPT Web(自动更新)
如果您在浏览器中与 Claude 或 ChatGPT 对话,这是最简单且最面向未来的选项。一次配置,您将自动获得每个 Slima MCP 更新 —— 无需升级命令,无需配置编辑。
MCP URL: https://mcp.slima.ai/mcp
claude.ai(Pro / Max / Team / Enterprise)
登录 claude.ai。
打开 设置 → 连接器(或 集成,取决于您的套餐)。
点击 添加自定义连接器。
填写:
名称:
SlimaURL:
https://mcp.slima.ai/mcp
点击 连接 → 您将被重定向到 slima.ai 进行批准 → 返回 claude.ai。
Slima 工具图标出现在您的聊天输入中。完成。
ChatGPT(Plus / Pro,开发者模式)
登录 chatgpt.com。
打开 设置 → 连接器 → 高级 并开启 开发者模式(2025.10+)。
返回 连接器,点击 创建 → 自定义 MCP 服务器。
填写:
名称:
Slima服务器 URL:
https://mcp.slima.ai/mcp认证: OAuth
点击 创建 → 批准 OAuth 流程。
设置完成后,Slima 功能会在下次对话时自动推出。无需重启,无需重装。
本地:Claude Desktop / Cursor / Gemini CLI
如果您需要离线友好操作、更快的启动,或者需要与其他 stdio 服务器一起运行 MCP,请使用此选项。
推荐配置 —— 锁定到主要版本,这样您可以自动获得新功能,但绝不会因 1.0 版本而崩溃:
Claude Desktop
编辑 ~/Library/Application Support/Claude/claude_desktop_config.json(macOS)或 %APPDATA%\Claude\claude_desktop_config.json(Windows):
{
"mcpServers": {
"slima": {
"command": "npx",
"args": ["-y", "slima-mcp@0"],
"env": {
"SLIMA_API_TOKEN": "slima_your_token_here"
}
}
}
}从 Slima 设置 获取令牌,或运行 npx slima-mcp@0 auth 一次将其保存到磁盘。
Cursor
{
"mcpServers": {
"slima": {
"command": "npx",
"args": ["-y", "slima-mcp@0"],
"env": {
"SLIMA_API_TOKEN": "slima_your_token_here"
}
}
}
}Gemini CLI
gemini mcp add slima --command "npx -y slima-mcp@0"为什么使用
slima-mcp@0而不是slima-mcp/slima-mcp@latest? 使用@0锁定当前主要版本 —— npx 仍然会自动获取新的0.x.y版本(因此您会获得功能和错误修复),但当我们发布带有破坏性变更的1.0.0时,您不会在未更新配置的情况下静默接收。我们将在发布说明中宣布@1切换。
从全局安装迁移
如果您已经通过 npm install -g slima-mcp 全局安装:
# Remove the old global install (optional but cleaner)
npm uninstall -g slima-mcp
# Change your config `command` from "slima-mcp" to the npx form above, and restart the client.或者,如果您想保留全局安装,请记住定期运行:
npm install -g slima-mcp@latest否则,您的本地客户端将与 Slima 后端公开的 MCP 工具/架构脱节。
自托管(高级)
您也可以克隆此仓库并自行部署 Cloudflare Worker。参见 wrangler.toml + npm run deploy:worker。正常使用不需要。
远程 MCP 安全性
托管的远程 MCP 服务器位于 https://mcp.slima.ai/mcp,使用:
OAuth 2.0 + PKCE 用于认证 —— 无需复制粘贴令牌。
无秘密存储在服务器端 —— 凭证永远不会离开 Slima 的认证服务器。
基于会话:OAuth 令牌存储在 Cloudflare KV 中,每个会话范围内。
随时可撤销,从 Slima 设置 进行。
书籍类型:Writing Studio vs Script Studio
Slima 书籍有两种类型,由 book_type 字段区分。MCP 对两种类型的行为略有不同:
📖 Writing Studio( | 📝 Script Studio( | |
通过 MCP 创建 | ✅ | ❌ 使用 Slima 应用 UI |
读取(任意文件) | ✅ | ✅ |
写入 / 编辑 / 删除 | ✅ 任意路径 | ✅ 仅限 |
结构化文件( | 不适用 | ❌ 通过 MCP 只读 —— 编辑必须通过 Script Studio UI |
| ✅ | ❌ 结构化场景尚不支持 |
| 所有文件 | 默认排除结构化文件;传入 |
对于每本书的详细信息,请让您的 AI 客户端读取资源 slima://books/{book_token}/schema —— 它返回一个 JSON 规范,精确说明该书的哪些路径是可写/只读的。
list_books 为每本书标记其工作室图标(📝 / 📖),以便您(和 AI)一目了然。
可用工具
书籍管理
工具 | 描述 |
| 在您的库中创建新书 |
| 列出 Slima 库中的所有书籍 |
| 获取特定书籍的详细信息 |
| 获取书的文件/文件夹结构 |
| 获取书的写作统计 |
文件操作
工具 | 描述 |
| 按路径读取任何文件的内容 |
| 使用搜索和替换编辑特定文本 |
| 替换整个文件的内容 |
| 在书中创建新文件 |
| 从书中删除文件 |
| 将内容追加到文件末尾 |
| 在所有文件中搜索文本 |
AI Beta Reader
工具 | 描述 |
| 列出可用的 Beta Reader 角色 |
| 获取 AI Beta Reader 对章节的反馈 |
使用示例
配置完成后,您可以询问 AI:
书籍与内容:
"创建一本名为 'My Novel' 的新书"
"列出我在 Slima 中的书籍"
"显示我小说的结构"
"阅读我书的第 3 章"
"我的写作统计数据是多少?"
文件操作:
"读取我主角的角色档案"
"编辑第 1 章,将 'John' 改为 'James'"
"创建一个名为 worldbuilding.md 的新文件,内容是关于魔法系统的笔记"
"在我的书中搜索所有提到 'blue eyes' 的地方"
"将这个新段落追加到第 5 章"
AI 反馈:
"从年轻读者的角度获取第 5 章的反馈"
"从评论家的角度分析我的开篇场景"
CLI 命令
slima-mcp auth # Authenticate with browser (recommended)
slima-mcp status # Check authentication status
slima-mcp logout # Remove saved credentials
slima-mcp --help # Show help
slima-mcp --version # Show version令牌存储在 ~/.slima/credentials.json,具有安全权限。
环境变量
变量 | 必需 | 默认值 | 描述 |
| 否* | - | 您的 Slima API 令牌 |
| 否 |
| API 端点(用于开发) |
| 否 |
| 启用调试日志 |
*如果使用了 slima-mcp auth,则不需要。
开发
本地 CLI 开发
# Clone the repository
git clone https://github.com/slima-ai/slima-mcp.git
cd slima-mcp
# Install dependencies
npm install
# Build CLI
npm run build
# Run tests
npm test
# Run in development mode
npm run devCloudflare Worker 开发
# Build the Worker
npm run build:worker
# Run Worker locally
npm run dev:worker
# Deploy to Cloudflare
npm run deploy:worker
# Deploy to preview environment
npm run deploy:worker:preview项目结构
slima-mcp/
├── src/
│ ├── core/ # Shared core modules
│ │ ├── api/ # Slima API Client
│ │ ├── tools/ # MCP Tool implementations
│ │ └── utils/ # Utilities and errors
│ ├── cli/ # CLI entry point (stdio transport)
│ │ ├── index.ts # CLI main
│ │ ├── auth.ts # Authentication commands
│ │ └── server.ts # MCP Server for CLI
│ └── worker/ # Cloudflare Worker (HTTP transport)
│ ├── index.ts # Worker entry point
│ └── oauth.ts # OAuth 2.0 + PKCE client
├── wrangler.toml # Cloudflare Worker config
├── tsup.config.ts # CLI build config
└── tsup.worker.config.ts # Worker build config安全性
API 令牌本地存储,绝不共享
与 Slima API 的所有通信使用 HTTPS
令牌可随时从 Slima 设置中撤销
发布与部署
npm(自动)
合并到 main,并更新 package.json 中的版本号,将通过 GitHub Actions 自动触发 npm 发布。
# 1. Bump version on dev branch
npm version patch # 0.1.10 → 0.1.11
# 2. Merge to main
git checkout main && git merge dev && git push
# 3. CI runs tests → publish.yml publishes to npm + creates git tagCloudflare Worker(手动)
Worker 部署与 npm 分开。在代码更改后部署:
npm run deploy:worker # Production (mcp.slima.ai)
npm run deploy:worker:preview # StagingMCP 注册表(手动)
在 MCP 注册表 上发布/更新服务器列表:
mcp-publisher login github
mcp-publisher publish需要在 package.json 和仓库根目录中的 server.json 中包含 mcpName。
操作说明
调试 Worker OAuth
当排查 claude.ai 或 ChatGPT 连接器问题时:
# Live logs from production Worker
wrangler tail slima-mcp所有 OAuth 端点记录关键参数(client_id、redirect_uri、令牌前缀等)以帮助跟踪流程。
Worker OAuth 流程(claude.ai / ChatGPT)
Client POST /mcp → 401 + WWW-Authenticate header
→ Client GET /.well-known/oauth-protected-resource
→ Client GET /.well-known/oauth-authorization-server
→ Client POST /register (DCR)
→ Client redirects user to GET /authorize
→ Worker redirects to Rails OAuth
→ User authorizes → Rails redirects to Worker /callback
→ Worker issues auth code → redirects to client callback
→ Client POST /token (exchange code for access_token)
→ Client POST /mcp (Authorization: Bearer {access_token})已知约束
Worker Bearer token 验证接受所有非空 token(不仅限于
slima_前缀),以支持 OAuth 颁发的 token。Rails API 执行实际验证。getTokenFromSession()首先检查 Authorization 头部,然后回退到 cookie 会话。MCP Inspector (
npx @modelcontextprotocol/inspector) 可用于独立测试完整的 OAuth 流程。
许可证
MIT
链接
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAquality-maintenanceEnables AI assistants to read, write, organize, search, and compile Scrivener writing projects. Supports manuscript editing, document management, consistency checking, and PDF export for writers using Scrivener 3.228

scrumdo-mcpofficial
AlicenseAqualityAmaintenanceConnects MCP-compatible AI tools to ScrumDo boards, enabling card, task, comment, and search operations without manual copy-pasting.45MIT
Loreum MCP Serverofficial
Alicense-qualityCmaintenanceConnects MCP-compatible AI assistants to query and modify worldbuilding data (entities, relationships, timelines, etc.) with changes going through a review queue.2AGPL 3.0- Alicense-qualityAmaintenanceEnables semantic search over local Calibre libraries via MCP, allowing AI assistants to query books, annotations, and export bibliographies while keeping data private.5MIT
Related MCP Connectors
Your memory, everywhere AI goes. Build knowledge once, access it via MCP anywhere.
MCP connector that lets ChatGPT list, search, and run your Apple Shortcuts via a local Mac agent
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/slima-ai/slima-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server