MAX平台文档MCP服务器
MCP服务器,具有用于AI编码代理的本地Max Platform文档。编译后,服务器通过 stdio 它不仅涵盖了Max Bot API,还涵盖了手册、Mini Apps/Max Bridge API和UI组件库。
项目覆盖范围
- 29个Max Bot API
- 26个数据模型
- 8个类别的20个指南
- 小型应用程序的Max Bridge API:6个对象和17个事件
- 35个MAX UI组件
- 8个MCP工具 (使用筛选器搜索,示例代码,Endpoint Lookup)
- 4个MCP提示 (创建机器人、消息模式、迷你应用程序、诊断)
- 带有自动附加组件的高级资源集
要求
- Node.js
>= 18 - npm
>= 8
检查:
node --version
npm --version安装和装配
git clone https://github.com/Launchery/max_docs_mcp.git
cd max_docs_mcp
npm install
npm run build组装后的入口点: dist/index.js.
从存储库根本地运行已经有一个示例 ./.mcp.json.
快速启动
git clone https://github.com/Launchery/max_docs_mcp.git
cd max_docs_mcp
npm install
npm run build
echo "$(pwd)/dist/index.js"然后将此路径连接到您的MCP客户端,如 stdio服务器 :
{
"mcpServers": {
"max-docs": {
"command": "node",
"args": ["/absolute/path/to/max_docs_mcp/dist/index.js"]
}
}
}连接到客户端
服务器使用 stdio,所以方案到处都是一样的:客户端启动 node /dist/index.js 作为子过程。
克劳德代码
claude mcp add --scope user max-docs -- node "/absolute/path/to/max_docs_mcp/dist/index.js"会议核实:
/mcp克劳德桌面
添加块 mcpServers.max-docs 在 claude_desktop_config.json:
{
"mcpServers": {
"max-docs": {
"command": "node",
"args": ["/absolute/path/to/max_docs_mcp/dist/index.js"]
}
}
}光标
创建 .cursor/mcp.json 在工作项目中:
{
"mcpServers": {
"max-docs": {
"command": "node",
"args": ["/absolute/path/to/max_docs_mcp/dist/index.js"]
}
}
}帆板运动
添加相同的 stdio-服务器B mcp_config.json:
{
"mcpServers": {
"max-docs": {
"command": "node",
"args": ["/absolute/path/to/max_docs_mcp/dist/index.js"]
}
}
}VS代码+继续
mcpServers:
- name: max-docs
command: node
args:
- /absolute/path/to/max_docs_mcp/dist/index.jsOpenAI Codex命令行界面
{
"mcpServers": {
"max-docs": {
"command": "node",
"args": ["/absolute/path/to/max_docs_mcp/dist/index.js"]
}
}
}或通过旗帜:
codex --mcp-config '{"max-docs":{"command":"node","args":["/absolute/path/to/max_docs_mcp/dist/index.js"]}}'OpenCode命令行界面
[mcp.max-docs]
type = "stdio"
command = "node"
args = ["/absolute/path/to/max_docs_mcp/dist/index.js"]演示
要快速录制GIF/屏幕截图/终端演示,请参阅。 DEMO-SCRIPT.md.
Demo Path版本:
npm install && npm run build- 显示MCP配置
max-docs - 显示成功
initialize - 显示
tools/call为了list_guides或search_docs
性能检查
装配:
npm run build直接发射:
npm start服务器必须启动并等待stdin JSON-RPC消息。
检查 initialize 手动:
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0.0"}}}' | node dist/index.js答复应为:
"name": "max-docs""version": "2.0.0"
手动检查呼叫工具:
printf '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0.0"}}}\n{"jsonrpc":"2.0","method":"notifications/initialized"}\n{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"list_guides","arguments":{}}}\n' | node dist/index.js 2>/dev/null可用的工具
服务器注册7个工具。
ÐtoolÐÐÐÐÐÐÐÐÐÐÐ | --- | --- | --- | | list_endpoints ÐÐÐÐÐÐÐÐÐÐÐÐÐ | get_endpoint | method, path –特定Endpoint的完整文档。 | search_docs | query 搜索Endpoint am、Models、Guide am、Bridge API和UI组件› | list_guides | category? –列出所选类别的所有指南或指南› | get_guide | id –完整的指南-通过ID→ | get_bridge_api | object? –Max Bridge API概述、Bridge API对象或事件列表› | get_component | name? –MAX UI概述或特定组件的描述›
类别 list_guides
platformchatbottutorialssdkmini-appschannelspartnerslegal
可用的Guide ID
connection-guide
service-selection
bot-creation
nocode-bot-creation
bot-management
bot-coding-preparation
hello-bot-javascript
hello-bot-go
sdk-javascript
sdk-go
channel-creation
channel-management
partner-integration
legal-rules
legal-requirements
legal-agreement
legal-privacy
bridge-api
mini-apps-introduction
data-validation可用的Bridge API对象
BackButton
ScreenCapture
HapticFeedback
BiometricManager
DeviceStorage
SecureStorage
events组件示例 get_component
Button
Input
Avatar.Container
Flex
Typography.Title
Profile可用资源
API和模型
max-docs://overviewmax-docs://api/botmax-docs://api/chatsmax-docs://api/pinned-messagesmax-docs://api/membersmax-docs://api/messagesmax-docs://api/subscriptionsmax-docs://api/uploadsmax-docs://api/callbacksmax-docs://modelsmax-docs://models/{name}
手册
max-docs://guidesmax-docs://guides/platformmax-docs://guides/chatbotmax-docs://guides/tutorialsmax-docs://guides/sdkmax-docs://guides/mini-appsmax-docs://guides/channelsmax-docs://guides/partnersmax-docs://guides/legalmax-docs://guides/{id}
迷你应用程序/Bridge API
max-docs://mini-appsmax-docs://mini-apps/bridge-apimax-docs://mini-apps/bridge-api/eventsmax-docs://mini-apps/bridge-api/{name}
用户界面组件
max-docs://ui-componentsmax-docs://ui-components/{name}
代理请求示例
Покажи все эндпоинты MAX Bot API и объясни, какой использовать для отправки сообщения.Используй документацию MAX и покажи guide по созданию чат-бота.Какие события есть у MAX Bridge API и как слушать кнопку "назад"?Найди в MAX UI компонент Button и покажи его параметры.Подскажи, как валидировать данные мини-приложения в MAX.项目结构
max_docs_mcp/
├── .mcp.json
├── README.md
├── package.json
├── tsconfig.json
├── src/
│ ├── index.ts
│ ├── server.ts
│ ├── data/
│ │ ├── overview.ts
│ │ ├── types.ts
│ │ ├── endpoints/
│ │ ├── models/
│ │ ├── guides/
│ │ ├── mini-apps/
│ │ └── ui-components/
│ ├── resources/
│ │ └── registry.ts
│ ├── tools/
│ │ ├── list-endpoints.ts
│ │ ├── get-endpoint.ts
│ │ ├── search-docs.ts
│ │ ├── list-guides.ts
│ │ ├── get-guide.ts
│ │ ├── get-bridge-api.ts
│ │ └── get-component.ts
│ └── utils/
│ ├── formatter.ts
│ └── search.ts
└── dist/开发
工作方式:
npm run build
npm run dev
npm start如果您添加新文档:
- 将相应的文件更新到
src/data/... - 将导出添加到所需的
index.ts - 如果出现新的MCP工具或资源,请在
src/server.ts或src/resources/registry.ts - 通过
npm run build
故障排除
服务器无法启动
npm run build
node dist/index.js如果进程没有立即崩溃,服务器将正确启动并等待stdin。
客户端看不到MCP服务器
- 检查是否指定了绝对路径
dist/index.js - 重新选择项目:
npm run build - 配置更改后重新启动MCP客户端
- Claude Code查看
/mcp
文件看起来很旧。
git pull
npm install
npm run build错误 Cannot find module
重新安装依赖项并重新排序项目:
rm -rf node_modules dist
npm install
npm run buildMCP注册表
服务器已为Submission B准备 MCP注册表文件 server.json 包含要发布的元数据。
# После npm publish
# Submit to MCP Registry (requires GitHub auth)
curl -X POST https://registry.modelcontextprotocol.io/v0/publish \
-H "Authorization: Bearer $MCP_REGISTRY_TOKEN" \
-H "Content-Type: application/json" \
--data @server.json