RuleGo-MCP-Server
# RuleGo-Server and MCP Protocol: Bridging AI and Applications
RuleGo-Server supports the MCP (Model Context Protocol). Once enabled, the system automatically registers all components, rule chains, and APIs as MCP tools. This allows AI assistants (such as Windsurf, Cursor, Codeium, etc.) to directly call these tools via the MCP protocol, enabling deep integration with application systems.
By leveraging the flexible nature of RuleGo, RuleGo-Server can be transformed into a platform for sharing and developing MCP tools. Additionally, business systems can be quickly integrated with AI assistants through bridging with RuleGo-Server.
# What is the MCP Protocol?
MCP is a standardized protocol designed to address the interaction issues between AI models and application systems. It provides AI with the ability to perceive the context of application system code and data, rather than just performing simple code completion or chat-based Q&A. MCP acts similarly to a USB-C interface, offering a standardized way for AI to connect to various data sources and tools.
# RuleGo-Server's MCP Functionality
After enabling MCP, RuleGo-Server automatically registers the following resources as MCP tools:
Component Tools
RuleGo offers a vast array of components covering AI, CI/CD, ETL, IoT, database operations, network operations, message queues, and more. AI assistants can call these components via the MCP protocol to interact with other systems.
For component parameters and usage, refer to Standard Components and Extended Components.Component Marketplace
RuleGo-Server provides an online Component Marketplace where users can dynamically download and install components to expand system functionality.Rule Chain Tools
Rule chains, a core feature of RuleGo, consist of multiple component nodes and links, defining data flow and processing rules. Rule chains support online editing and hot updates, and can be dynamically provided as tools via the MCP protocol to expand the boundaries of intelligent agents.Rule Chain Marketplace
Users can download and install rule chains from the Rule Chain Marketplace and automatically publish them as MCP tools.RuleGo-Server API Tools
Provide the capabilities of adding, deleting, viewing, and updating rule chains, enabling the AI assistant to not only utilize tools but also dynamically expand tools as needed.
# Core Value of MCP: Bridging the Last Mile of AI + Application Integration
The combination of the MCP protocol and RuleGo-Server offers enterprises the following key capabilities:
Enhanced AI Understanding of Business Logic
AI assistants, by calling rule chain tools via the MCP protocol, can gain a deep understanding of business logic. For example, in a complex order processing workflow, AI can track order status in real time through rule chain tools to optimize the process.Smart Automated Decision-Making
AI assistants can obtain real-time data via the MCP protocol and perform intelligent analysis and decision-making based on algorithms and models. For instance, in a real-time monitoring system, AI can automatically trigger an anomaly handling process based on the execution results of rule chains.Expanded Intelligent Agent Capabilities
RuleGo's components and rule chains offer endless possibilities for AI assistants. For example:- Access external APIs via HTTP components to obtain real-time data.
- Automatically commit code using Git components to implement CI/CD workflows.
- Implement complex business logic, such as automated report generation, using rule chains.
Facilitated Cross-System Integration
The MCP protocol provides a standardized way for integrating different systems. RuleGo-Server acts as an intermediary layer, encapsulating data sources and tools as MCP tools to achieve cross-system data sharing and business collaboration.New Paradigm for Application Interaction
Business systems can easily encapsulate services and data as MCP tools via RuleGo-Server, offering more intelligent business scenarios for AI assistants. For example, enterprises can expose internal system services as MCP tools for external AI assistants to call, bridging the gap between large AI models and application systems.
# Summary
The MCP functionality of RuleGo-Server offers a new way for enterprises to interact between AI and applications, truly bridging the last mile of AI + application integration. Through the MCP protocol, enterprises can quickly build intelligent business scenarios and achieve deep integration between AI and application systems, providing strong support for digital transformation.
# RuleGo-Server MCP Usage Guide
# Preparation
Download and Start RuleGo-Server
Download the latest version of RuleGo-Server from the download page orRuleGo Releases page (opens new window) and start the service according to the installation guide.Ensure MCP Functionality is Enabled
Before starting RuleGo-Server, ensure that the MCP functionality is enabled (enabled by default). You can configure this in theconfig.conf
file.
# Configuration
In the config.conf
file, configure the parameters for the MCP service:
[mcp]
# Whether to enable the MCP service
enable = true
# Whether to register components as MCP tools
load_components_as_tool = true
# Whether to register rule chains as MCP tools
load_chains_as_tool = true
# Whether to add rule chain API tools
load_apis_as_tool = true
# Exclude components list (supports wildcards)
exclude_components = comment,iterator,delay,groupAction,ref,fork,join,*Filter
# Exclude rule chains list
exclude_chains =
# User list configuration
# Format: username = password[,apiKey]
# If apiKey is configured, the caller can directly use the apiKey to access other interfaces without logging in
[users]
admin = admin,2af255ea5618467d914c67a8beeca31d # Admin account, username: admin, password: admin, apiKey: 2af255ea5618467d914c67a8beeca31d
user01 = user01,2af255ea5618467d914c67a8beeca51c # Regular user 01, username: user01, password: user01, apiKey: 2af255ea5618467d914c67a8beeca51c
user02 = user02 # Password-only authentication user, does not support apiKey
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
- Multi-user support: Configure multiple users, each with access to different interfaces.
- apiKey configuration: Configure apiKey for users to directly access interfaces without logging in.
# Configuring the MCP Service Address
The RuleGo-Server MCP service address format is:
http://{ip}:{port}/api/v1/mcp/{apiKey}/sse
For example, after starting RuleGo-Server, the service will print the following address:
2025/03/30 20:33:17 RuleGo-Server now running at http://127.0.0.1:9090
2025/03/30 20:33:17 RuleGo-Server mcp server running at http://127.0.0.1:9090/api/v1/mcp/2af255ea5618467d914c67a8beeca31d/sse
2025/03/30 20:33:17 started rest server on :9090
2
3
Add the MCP service address to the AI assistant's configuration. The following example uses Cherry Studio:
- Open Cherry Studio settings.
- Locate the "MCP Server" option.
- Click "Add Server".
- Fill in the parameters for the MCP Server:
- Name: Custom name, e.g.,
rulego-server
- Type: Select
SSE
- URL: Fill in
http://127.0.0.1:9090/api/v1/mcp/2af255ea5618467d914c67a8beeca31d/sse
- Name: Custom name, e.g.,
- Click "Save".
For detailed instructions, refer to the MCP Usage Guide (opens new window).
# Component Tool Usage Examples
- Listing All Tools
After enabling the MCP service in the AI assistant, you can list all available MCP tools. - Accessing Websites via HTTP Client
Use the HTTP client component to access external APIs and obtain real-time data. - Obtaining Commit Logs via GitLog Component
Use the GitLog component to obtain commit logs from code repositories and automatically generate version release documents. - Querying Data via Database Client
Use the database client component to query the database and obtain the required data.
# Rule Chain Tool Usage Example
To implement complex business logic, you can use rule chains to orchestrate components. The following example demonstrates how to provide an MCP tool using a rule chain for "Querying User Details by ID."
# Creating a Rule Chain
Method One: Upload DSL File
Upload the component DSL file to thedata/workflows/{username}/rules
directory (requires service restart).Method Two: Install Components via API
Use the API provided by RuleGo-Server to install components (no service restart required):POST /api/v1/rules/:chainId
1The request body contains the rule chain DSL.
Method Three: Edit Rule Chains via RuleGo-Editor
- Access RuleGo-Editor:
http://127.0.0.1:9090/editor
- Click "New" to create a rule chain.
- Fill in the rule chain ID, name, and description (corresponding to tool ID, tool name, and tool description).
- Drag the required nodes onto the canvas.
- Configure node parameters.
- If there are multiple nodes, configure the connections between nodes.
- Click the "Save" button to save the rule chain.
- Access RuleGo-Editor:
# Example Rule Chain DSL
{
"ruleChain": {
"id": "queryUser",
"name": "Query User by ID",
"debugMode": true,
"root": true,
"disabled": false,
"additionalInfo": {
"createTime": "2025/03/30 00:15:10",
"description": "Query User by ID",
"layoutX": "280",
"layoutY": "280",
"updateTime": "2025/03/30 00:15:10",
"username": "admin"
}
},
"metadata": {
"endpoints": [],
"nodes": [
{
"id": "node_1",
"additionalInfo": {
"layoutX": 660,
"layoutY": 270
},
"type": "dbClient",
"name": "Operate User Table",
"debugMode": true,
"configuration": {
"driverName": "mysql",
"dsn": "root:root@tcp(127.0.0.1:3306)/test",
"getOne": true,
"poolSize": 0,
"sql": "select * from users where id=${msg.id}"
}
}
],
"connections": []
}
}
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
36
37
38
39
40
# Notes
- MCP tool rule chains should not include other types of "input" nodes.
- After saving, the MCP tool will take effect in real time and can be called in the AI assistant.
# Additional Notes
- AI Assistant Support: Ensure that the AI assistant uses a large model that supports MCP calls.
- Configuration File Filtering: Use
load_components_as_tool
,load_chains_as_tool
,load_apis_as_tool
,exclude_components
, andexclude_chains
to filter and disable certain components or rule chains to prevent misuse or interference of MCP tools. - Input Parameter Constraints: Rule chains can configure
ruleChain.additionalInfo.inputSchema
to constrain the input parameters of AI assistants, ensuring the correctness of input data.
By following the above steps, you can quickly get started with the MCP functionality of RuleGo-Server and achieve deep integration between AI and application systems.