RuleGo RuleGo
🏠Home
  • Quick Start
  • Rule Chain
  • Standard Components
  • Extension Components
  • Custom Components
  • Visualization
  • RuleGo-Server
  • AOP
  • Trigger
  • Advanced Topics
  • Performance
  • Standard Components
  • Extension Components
  • Custom Components
  • Components Marketplace
  • Overview
  • Quick Start
  • Routing
  • DSL
  • API
  • Options
  • Components
🔥Editor (opens new window)
  • RuleGo Editor (opens new window)
  • RuleGo Server (opens new window)
  • StreamSQL
  • AI Agent Framework
  • TPCLAW Agent Platform (opens new window)
  • Github (opens new window)
  • Gitee (opens new window)
  • Changelog (opens new window)
  • English
  • 简体中文
🏠Home
  • Quick Start
  • Rule Chain
  • Standard Components
  • Extension Components
  • Custom Components
  • Visualization
  • RuleGo-Server
  • AOP
  • Trigger
  • Advanced Topics
  • Performance
  • Standard Components
  • Extension Components
  • Custom Components
  • Components Marketplace
  • Overview
  • Quick Start
  • Routing
  • DSL
  • API
  • Options
  • Components
🔥Editor (opens new window)
  • RuleGo Editor (opens new window)
  • RuleGo Server (opens new window)
  • StreamSQL
  • AI Agent Framework
  • TPCLAW Agent Platform (opens new window)
  • Github (opens new window)
  • Gitee (opens new window)
  • Changelog (opens new window)
  • English
  • 简体中文

广告采用随机轮播方式显示 ❤️成为赞助商
  • Quick Start

  • Rule Chain

  • Standard Components

  • Extension Components

  • Custom Components

  • Components marketplace

  • Visualization

  • AOP

  • Trigger

  • Advanced Topic

  • Agent Framework

  • RuleGo-Server

    • Overview and Quick Start
    • Installation and Deployment
    • Authentication and Authorization
    • REST API Reference
    • MCP Service
      • What is MCP
      • Configuration
        • User Configuration
      • MCP Endpoints
        • Default Endpoint (All Tools)
        • Group Endpoint (Tool Subset)
      • Authentication Methods
      • Tool Types
        • 1. Management API Tools (Default Endpoint)
        • 2. Component Tools (Exposed via Groups)
        • 3. Rule Chain Tools (Exposed via Groups)
      • Group Control
      • Connecting AI Clients
        • Claude Code
        • Cursor
        • Trae
        • Cherry Studio
      • Creating Custom MCP Endpoints via the Editor
        • Steps
        • Example: Temperature Conversion Tool
      • Core Value
    • AI Features
    • Component Marketplace
    • Run Logs
    • Internationalization
    • Extension Development
    • Deploying and Invoking Rule Chains
    • Visual Editor

  • FAQ

  • Endpoint Module

  • Support

  • StreamSQL

目录

MCP Service

RuleGo-Server supports MCP (Model Context Protocol). When enabled, the system automatically registers management APIs as MCP tools. Components and rule chains can be exposed on demand through group configuration, enabling AI assistants (Claude Code, Cursor, Windsurf, etc.) to directly operate rule chains and invoke components.

# What is MCP

MCP is a standardized protocol that provides AI with context-aware capabilities for application systems, going beyond code completion or Q&A. MCP acts like a USB-C interface — providing AI with a standardized way to connect to data sources and tools.

# Configuration

[mcp]
# Whether to enable MCP service
enable = true
1
2
3

# User Configuration

Using MCP requires configuring an apiKey for the user:

[users]
admin = admin,ak-2af255ea5618467d914c67a8beeca31d
user01 = user01,ak-another-key
1
2
3

# MCP Endpoints

# Default Endpoint (All Tools)

http://{host}:{port}/api/v1/mcp/{apiKey}
1

# Group Endpoint (Tool Subset)

http://{host}:{port}/api/v1/mcp/{apiKey}/group/{groupName}
1

After successful startup, the console prints the MCP address:

RuleGo-Server mcp server running at http://127.0.0.1:9090/api/v1/mcp/ak-xxx
1

# Authentication Methods

The MCP endpoint supports three authentication methods (in priority order):

Method Format
URL Path Parameter /api/v1/mcp/{apiKey}
Authorization Header Authorization: Bearer {apiKey}
X-API-Key Header X-API-Key: {apiKey}

# Tool Types

The MCP default endpoint registers management API tools. Component and rule chain tools are exposed through group configuration.

# 1. Management API Tools (Default Endpoint)

Tool Name Function Required Parameters
list_rule_chains List/search rule chains None (optional keywords, root, disabled, page, size)
get_rule_chain Get rule chain definition id
preview_rule_chain Preview rule chain (without saving) id, body
save_rule_chain Create/update rule chain id, body
delete_rule_chain Delete rule chain id
operate_rule_chain Deploy/stop rule chain id, action (deploy/undeploy)
execute_rule_chain Execute rule chain id, message
list_components List available components None (optional category)
get_component_doc Get component documentation type (optional types array for batch query)
list_node_pool List shared node pool None

# 2. Component Tools (Exposed via Groups)

Register RuleGo components as MCP tools through group configuration. The tool name is the component type name.

Parameters are automatically generated from the component's form definition (ComponentForm.Fields), including name, type, description, default value, and whether required.

Example: Call the restApiCall component to make HTTP requests, or the dbClient component to query databases.

