nocobase-mcp-setup
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGoal
目标
Configure the NocoBase MCP connection for the user's coding agent CLI and verify that the server is reachable and authenticated.
为用户的编码Agent CLI配置NocoBase MCP连接,并验证服务器是否可访问且已通过认证。
Workflow
操作流程
- Confirm which app endpoint should be used:
- Main app:
http(s)://<host>:<port>/api/mcp - Non-main app:
http(s)://<host>:<port>/api/__app/<app_name>/mcp
- Main app:
- Verify NocoBase is running and accessible.
- Determine the auth mode:
- API Key: require the plugin and an existing API key
API Keys - OAuth: require the plugin
IdP: OAuth
- API Key: require the
- Guide the user to add the NocoBase MCP server using the command for their CLI.
- Verify the MCP connection by checking the registered server and available tools.
- 确认应使用哪个应用端点:
- 主应用:
http(s)://<host>:<port>/api/mcp - 非主应用:
http(s)://<host>:<port>/api/__app/<app_name>/mcp
- 主应用:
- 验证NocoBase是否正在运行且可访问。
- 确定认证模式:
- API Key:需要插件和现有的API密钥
API Keys - OAuth:需要插件
IdP: OAuth
- API Key:需要
- 指导用户使用其CLI对应的命令添加NocoBase MCP服务器。
- 通过检查已注册的服务器和可用工具来验证MCP连接。
Service Notes
服务说明
- NocoBase MCP uses the transport protocol.
streamable HTTP - NocoBase exposes:
- NocoBase core and plugin APIs
- A generic CRUD tool for operating on collections
- NocoBase MCP使用传输协议。
streamable HTTP - NocoBase开放以下能力:
- NocoBase核心及插件API
- 用于操作集合的通用CRUD工具
MCP Configuration
MCP配置
Choose commands based on the user's CLI and auth mode.
Codex with API Key
bash
export NOCOBASE_API_TOKEN=<your_api_key>
codex mcp add nocobase --url http://<host>:<port>/api/mcp --bearer-token-env-var NOCOBASE_API_TOKENCodex with OAuth
bash
codex mcp add nocobase --url http://<host>:<port>/api/mcp
codex mcp login nocobase --scopes mcp,offline_accessClaude Code with API Key
bash
claude mcp add --transport http nocobase http://<host>:<port>/api/mcp --header "Authorization: Bearer <your_api_key>"Claude Code with OAuth
bash
claude mcp add --transport http nocobase http://<host>:<port>/api/mcpThen open Claude and complete login from the MCP panel:
bash
claude
/mcpOther CLIs
Use the same endpoint pattern and auth mode supported by the CLI.
根据用户的CLI和认证模式选择对应的命令。
Codex 搭配API Key
bash
export NOCOBASE_API_TOKEN=<your_api_key>
codex mcp add nocobase --url http://<host>:<port>/api/mcp --bearer-token-env-var NOCOBASE_API_TOKENCodex 搭配OAuth
bash
codex mcp add nocobase --url http://<host>:<port>/api/mcp
codex mcp login nocobase --scopes mcp,offline_accessClaude Code 搭配API Key
bash
claude mcp add --transport http nocobase http://<host>:<port>/api/mcp --header "Authorization: Bearer <your_api_key>"Claude Code 搭配OAuth
bash
claude mcp add --transport http nocobase http://<host>:<port>/api/mcp然后打开Claude并从MCP面板完成登录:
bash
claude
/mcp其他CLIs
使用CLI支持的相同端点模式和认证模式。
Prerequisites
前置条件
- NocoBase is installed and running
- The correct app endpoint is known
- For API Key auth:
- plugin is enabled
API Keys - an API key has been created
- For OAuth auth:
- plugin is enabled
IdP: OAuth
- NocoBase已安装并运行
- 已知正确的应用端点
- 对于API Key认证:
- 插件已启用
API Keys - 已创建API密钥
- 对于OAuth认证:
- 插件已启用
IdP: OAuth
Verification
验证
After configuration, verify that NocoBase MCP tools are available for NocoBase API operations such as collections and fields.
For Codex CLI, use:
bash
codex mcp list
codex mcp get nocobaseFor Claude Code, start Claude and inspect the MCP entry:
bash
claude
/mcp配置完成后,验证NocoBase MCP工具是否可用于NocoBase API操作,例如集合和字段相关操作。
对于Codex CLI,使用:
bash
codex mcp list
codex mcp get nocobase对于Claude Code,启动Claude并检查MCP条目:
bash
claude
/mcp