Skip to main content

GET /api/servers

List all MCP servers and their status.

GET /api/servers/:name

Read a single server’s configuration.

POST /api/servers

Add a new MCP server.

POST /api/servers/batch

Add multiple servers in one request.

PUT /api/servers/:name

Update an existing server.

DELETE /api/servers/:name

Remove a server.

POST /api/servers/:name/toggle

Enable or disable a server.

POST /api/servers/:name/reload

Reconnect to an upstream server.

POST /api/servers/:serverName/tools/:toolName/toggle

Enable or disable a tool.

PUT /api/servers/:serverName/tools/:toolName/description

Override a tool description.

DELETE /api/servers/:serverName/tools/:toolName/description

Reset a tool description to upstream.

Prompts on servers

Toggle / describe / reset prompts.

Resources on servers

Toggle / describe / reset resources.

GET /api/settings

Read everything: servers, groups, system config.

Get All Servers

Retrieves a list of all configured MCP servers, including their status and available tools.
  • Endpoint: /api/servers
  • Method: GET
  • Response:
    {
      "success": true,
      "data": [
        {
          "name": "example-server",
          "status": "connected",
          "tools": [
            {
              "name": "tool1",
              "description": "Description of tool 1"
            }
          ],
          "config": {
            "type": "stdio",
            "command": "node",
            "args": ["server.js"]
          }
        }
      ]
    }
    

Get a Server

Returns the configuration of a single server, including upstream tools/prompts/resources when connected.
  • Endpoint: GET /api/servers/:name
  • Authentication: Required.
  • Returns 404 if the server is not configured.

Create a New Server

Adds a new MCP server to the configuration.
  • Endpoint: /api/servers
  • Method: POST
  • Body:
    {
      "name": "my-new-server",
      "config": {
        "type": "stdio",
        "command": "python",
        "args": ["-u", "my_script.py"],
        "owner": "admin"
      }
    }
    
    • name (string, required): The unique name for the server.
    • config (object, required): The server configuration object.
      • type (string): stdio, sse, streamable-http, or openapi.
      • command (string): Command to execute for stdio type.
      • args (array of strings): Arguments for the command.
      • url (string): URL for sse, streamable-http, or openapi types.
      • openapi (object): OpenAPI configuration.
        • url (string): URL to the OpenAPI schema.
        • schema (object): The OpenAPI schema object itself.
      • headers (object): Headers to send with requests for sse, streamable-http, and openapi types.
      • keepAliveInterval (number): Keep-alive interval in milliseconds for sse type. Defaults to 60000.
      • enableKeepAlive (boolean): Toggle keep-alive pings on/off independent of the interval.
      • enabled (boolean): Defaults to true. Disabled servers stay in the configuration but are not connected.
      • owner (string): The owner of the server. Defaults to the current user or 'admin'.
      • passthroughHeaders (string[]): Inbound HTTP header names that should be forwarded to the upstream server.
      • oauth, proxy, options, description: Optional advanced settings — see MCP Settings.

Batch Create Servers

Create several servers in a single request. The body contains a servers array of { name, config } objects — the same shape POST /api/servers accepts, just batched:
  • Endpoint: POST /api/servers/batch
  • Authentication: Required.
  • Body:
    {
      "servers": [
        { "name": "fetch", "config": { "type": "stdio", "command": "uvx", "args": ["mcp-server-fetch"] } },
        { "name": "amap", "config": { "type": "sse", "url": "https://mcp.amap.com/sse?key=..." } }
      ]
    }
    
Each element is validated independently, and the response contains a per-server { name, success, message? } record so partial batches do not abort the whole request.

Update a Server

Updates the configuration of an existing MCP server.
  • Endpoint: /api/servers/:name
  • Method: PUT
  • Parameters:
    • :name (string, required): The name of the server to update.
  • Body:
    {
      "config": {
        "type": "stdio",
        "command": "node",
        "args": ["new_server.js"]
      }
    }
    
    • config (object, required): The updated server configuration object. See “Create a New Server” for details.

Delete a Server

Removes an MCP server from the configuration.
  • Endpoint: /api/servers/:name
  • Method: DELETE
  • Parameters:
    • :name (string, required): The name of the server to delete.

Toggle a Server

Enables or disables an MCP server.
  • Endpoint: /api/servers/:name/toggle
  • Method: POST
  • Parameters:
    • :name (string, required): The name of the server to toggle.
  • Body:
    {
      "enabled": true
    }
    
    • enabled (boolean, required): true to enable the server, false to disable it.

Reload a Server

Forces MCPHub to disconnect and re-establish the upstream connection (or re-spawn the stdio child) for a single server. Use this when an upstream server has been updated out-of-band or appears stuck.
  • Endpoint: POST /api/servers/:name/reload
  • Authentication: Required.

Toggle a Tool

