๐Ÿค– 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:

CapabilityDescription
๐Ÿ‘ฅ User ManagementCreate, edit, disable VPN users
๐Ÿ–ฅ Server ConfigurationConfigure servers and nodes
๐Ÿ’ป SSH CommandsExecute commands on servers remotely
๐Ÿ“Š MonitoringRetrieve statistics and logs
๐Ÿ”ง DiagnosticsDiagnose and troubleshoot issues

๐Ÿ“‹ Requirements

RequirementDescription
๐Ÿ”‘ API KeyWith mcp:enabled scope
๐Ÿ–ฅ AI ClientClaude Desktop, Cursor IDE, or any HTTP client with SSE support

๐Ÿ” Creating an API Key

Step-by-Step

  1. ๐Ÿ–ฑ Open panel โ†’ Settings โ†’ API Keys

  2. โž• Click Create MCP API Key

  3. โœ๏ธ Enter a key name (e.g., "Claude Assistant")

  4. ๐ŸŽ› Select permissions:

    TypeScopesUse Case
    ๐ŸŸข Basicmcp:enabled + read scopesRead-only access (default)
    ๐ŸŸก Extendedusers:write, nodes:write, sync:writeWrite operations
  5. ๐Ÿ“‹ 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:

PlatformConfig 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:

ParameterValue
๐Ÿ“ Endpointhttps://your-panel.com/api/mcp
๐Ÿ” AuthAuthorization: Bearer YOUR_API_KEY
๐Ÿ“ฆ Content-Typeapplication/json
๐Ÿ“ก Accepttext/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.

ResourceDescriptionRequired Scope
users๐Ÿ‘ฅ List of usersusers:read
nodes๐Ÿ–ฅ List of serversnodes:read
groups๐Ÿ“ Server groupsstats:read
stats๐Ÿ“Š Traffic statisticsstats:read
logs๐Ÿ“œ System logsstats:read

Parameters:

ParameterRequiredDescription
resourceโœ… YesResource type
idโŒ NoSpecific item ID
filterโŒ NoFilters (resource-dependent)
limit, pageโŒ NoPagination
sortBy, sortOrderโŒ NoSorting
๐Ÿ“– Example: Get all active users
{
  "name": "query",
  "arguments": {
    "resource": "users",
    "filter": { "enabled": true },
    "limit": 50
  }
}

๐Ÿ‘ค manage_user โ€” User Management

users:write scope 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:write scope 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:write scope required

Available Actions: create | update | delete


๐Ÿ”— manage_cascade โ€” Cascade Tunnels

nodes:write scope required

Available Actions: create | update | delete | deploy | undeploy | reconnect


๐Ÿ’ป execute_ssh โ€” Execute Commands

nodes:write scope 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:write scope required

Available Actions: start | input | close


โš™๏ธ system_action โ€” System Operations

sync:write scope required

Available Actions: sync_all | clear_cache | backup | kick_user


๐Ÿ—บ get_topology โ€” Network Topology

nodes:read scope 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).

PromptDescription
๐Ÿ“Š panel_overviewSystem overview: nodes, users, health
๐Ÿ” audit_nodesFind problematic nodes and suggest fixes
๐Ÿ‘ค user_reportDetailed report for a specific user
๐Ÿ–ฅ setup_new_nodeStep-by-step node addition guide
๐Ÿ”ง troubleshoot_nodeNode diagnostics via SSH
โฐ manage_expired_usersFind and handle expired users

๐Ÿ’ก Usage Examples

๐Ÿ“Š "Show me the status of all servers"

AI will execute:

StepToolPurpose
1health_checkOverall status
2query with resource=nodesList 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:

StepToolPurpose
1query with resource=nodes, id=<DE-01-id>Get lastError
2execute_ssh with systemctl status hysteria-serverCheck service
3โ€”Analyze and suggest solution

๐Ÿ–ฅ "Set up new server 192.168.1.100"

AI will use the setup_new_node prompt:

StepAction
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)

ScopeDescriptionLevel
mcp:enabled๐ŸŸข Basic MCP access permissionRequired
users:read๐Ÿ‘ Read usersRead
users:writeโœ๏ธ Create, modify, delete usersWrite
nodes:read๐Ÿ‘ Read servers and statisticsRead
nodes:writeโœ๏ธ Manage servers, SSH commandsWrite
stats:read๐Ÿ‘ Read statistics and logsRead
sync:writeโœ๏ธ Sync, backups, system operationsWrite

๐Ÿ›ก Security

Best PracticeDescription
๐Ÿ”’ Secure StorageStore API keys in a secure location
๐ŸŽฏ Least PrivilegeUse minimum required permissions
๐Ÿ”„ Key RotationRotate keys periodically
๐Ÿ“ Audit TrailAll MCP operations are logged in panel system logs

๐Ÿ“š Sources

FileDescription
src/services/mcpService.jsTool registry
src/routes/mcp.jsMCP endpoints
src/mcp/prompts.jsBuilt-in prompts
src/locales/en.jsonMCP interface localization