cn-llm-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@cn-llm-mcpsummarize this text into three key points"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
cn-llm-mcp
本地 MCP Server,用来让 Claude、Codex、Cursor 等支持 MCP 的 agent 把低风险小任务委托给低成本模型执行,主 agent 负责审核结果。
它按 OpenAI-compatible Chat Completions 接口实现,支持 DeepSeek、通义千问兼容模式、Kimi、智谱、豆包,也支持自定义兼容服务。
适合做什么
摘要、改写、文案初稿
README、说明文档、邮件草稿
简单 HTML/CSS/JS 页面初稿
小范围测试草稿
低风险机械代码修改建议
不建议把安全、权限、支付、生产数据、复杂架构判断、密钥、cookie、令牌或隐私数据委托给这个工具。
客户本地安装
客户需要自己准备国内模型或代理服务的 API Key。API Key 留在客户自己的电脑上。
git clone <你的仓库地址> cn-llm-mcp
cd cn-llm-mcp
npm install
npm run build
cp .env.example .env然后编辑 .env,填入客户自己的 API Key。
DeepSeek 示例:
CN_LLM_PROVIDER=deepseek
CN_LLM_API_KEY=replace_me
CN_LLM_MODEL=deepseek-chat自定义 OpenAI-compatible 代理示例:
CN_LLM_PROVIDER=custom
CN_LLM_BASE_URL=https://example.com/v1
CN_LLM_MODEL=your-model
CN_LLM_API_KEY=replace_me服务启动时会自动读取项目根目录的 .env。
自检
npm run doctor自检会检查:
Node.js 版本是否 >= 20
dist/index.js是否存在.env是否存在CN_LLM_API_KEY是否填写MCP 是否能列出
run_cn_model和draft_code_patch
doctor 不会真实调用模型生成内容。
常用 provider
# DeepSeek
CN_LLM_PROVIDER=deepseek
CN_LLM_MODEL=deepseek-chat
# 通义千问 OpenAI 兼容模式
CN_LLM_PROVIDER=qwen
CN_LLM_MODEL=qwen-plus
# Kimi
CN_LLM_PROVIDER=kimi
CN_LLM_MODEL=moonshot-v1-8k
# 智谱
CN_LLM_PROVIDER=zhipu
CN_LLM_MODEL=glm-4-flash
# 豆包,需要按火山方舟创建的 endpoint/model 调整
CN_LLM_PROVIDER=doubao
CN_LLM_MODEL=doubao-seed-1-6-250615Claude Desktop 配置
把下面配置加入 Claude Desktop 的 MCP 配置文件。把路径替换成客户本机的绝对路径。
{
"mcpServers": {
"cn-llm-worker": {
"command": "node",
"args": ["/absolute/path/to/cn-llm-mcp/dist/index.js"]
}
}
}模板文件:
Codex 配置
把下面配置加入 ~/.codex/config.toml。把路径替换成客户本机的绝对路径。
[mcp_servers.cn-llm-worker]
command = "node"
args = ["/absolute/path/to/cn-llm-mcp/dist/index.js"]
startup_timeout_sec = 30模板文件:
Cursor 配置
Cursor 的 MCP 配置通常也是 JSON。把路径替换成客户本机的绝对路径。
{
"mcpServers": {
"cn-llm-worker": {
"command": "node",
"args": ["/absolute/path/to/cn-llm-mcp/dist/index.js"]
}
}
}模板文件:
建议给 agent 的规则
可以把下面规则加入 Claude Project instructions、Codex AGENTS.md 或 Cursor rules:
对于低风险、小范围、机械性任务,可以优先调用 `cn-llm-worker` 让低成本模型生成草稿,例如摘要、文案、README 初稿、简单测试草稿、小型 patch 或简单网页初稿。
不要把 secrets、API key、cookie、令牌、隐私数据或无关的大段上下文发送给 `cn-llm-worker`。
收到 `cn-llm-worker` 的结果后,必须由主 agent 审核;涉及安全、权限、支付、数据一致性、复杂架构判断或高风险代码时,不要委托给该工具。
如果调用了 `cn-llm-worker`,请告诉用户 provider、model 和 token usage。如果没有调用,不要假装调用。模板文件:
暴露的工具
run_cn_model
通用任务委托工具。适合摘要、文案、方案、简单代码草稿。
参数示例:
{
"task": "把下面内容整理成三点摘要",
"context": "需要处理的内容",
"output_format": "text"
}draft_code_patch
代码 patch 草稿工具。适合小范围、低风险代码任务。
参数示例:
{
"task": "给 add 函数补一个边界测试",
"files": [
{
"path": "src/math.ts",
"content": "export function add(a: number, b: number) { return a + b; }"
}
],
"constraints": "只返回 unified diff"
}测试提示词
配置完成后,在 agent 里测试:
优先使用 cn-llm-worker。请让低成本模型用三句话解释 MCP 是什么,然后你审核它的回答。如果调用成功,agent 应该能看到 provider、model 和 usage。
常见问题
401 invalid credentials
API Key 无效、过期、填错,或代理服务不接受当前 key。重新生成 API Key 后更新 .env。
404 Not Found
通常是 CN_LLM_BASE_URL 不对。OpenAI-compatible 服务一般需要以 /v1 结尾,例如:
CN_LLM_BASE_URL=https://example.com/v1model not found
CN_LLM_MODEL 不在服务商支持列表里。改成服务商文档里的模型名。
agent 看不到工具
先运行:
npm run doctor如果 doctor 正常,重启 Claude/Codex/Cursor,确认 MCP 配置里的路径是绝对路径并且指向 dist/index.js。
安全说明
.env不要提交到仓库。客户应使用自己的 API Key。
这个 MCP Server 不会直接修改文件,只返回文本或 patch 草稿。
最终应用 patch、运行测试和判断风险应由主 agent 完成。
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
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/ZhuoS62/cn-llm-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server