Enables or disables a specific tool on a server.
  • Endpoint: /api/servers/:serverName/tools/:toolName/toggle
  • Method: POST
  • Parameters:
    • :serverName (string, required): The name of the server.
    • :toolName (string, required): The name of the tool.
  • Body:
    {
      "enabled": true
    }
    
    • enabled (boolean, required): true to enable the tool, false to disable it.

Update Tool Description

Updates the description of a specific tool.
  • Endpoint: /api/servers/:serverName/tools/:toolName/description
  • Method: PUT
  • Parameters:
    • :serverName (string, required): The name of the server.
    • :toolName (string, required): The name of the tool.
  • Body:
    {
      "description": "New tool description"
    }
    
    • description (string, required): The new description for the tool.

Reset Tool Description

Drops the override stored in MCPHub and falls back to the upstream tool description.
  • Endpoint: DELETE /api/servers/:serverName/tools/:toolName/description
  • Authentication: Required.

Prompts

MCPHub exposes the same toggle / describe / reset triple for upstream prompts. The body shape mirrors the tool endpoints above.
Method & PathPurpose
POST /api/servers/:serverName/prompts/:promptName/toggleEnable / disable a prompt. Body: { "enabled": true }.
PUT /api/servers/:serverName/prompts/:promptName/descriptionOverride the prompt description. Body: { "description": "..." }.
DELETE /api/servers/:serverName/prompts/:promptName/descriptionReset the description to the upstream value.

Resources

Method & PathPurpose
POST /api/servers/:serverName/resources/:resourceUri/toggleEnable / disable a resource. Body: { "enabled": true }. The :resourceUri must be URL-encoded.
PUT /api/servers/:serverName/resources/:resourceUri/descriptionOverride the resource description.
DELETE /api/servers/:serverName/resources/:resourceUri/descriptionReset the description.

System Configuration

System-wide configuration (routing, install, smart routing, mcpRouter, name separator, session rebuild, OAuth server) is managed through PUT /api/system-config. See System Config API for the full request schema and accepted top-level keys (routing, install, smartRouting, mcpRouter, nameSeparator, enableSessionRebuild, oauthServer).
The legacy openaiApiKey / modelName / temperature / maxTokens request body is no longer accepted. Smart-routing model selection now lives under the nested smartRouting object documented in System Config API.

Get Settings

Retrieves all server settings and configurations.
  • Endpoint: /api/settings
  • Method: GET
  • Response:
    {
      "success": true,
      "data": {
        "servers": [...],
        "groups": [...],
        "systemConfig": {...}
      }
    }
    
Note: For built-in prompt and resource management (not tied to an upstream server), see the Prompts API documentation.

Other server-adjacent endpoints

MCPHub exposes several other route families beyond pure server CRUD. Each lives on its own resource and is documented separately or, where no dedicated page exists yet, follows the schema described inline:
FamilyMethod & Path(s)Notes
Auth & usersPOST /api/auth/login, POST /api/auth/register, GET /api/auth/user, POST /api/auth/change-password, /api/users/*, /api/users-statsSee Auth and Users.
Bearer keysGET /api/auth/keys, POST /api/auth/keys, PUT /api/auth/keys/:id, DELETE /api/auth/keys/:idSystem-level and user-level static MCP tokens. Only all-access system keys can authenticate dashboard APIs. See Authentication.
Groups/api/groups, /api/groups/batch, /api/groups/:id/servers*, /api/groups/:id/server-configs*See Groups.
TemplatesPOST /api/templates/export, GET /api/templates/export/groups/:id, POST /api/templates/importExport / import mcp_settings.json snapshots and group templates. Rate-limited.
ActivitiesGET /api/activities, /api/activities/stats, /api/activities/filters, /api/activities/:id, DELETE /api/activities/cleanup, GET /api/activities/availableDatabase mode only — see Monitoring.
LogsGET /api/logs, DELETE /api/logs, GET /api/logs/streamIn-process log buffer + SSE stream.
Built-in prompts / resources/api/prompts, /api/resources, POST /api/resources/readFirst-party prompts and resources that are not attached to an upstream server.
MCPB uploadPOST /api/mcpb/uploadUpload an MCPB bundle to register a new server.
Market / Cloud / Registry/api/market/*, /api/cloud/*, /api/registry/*Read-only catalogs that back the dashboard’s discovery pages.
OAuth clients (MCPHub server)/api/oauth/clients, /api/oauth/clients/:clientId/regenerate-secretManage clients of MCPHub’s own authorization server. The flow itself lives at /oauth/* and is documented under OAuth.
Better AuthGET /api/better-auth/user, plus the Better Auth handler mounted at ${BASE_PATH}${betterAuthConfig.basePath} (default /api/auth/better)Optional GitHub / Google login.
OpenAPIGET ${BASE_PATH}/api/openapi.json, GET ${BASE_PATH}/api/:name/openapi.json, GET ${BASE_PATH}/api/openapi/servers, GET ${BASE_PATH}/api/openapi/stats, plus the OpenAPI tool execution routesSee OpenAPI.
MCP settings exportGET /api/mcp-settings/exportDownload the live settings as JSON.