Skip to main content
Glama

nocobase-mcp-server

一个用于 NocoBase 的 MCP(模型上下文协议)服务器,使 Claude 等 AI 助手能够与您的 NocoBase 实例进行交互——读取集合、管理 UI 模式、构建 flowPage 区块,并通过 OpenAPI 运行动态 API 操作。

功能特性

  • 24 个手动构建的工具,涵盖集合、UI 模式、桌面路由、流程模型和 JS 区块

  • 动态工具,根据您的 NocoBase OpenAPI/Swagger 规范自动生成(需要 API 文档插件)

  • 适用于 NocoBase v2.x(已在 2.0.17-full 上测试)

Related MCP server: anyapi-mcp-server

要求

  • Node.js 18+

  • 正在运行的 NocoBase 实例

  • NocoBase API 令牌(root 或具有足够权限)

安装

选项 A — 通过 npm(推荐)

npm install -g @reroet/nocobase-mcp-server

然后添加到 ~/.claude/mcp.json:

{
  "mcpServers": {
    "nocobase": {
      "type": "stdio",
      "command": "nocobase-mcp-server",
      "env": {
        "NOCOBASE_URL": "http://localhost:13000",
        "NOCOBASE_API_TOKEN": "your-api-token-here"
      }
    }
  }
}

或者使用 npx 而无需全局安装:

{
  "mcpServers": {
    "nocobase": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@reroet/nocobase-mcp-server"],
      "env": {
        "NOCOBASE_URL": "http://localhost:13000",
        "NOCOBASE_API_TOKEN": "your-api-token-here"
      }
    }
  }
}

选项 B — 从源码安装

git clone https://github.com/puguhsudarma/nocobase-mcp-server.git
cd nocobase-mcp-server
pnpm install

然后添加到 ~/.claude/mcp.json:

{
  "mcpServers": {
    "nocobase": {
      "type": "stdio",
      "command": "/absolute/path/to/nocobase-mcp-server/node_modules/.bin/tsx",
      "args": ["/absolute/path/to/nocobase-mcp-server/src/index.ts"],
      "env": {
        "NOCOBASE_URL": "http://localhost:13000",
        "NOCOBASE_API_TOKEN": "your-api-token-here"
      }
    }
  }
}

将 /absolute/path/to/nocobase-mcp-server 替换为实际路径(例如 /Users/yourname/Projects/nocobase-mcp-server)。

环境变量

变量

必需

默认值

描述

NOCOBASE_API_TOKEN

是

—

NocoBase API 令牌

NOCOBASE_URL

否

http://localhost:13000

NocoBase 实例基础 URL

获取 API 令牌

  1. 在 NocoBase UI 中:设置 → 插件 → 启用 API keys 插件

  2. 前往 设置 → API keys → 添加 API key

  3. 复制生成的令牌

启用动态工具(可选)

在 NocoBase 中启用 API 文档 插件(设置 → 插件)。启用后,服务器将在启动时自动加载所有额外的 API 端点作为工具。

工具参考

集合

工具

描述

list_collections

列出所有集合

get_collection

按名称获取集合

UI 模式(经典页面)

工具

描述

list_pages

列出所有 UI 模式节点

get_page

按 UID 获取完整的嵌套 UI 模式树

get_parent_schema

获取节点的父模式

create_page

创建一个新的根级 UI 模式节点

insert_new_schema

创建并插入一个新的 UI 模式节点

insert_adjacent_schema

相对于目标节点插入一个模式节点

update_ui_schema

修补现有的 UI 模式节点

batch_patch_ui_schema

在一个请求中修补多个 UI 模式节点

remove_ui_schema

移除 UI 模式节点及其后代 ⚠️

save_as_template

将 UI 模式节点保存为可重用的区块模板

桌面路由 / 导航

工具

描述

list_desktop_routes

列出所有桌面路由(页面、菜单、组、标签页)

流程模型 (flowPage 区块)

工具

描述

get_flow_model

按 UID 获取 flowPage 区块

get_flow_model_by_parent

按父 ID 和 subKey 获取 flowPage 区块

save_flow_model

