Mcp Servers

MCP servers

KushRouter supports Model Context Protocol (MCP) servers to extend tool usage beyond standard function calls.

Request payload

Include an mcp_servers array when calling the unified endpoint or OpenAI-compatible endpoints. The server normalizes camelCase and snake_case automatically.

{
  "model": "gpt-4o-mini",
  "messages": [{ "role": "user", "content": "Summarize recent support tickets" }],
  "mcp_servers": [
    {
      "name": "support-db",
      "type": "database",
      "config": {
        "connectionString": "postgres://..."
      }
    },
    {
      "name": "filesystem",
      "type": "filesystem",
      "config": {
        "root": "s3://support-docs"
      }
    }
  ]
}

Supported server types

  • filesystem – surface files or directories as tool call targets
  • database – query relational databases with parameterized SQL
  • http – call external HTTP APIs
  • Custom server types are allowed as long as MCP contract is respected

Streaming behavior

  • Tool invocations appear as incremental deltas in choices[0].delta.tool_calls[].function.arguments (OpenAI) or Anthropic tool events.
  • When providers only emit final arguments in stop events, KushRouter sends a synthetic final delta so downstream clients receive complete JSON.

Authentication

  • Use scoped API keys or OAuth credentials inside the MCP server configuration.
  • Secrets should be stored securely; do not embed plain-text passwords in requests.

Debugging tips

  • Enable verbose logging in components/playground/api-playground.tsx when testing MCP servers via the dashboard playground.
  • Check the /api/v1/messages response stream for tool.approval events if pause-on-tool is enabled.

Further reading