nocobase-mcp-setup

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Goal

目标

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

操作流程

  1. 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
  2. Verify NocoBase is running and accessible.
  3. Determine the auth mode:
    • API Key: require the
      API Keys
      plugin and an existing API key
    • OAuth: require the
      IdP: OAuth
      plugin
  4. Guide the user to add the NocoBase MCP server using the command for their CLI.
  5. Verify the MCP connection by checking the registered server and available tools.
  1. 确认应使用哪个应用端点:
    • 主应用:
      http(s)://<host>:<port>/api/mcp
    • 非主应用:
      http(s)://<host>:<port>/api/__app/<app_name>/mcp
  2. 验证NocoBase是否正在运行且可访问。
  3. 确定认证模式:
    • API Key:需要
      API Keys
      插件和现有的API密钥
    • OAuth:需要
      IdP: OAuth
      插件
  4. 指导用户使用其CLI对应的命令添加NocoBase MCP服务器。
  5. 通过检查已注册的服务器和可用工具来验证MCP连接。

Service Notes

服务说明

  • NocoBase MCP uses the
    streamable HTTP
    transport protocol.
  • 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_TOKEN
Codex with OAuth
bash
codex mcp add nocobase --url http://<host>:<port>/api/mcp
codex mcp login nocobase --scopes mcp,offline_access
Claude 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/mcp
Then open Claude and complete login from the MCP panel:
bash
claude
/mcp
Other 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_TOKEN
Codex 搭配OAuth
bash
codex mcp add nocobase --url http://<host>:<port>/api/mcp
codex mcp login nocobase --scopes mcp,offline_access
Claude 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:
    • API Keys
      plugin is enabled
    • an API key has been created
  • For OAuth auth:
    • IdP: OAuth
      plugin is enabled
  • 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 nocobase
For 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