This plugin integrates the Model Context Protocol (MCP) with MindRoot, allowing the AI to connect to and use MCP servers for enhanced capabilities.
- MCP Client: Connect to MCP servers via stdio, SSE, or WebSocket
- Server Management: Add, configure, and manage MCP servers
- uvx/npx Support: Easy installation and running of MCP servers via uvx (Python) and npx (Node.js)
- Tool Integration: Use MCP tools as MindRoot commands
- Resource Access: Read resources from MCP servers
- Admin Interface: Web UI for managing MCP servers
- Server Discovery: Discover available MCP servers from online directories
- Install the MCP Python SDK and optional tools:
pip install mcpFor uvx support: pip install uvx
For npx support: Install Node.js and npm
- Install the plugin:
cd /xfiles/update_plugins/mr_mcp
pip install -e .- Enable the plugin commands in the MindRoot admin interface
Access the MCP management interface at /admin and look for the "MCP Servers" section.
mcp_list_servers- List all configured MCP serversmcp_connect- Connect to an MCP servermcp_disconnect- Disconnect from an MCP servermcp_install_uvx_server- Install and configure a uvx-based MCP servermcp_install_npx_server- Install and configure an npx-based MCP servermcp_list_tools- List available tools from MCP serversmcp_call_tool- Call a tool on an MCP servermcp_list_resources- List available resourcesmcp_read_resource- Read a resource from an MCP servermcp_discover_servers- Discover available MCP serversmcp_install_server- Configure a new MCP server
// Install a uvx-based server (Python)
{ "mcp_install_uvx_server": {
"name": "calculator",
"package": "mcp-server-calculator",
"description": "Calculator server"
}}
// Install an npx-based server (Node.js)
{ "mcp_install_npx_server": {
"name": "github",
"package": "@modelcontextprotocol/server-github",
"description": "GitHub integration server"
}}
// Configure a filesystem server
{ "mcp_install_server": {
"name": "filesystem",
"description": "File system operations",
"command": "python",
"args": ["-m", "mcp.server.filesystem"]
}}
// Connect to the server
{ "mcp_connect": { "server_name": "filesystem" } }
// List available tools
{ "mcp_list_tools": {} }
// Call a tool
{ "mcp_call_tool": {
"server_name": "filesystem",
"tool_name": "read_file",
"arguments": {"path": "/tmp/test.txt"}
}}- Calculator (uvx):
mcp-server-calculator- Mathematical calculations - Filesystem (Python): File operations
- GitHub (npx):
@modelcontextprotocol/server-github- GitHub API integration - Brave Search (npx):
@modelcontextprotocol/server-brave-search- Web search - SQLite (npx):
@modelcontextprotocol/server-sqlite- Database operations - Slack (npx):
@modelcontextprotocol/server-slack- Slack integration - Google Drive (npx):
@modelcontextprotocol/server-gdrive- Google Drive access - Puppeteer (npx):
@modelcontextprotocol/server-puppeteer- Web automation
See the discovery feature to find more available servers.
MCPManager: Core class managing server connectionsMCPServer: Pydantic model for server configuration- Commands: MindRoot commands for MCP operations
- Admin UI: Web interface for server management
- Router: FastAPI routes for the admin interface
Server configurations are stored in /tmp/mcp_servers.json and include:
- Server name and description
- Command and arguments
- Transport type (stdio, SSE, WebSocket)
- Connection status
- Available capabilities (tools, resources, prompts)
The plugin supports multiple installation methods:
- uvx: For Python-based MCP servers (similar to pipx)
- npx: For Node.js-based MCP servers
- pip: For Python packages
- npm: For Node.js packages
- manual: For custom installations
To extend the plugin:
- Add new commands in
mod.py - Update the admin interface in
templates/mcp_admin.jinja2 - Add new server discovery sources
- Implement additional transport types
- Ensure MCP SDK is installed:
pip install mcp - For uvx servers: Install uvx with
pip install uvx - For npx servers: Ensure Node.js and npm are installed
- Check server command paths and arguments
- Verify server processes are running
- Check logs for connection errors
- Ensure proper permissions for server executables