MCP Management API
REST endpoints for configuring, listing, invoking, and disconnecting Model Context Protocol servers programmatically.
Overview
The MCP Management API lets you manage Model Context Protocol server connections at runtime without restarting the extension. Use it to build dynamic integrations, CI pipelines, or admin tooling that needs to configure MCP servers programmatically.
All endpoints require authentication:
Authorization: Bearer YOUR_API_KEY
Configure Servers
Register one or more MCP servers. Existing servers with the same name are replaced.
POST /mcp/configure
Content-Type: application/json
Request
{
"servers": [
{
"name": "filesystem",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"],
"transport": "stdio",
"env": {}
},
{
"name": "github",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"transport": "stdio",
"env": {
"GITHUB_TOKEN": "ghp_..."
}
}
]
}
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| name | string | Yes | Unique server identifier |
| command | string | Yes | Executable to spawn |
| args | string[] | Yes | Arguments passed to the command |
| transport | string | Yes | Always "stdio" |
| env | object | No | Additional environment variables for the server process |
Response
{
"configured": 2,
"servers": ["filesystem", "github"]
}
Avoid hardcoding secrets in env values when calling this endpoint from client-side code. Prefer injecting secrets server-side or using the .misar/mcp.json file with ${env:VAR} interpolation.
List Active Servers
GET /mcp/servers
Response
{
"servers": [
{
"name": "filesystem",
"status": "running",
"tool_count": 5,
"started_at": "2026-03-21T10:00:00Z"
},
{
"name": "github",
"status": "running",
"tool_count": 12,
"started_at": "2026-03-21T10:00:01Z"
}
]
}
| Field | Description |
|-------|-------------|
| status | running | starting | error | stopped |
| tool_count | Number of tools registered by this server |
| started_at | ISO 8601 timestamp of when the server process started |
List Available Tools
GET /mcp/tools
Returns all tools across all active servers, merged into a single flat list.
Response
{
"tools": [
{
"server": "filesystem",
"name": "read_file",
"description": "Read a file from the filesystem.",
"input_schema": {
"type": "object",
"properties": {
"path": { "type": "string" }
},
"required": ["path"]
}
}
],
"total": 17
}
Invoke a Tool
Call an MCP tool directly without going through the agent loop.
POST /mcp/call
Content-Type: application/json
Request
{
"server": "filesystem",
"tool": "read_file",
"arguments": {
"path": "/tmp/output.json"
}
}
Response
{
"server": "filesystem",
"tool": "read_file",
"result": {
"content": "{ \"status\": \"ok\" }"
},
"duration_ms": 12
}
Error Response
{
"error": {
"type": "tool_error",
"message": "File not found: /tmp/output.json"
}
}
Disconnect a Server
Stop and remove a running MCP server. Any pending tool calls on this server will fail.
POST /mcp/remove
Content-Type: application/json
Request
{ "name": "filesystem" }
Response
{ "removed": "filesystem", "status": "stopped" }
Disconnecting a server does not modify .misar/mcp.json. If the extension restarts, the server will be reconnected from the config file. To permanently remove a server, delete its entry from .misar/mcp.json as well.