创建或更新 flowPage 区块

attach_flow_model

将区块附加到 flowPage 容器

move_flow_model

将区块移动到不同位置

duplicate_flow_model

深度复制区块并自动附加它

destroy_flow_model

删除区块及其子项 ⚠️

JS 区块

工具

描述

get_js_block

获取 JS 区块模式(经典页面)

update_js_block

更新 JS 区块代码(经典页面)

update_flow_js_block

更新 flowPage 内的 JS 区块代码 — 使用 ctx.render() 或通过 ctx.libs.React 使用 JSX

⚠️ 破坏性操作无法撤销。

JS 区块沙箱

flowPage JS 区块在 NocoBase 的沙箱中运行。可用 API:

// Render HTML
ctx.render(`<h1>Hello</h1>`);

// Render JSX with React + Ant Design
const { React, antd } = ctx.libs;
const { useState } = React;
const { Table, Tag } = antd;

function MyComponent() {
  const [tab, setTab] = useState("a");
  return <div>...</div>;
}

ctx.render(<MyComponent />);

示例提示词

如何获取 UID:

  • 区块 UID — 在 NocoBase UI 中右键点击任何区块 → 复制 UID(例如 add17a3cf3f)

  • 页面 UID — 打开页面时在浏览器 URL 中可见(例如 http://localhost:13000/page/96acpujiwc6 → UID 为 96acpujiwc6)

不使用 Figma MCP

List all collections in my NocoBase, then create a JS block on flowPage "<your-page-uid>"
that shows a summary dashboard with total records from the "users" collection.
Get the flowPage with UID "<your-page-uid>", add a new JS block below the existing ones
(the grid block UID is "<your-grid-uid>"), and implement a tabbed table showing data
from the "orders" and "products" collections.
Show me all desktop routes, then fetch the UI schema tree of the first page
and explain its block structure.

使用 Figma MCP

Here's my Figma design: https://www.figma.com/board/XXXXXXXXXXXXXXXX/MyApp?node-id=8273-xxxx
Implement it as a JS block on flowPage "<your-page-uid>" (grid UID: "<your-grid-uid>").
Use React + Ant Design from ctx.libs. Use dummy data for now.
Fetch the Figma design at the link above, then create a new JS block on my NocoBase
flowPage and implement the tabs component with the exact columns from the Figma table.
The block UID I want to update is "<your-block-uid>".

贡献

欢迎贡献!要添加新工具:

  1. Fork 仓库并创建一个功能分支

  2. 使用 server.registerTool() 在 src/index.ts 中添加您的工具

  3. 遵循现有模式 — 使用 nocoFetch() 进行 API 调用,并使用 ok() 格式化响应

  4. 更新 README.md 中的工具列表

  5. 提交 Pull Request

对于错误报告或功能请求,请在 GitHub 上提交 issue。

许可证

MIT — 详情请参阅 LICENSE。

Available Tools

23 tools
attach_flow_modelA

Attach an existing flowPage block/model to a parent. Use this to add an existing block into a flowPage container at a specific position.

Inputs: uid (required), parentId (required), subKey (required), subType, +1 more.

batch_patch_ui_schemaA

Patch multiple UI schema nodes in a single request. Each object in the patches array must include 'x-uid' plus the fields to update.

Inputs: patches (required).

create_pageB

Create a new root-level UI schema node in NocoBase

Inputs: schema (required).

destroy_flow_modelA

Delete a flowPage block/model by UID. DESTRUCTIVE — also removes child blocks.

Inputs: uid (required).

duplicate_flow_modelB

Duplicate an existing flowPage block/model (deep copy) and automatically attach it to the same parent. Returns the new block's data.

Inputs: uid (required).

get_collectionB

Get a specific collection by name

Inputs: name (required).

get_flow_modelA

Get a flowPage block/model by UID. Use this for blocks inside flowPage type pages (not classic 'page' type). Returns the block's model data including 'use' (component type), 'parentId', 'stepParams', etc.

Inputs: uid (required), includeAsyncNode.

get_flow_model_by_parentB

Get a flowPage block/model by its parent ID and subKey. Useful for navigating the flowPage block tree.

Inputs: parentId (required), subKey, includeAsyncNode.

get_js_blockA

Get a JS block UI schema by UID (for classic 'page' type pages, not flowPage)

Inputs: uid (required).

get_pageA

Get the full nested UI schema tree for a node by UID (uses :getProperties to include all descendants)

Inputs: uid (required).

get_parent_schemaB

Get the parent UI schema of a node by UID

Inputs: uid (required).

insert_adjacent_schemaA

Insert a schema node at a position relative to a target node. Position values: beforeBegin (prev sibling), afterBegin (first child), beforeEnd (last child), afterEnd (next sibling)

Inputs: uid (required), schema (required), position (required).

insert_new_schemaB

Create and insert a new UI schema node via NocoBase's insertNewSchema action

Inputs: schema (required).

list_collectionsA

List all collections in NocoBase

Inputs: no named parameters.

list_desktop_routesA

List all desktop routes (pages and menus) in NocoBase v2. Each route has a type: 'page', 'flowPage', 'group', 'tabs'. Use schemaUid to fetch page content. Works for both classic pages and flowPages.

Inputs: pageSize.

list_pagesA

List all UI schemas in NocoBase (returns raw schema nodes, not page-level navigation)

Inputs: no named parameters.

move_flow_modelB

Move a flowPage block/model to a different position relative to another block.

Inputs: sourceId (required), targetId (required), position.

remove_ui_schemaA

Remove a UI schema node and all its descendants by UID. DESTRUCTIVE — cannot be undone.

Inputs: uid (required).

save_as_templateB

Save an existing UI schema node as a reusable block template

Inputs: uid (required), values (required).

save_flow_modelA

Create or update a flowPage block/model. If 'uid' is provided in values, it updates; otherwise creates a new one. The 'use' field specifies the component type (e.g. 'JSBlockModel', 'TableBlockModel'). NOTE: after creating, call attach_flow_model to make it appear on the page.

Inputs: values (required).

update_flow_js_blockA

Update the JavaScript code of a JSBlockModel inside a flowPage. Code runs in NocoBase sandbox — use ctx.render(htmlString) to render output. Example: ctx.render(<h1>Hello</h1>);

Inputs: uid (required), code (required).

update_js_blockA

Update the code content of a JS block UI schema by UID (for classic 'page' type pages, not flowPage)

Inputs: uid (required), code (required).

update_ui_schemaB

Patch an existing UI schema node by UID (partial update)

Inputs: uid (required), patch (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 23 tools

    Disambiguation4/5

    Tools are generally distinct, with clear differentiation between flowPage blocks, classic pages, JS blocks, and UI schema operations. However, the high number of flow model and schema tools could cause some confusion, though descriptions help.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern in snake_case, with no mixing of conventions. Examples include 'attach_flow_model', 'batch_patch_ui_schema', 'get_flow_model_by_parent'.

    Tool Count4/5

    23 tools is slightly on the high side but appropriate for a full-featured low-code platform like NocoBase. The count reflects the complexity of managing UI schemas, blocks, collections, and routes without being excessive.

    Completeness4/5

    The tool set covers most essential operations for UI schema management: create, read, update, delete, move, duplicate, and template. Minor gaps exist (e.g., no direct tool for updating page metadata), but these can be handled via update_ui_schema.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that provides AI assistants with access to documentation, schemas, and operations for over 535 n8n workflow automation nodes. It enables models to understand, create, and manage n8n workflows through natural language by connecting to the n8n API.
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      A universal MCP server that connects any REST API to AI assistants via OpenAPI or Postman specifications. It enables dynamic tool creation with GraphQL-style field selection and automatic schema inference for efficient data retrieval.
      42 npm
      6
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Remote MCP server that auto-generates tools from NocoBase OpenAPI specs to enable full CRUD operations on collections across multiple instances. Supports streamable HTTP transport and API key authentication for secure, natural language interaction with NocoBase deployments.
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      An MCP server that enables AI assistants to interact with the VoIPbin CPaaS platform, exposing tools for managing calls, flows, messaging, conferencing, and more.
      66
      2
      MIT