๐ค MCP Integration User Guide
March 23, 2026 ยท View on GitHub
Connect AI assistants directly to your Cยณ CELERITY panel for automated management.
๐ What is MCP?
Model Context Protocol (MCP) is a protocol that allows AI assistants (Claude, Cursor, etc.) to directly interact with the Cยณ CELERITY panel.
โจ Capabilities
Through MCP, AI can:
| Capability | Description |
|---|---|
| ๐ฅ User Management | Create, edit, disable VPN users |
| ๐ฅ Server Configuration | Configure servers and nodes |
| ๐ป SSH Commands | Execute commands on servers remotely |
| ๐ Monitoring | Retrieve statistics and logs |
| ๐ง Diagnostics | Diagnose and troubleshoot issues |
๐ Requirements
| Requirement | Description |
|---|---|
| ๐ API Key | With mcp:enabled scope |
| ๐ฅ AI Client | Claude Desktop, Cursor IDE, or any HTTP client with SSE support |
๐ Creating an API Key
Step-by-Step
-
๐ฑ Open panel โ Settings โ API Keys
-
โ Click Create MCP API Key
-
โ๏ธ Enter a key name (e.g.,
"Claude Assistant") -
๐ Select permissions:
Type Scopes Use Case ๐ข Basic mcp:enabled+ read scopesRead-only access (default) ๐ก Extended users:write,nodes:write,sync:writeWrite operations -
๐ Copy the key โ shown only once!
โ ๏ธ Important: Store your API key securely. You won't be able to see it again.
๐ Connecting AI Clients
๐ฅ Claude Desktop
Add to your Claude Desktop configuration file:
| Platform | Config Path |
|---|---|
| ๐ macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| ๐ช Windows | %APPDATA%\Claude\claude_desktop_config.json |
{
"mcpServers": {
"celerity": {
"url": "https://your-panel.com/api/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
๐ Cursor IDE
Create a .cursor/mcp.json file in your project root:
{
"mcpServers": {
"celerity": {
"url": "https://your-panel.com/api/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
๐ง Custom Client
Any HTTP client with SSE support can connect:
| Parameter | Value |
|---|---|
| ๐ Endpoint | https://your-panel.com/api/mcp |
| ๐ Auth | Authorization: Bearer YOUR_API_KEY |
| ๐ฆ Content-Type | application/json |
| ๐ก Accept | text/event-stream (for streaming) |
๐ Example Request
curl -X POST https://your-panel.com/api/mcp \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{}}}'
๐ Available Tools
๐ query โ Read Data
Universal tool for retrieving data from the panel.
| Resource | Description | Required Scope |
|---|---|---|
users | ๐ฅ List of users | users:read |
nodes | ๐ฅ List of servers | nodes:read |
groups | ๐ Server groups | stats:read |
stats | ๐ Traffic statistics | stats:read |
logs | ๐ System logs | stats:read |
Parameters:
| Parameter | Required | Description |
|---|---|---|
resource | โ Yes | Resource type |
id | โ No | Specific item ID |
filter | โ No | Filters (resource-dependent) |
limit, page | โ No | Pagination |
sortBy, sortOrder | โ No | Sorting |
๐ Example: Get all active users
{
"name": "query",
"arguments": {
"resource": "users",
"filter": { "enabled": true },
"limit": 50
}
}
๐ค manage_user โ User Management
users:writescope required
Available Actions: create | update | delete | enable | disable | reset_traffic
๐ Example: Create a user
{
"name": "manage_user",
"arguments": {
"action": "create",
"userId": "user123",
"data": {
"username": "John Doe",
"trafficLimit": 107374182400,
"maxDevices": 3,
"groups": ["groupId1"]
}
}
}
๐ฅ manage_node โ Server Management
nodes:writescope required
Available Actions: create | update | delete | sync | setup | reset_status | update_config
๐ Example: Setup node via SSH
{
"name": "manage_node",
"arguments": {
"action": "setup",
"id": "nodeId123",
"setupOptions": {
"installHysteria": true,
"setupPortHopping": true,
"restartService": true
}
}
}
๐ manage_group โ Group Management
nodes:writescope required
Available Actions: create | update | delete
๐ manage_cascade โ Cascade Tunnels
nodes:writescope required
Available Actions: create | update | delete | deploy | undeploy | reconnect
๐ป execute_ssh โ Execute Commands
nodes:writescope required
Executes a shell command on the server and returns the output.
๐ Example: Check service status
{
"name": "execute_ssh",
"arguments": {
"nodeId": "nodeId123",
"command": "systemctl status hysteria-server"
}
}
๐ฅ ssh_session โ Interactive SSH Session
nodes:writescope required
Available Actions: start | input | close
โ๏ธ system_action โ System Operations
sync:writescope required
Available Actions: sync_all | clear_cache | backup | kick_user
๐บ get_topology โ Network Topology
nodes:readscope required
Returns all active nodes and connections between them.
โค๏ธ health_check โ Health Check
โ No scope required
Returns uptime, sync status, cache stats, memory usage.
๐ Built-in Prompts
Prompts are pre-configured scenarios that appear as slash commands in Claude Desktop (e.g.,
/panel_overview).
| Prompt | Description |
|---|---|
๐ panel_overview | System overview: nodes, users, health |
๐ audit_nodes | Find problematic nodes and suggest fixes |
๐ค user_report | Detailed report for a specific user |
๐ฅ setup_new_node | Step-by-step node addition guide |
๐ง troubleshoot_node | Node diagnostics via SSH |
โฐ manage_expired_users | Find and handle expired users |
๐ก Usage Examples
๐ "Show me the status of all servers"
AI will execute:
| Step | Tool | Purpose |
|---|---|---|
| 1 | health_check | Overall status |
| 2 | query with resource=nodes | List of nodes |
| 3 | โ | Generate report with problematic nodes highlighted |
๐ค "Create user testuser with 50 GB limit"
AI will execute:
manage_user โ action=create, userId=testuser, trafficLimit=53687091200
๐ง "Why is node DE-01 not working?"
AI will execute:
| Step | Tool | Purpose |
|---|---|---|
| 1 | query with resource=nodes, id=<DE-01-id> | Get lastError |
| 2 | execute_ssh with systemctl status hysteria-server | Check service |
| 3 | โ | Analyze and suggest solution |
๐ฅ "Set up new server 192.168.1.100"
AI will use the setup_new_node prompt:
| Step | Action |
|---|---|
| 1 | ๐ Collect data (IP, domain, SSH credentials) |
| 2 | ๐ Create node via manage_node |
| 3 | โ๏ธ Run auto-setup via manage_node action=setup |
| 4 | โ Verify status |
๐ Access Permissions (Scopes)
| Scope | Description | Level |
|---|---|---|
mcp:enabled | ๐ข Basic MCP access permission | Required |
users:read | ๐ Read users | Read |
users:write | โ๏ธ Create, modify, delete users | Write |
nodes:read | ๐ Read servers and statistics | Read |
nodes:write | โ๏ธ Manage servers, SSH commands | Write |
stats:read | ๐ Read statistics and logs | Read |
sync:write | โ๏ธ Sync, backups, system operations | Write |
๐ก Security
| Best Practice | Description |
|---|---|
| ๐ Secure Storage | Store API keys in a secure location |
| ๐ฏ Least Privilege | Use minimum required permissions |
| ๐ Key Rotation | Rotate keys periodically |
| ๐ Audit Trail | All MCP operations are logged in panel system logs |
๐ Sources
| File | Description |
|---|---|
src/services/mcpService.js | Tool registry |
src/routes/mcp.js | MCP endpoints |
src/mcp/prompts.js | Built-in prompts |
src/locales/en.json | MCP interface localization |