# 3. Rule Chain Tools (Exposed via Groups)

Register deployed rule chains as MCP tools through group configuration. The tool name is the rule chain ID.

Parameter sources (in priority order):

  1. Rule chain's additionalInfo.inputSchema
  2. DSL template variable resolution
  3. Default inMessage object parameter

Changes to rule chain tools are synchronized in real time (create, update, delete automatically reflected in the tool list).

# Group Control

Configure tool groups via [mcp.groups] to implement permission control. Component and rule chain tools are only exposed through group endpoints.

[mcp.groups]
# Read-only group: only includes view operations from management tools and component documentation
readonly = rules,list_components,get_component_doc

# Full access
full = *

# No delete
no-delete = *,-delete_rule_chain
1
2
3
4
5
6
7
8
9

Group syntax:

  • *: Include all tools
  • -prefix*: Exclude tools matching the prefix (e.g., -delete_*)
  • Exact tool name: Include only the specified tool
  • rules: Include all management API tools
  • components: Include all component tools
  • chains: Include all rule chain tools

Each user has a default group by default that includes all tools.

# Connecting AI Clients

# Claude Code

Edit ~/.claude/settings.json:

{
  "mcpServers": {
    "rulego": {
      "type": "streamableHttp",
      "url": "http://localhost:9090/api/v1/mcp/ak-your-secret-key"
    }
  }
}
1
2
3
4
5
6
7
8

For detailed usage examples, see AI Features.

# Cursor

Add to the MCP configuration in Cursor settings:

{
  "mcpServers": {
    "rulego": {
      "url": "http://localhost:9090/api/v1/mcp/ak-your-secret-key"
    }
  }
}
1
2
3
4
5
6
7

# Trae

Add in Trae's MCP settings (Builder > MCP > Add):

{
  "mcpServers": {
    "rulego": {
      "type": "streamableHttp",
      "url": "http://localhost:9090/api/v1/mcp/ak-your-secret-key"
    }
  }
}
1
2
3
4
5
6
7
8

# Cherry Studio

  1. Open Cherry Studio Settings -> "MCP Servers"
  2. Click "Add Server"
  3. Fill in:
    • Name: rulego-server
    • Type: StreamableHTTP
    • URL: http://127.0.0.1:9090/api/v1/mcp/ak-your-secret-key

# Creating Custom MCP Endpoints via the Editor

In addition to the system-level MCP service, you can create independent MCP Server endpoints through rule chains. One rule chain is one MCP server; all tool configuration and processing logic is completed within the rule chain, supporting real-time updates.

Use cases: Need fine-grained control over tool sets, independently deploy MCP endpoints, or provide different tool sets for different AI clients.

# Steps

  1. Open RuleGo-Editor, create a new rule chain, and drag the [MCP Server] node onto the canvas mcp_server.png
  2. Configure the server port (can reuse the default HTTP server port ref://:9090) config.png
  3. Configure route settings; each route represents an MCP tool tool_list.png
  4. Click the [Add] button to configure the tool identifier, description, and input JsonSchema tool_config.png
  5. Drag the tool implementation logic node onto the canvas, and connect the tool identifier to the processing node tool_link.png
  6. Copy the MCP SSE address from [Settings] - [Integration] for client testing sse_url.png
  7. Configure this address in your AI client to start using it trae_mcp.png

# Example: Temperature Conversion Tool

{
  "ruleChain": {
    "id": "temp-converter",
    "name": "Temperature Conversion MCP Service",
    "root": true
  },
  "metadata": {
    "endpoints": [{
      "id": "ep1",
      "type": "endpoint/mcpServer",
      "name": "MCP Server",
      "configuration": {
        "allowCors": true,
        "name": "Temperature Conversion Service",
        "server": "ref://:9090",
        "version": "v1.0.0"
      },
      "routers": [{
        "id": "r1",
        "params": ["Pass in conversion factor to convert temperature", "{\"type\":\"object\",\"properties\":{\"scaleFactor\":{\"type\":\"number\",\"title\":\"Conversion Factor\",\"default\":1.8}},\"required\":[\"scaleFactor\"]}"],
        "from": {"path": "transformText"},
        "to": {"path": "temp-converter:node_js"}
      }]
    }],
    "nodes": [{
      "id": "node_js",
      "type": "jsTransform",
      "name": "Convert Temperature",
      "configuration": {
        "jsScript": "var newMsg=msg||{}; newMsg.value=msg.from||'test01'; return {'msg':newMsg,'metadata':metadata,'msgType':msgType};"
      }
    }],
    "connections": []
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

For more component configuration details, see the MCP Server component documentation.

# Core Value

  1. Enhance AI's Understanding of Business Logic: AI deeply understands business processes through rule chain tools
  2. Intelligent Automated Decision-Making: AI obtains real-time data and makes decisions based on rules
  3. Expand Agent Boundaries: Infinitely extend AI capabilities through components and rule chains
  4. Cross-System Integration: RuleGo-Server serves as a middleware layer to encapsulate data sources and tools
  5. New Paradigm for Application Interaction: Business systems are quickly encapsulated as MCP tools, bridging the last mile between AI and applications
Edit this page on GitHub (opens new window)
Last Updated: 2026/05/30, 11:18:53
REST API Reference
AI Features

← REST API Reference AI Features→

Theme by Vdoing | Copyright © 2023-2026 RuleGo Team | Apache 2.0 License

  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式