MCP Control Plane

Register, govern, proxy, and audit MCP servers and tools with secretless access and identity-attributed audit trails.

Overview

BrainstormRouter operates as both an MCP server and an MCP gateway:

  • MCP Server: Exposes 64 tools via Streamable HTTP at /v1/mcp/connect — routing, memory, agents, security, budget, and kill switch controls
  • MCP Gateway: Registers, discovers, governs, proxies, and audits external MCP servers

This dual-role architecture means AI agents can interact with BrainstormRouter's own capabilities through MCP, and BrainstormRouter can govern how those agents access third-party tools.

Secretless Access

When you register an external MCP server, upstream credentials (bearer tokens, API keys) are stored on the server registration — never exposed to calling agents. Agents authenticate to BrainstormRouter with their own API key or agent JWT, and BrainstormRouter injects the upstream credentials when proxying tool calls.

Agent (API key) → BrainstormRouter → (stored bearer token) → External MCP Server

This means:

  • Agents never see upstream secrets — credentials are isolated at the gateway level
  • allowed_key_ids scoping restricts which API keys can access each registered server
  • Agent identity propagation attributes every tool call to the calling agent in the audit trail
  • Credential rotation happens at the server registration, not at every agent

What's shipped vs. planned

Shipped: Credential isolation via server-stored auth profiles (bearer, API-key, OAuth2 client credentials), allowed_key_ids RBAC scoping, per-call identity attribution, periodic health polling.

Planned: OAuth-based scoped access delegation (per-tool scoping, not server-level auth), dynamic credential rotation, per-tool secret scoping.

Control-Plane Flows

1. Registry

Register an external MCP server with transport, URL, and auth profile:

const { server } = await client.mcp.registerServer({
  name: "Database Tools",
  transport: "streamable-http",
  url: "https://tools.example.com/mcp",
  auth: { type: "bearer", token: "secret" },
  allowed_key_ids: ["key-uuid-1"],
});
server = client.mcp.register_server({
    "name": "Database Tools",
    "transport": "streamable-http",
    "url": "https://tools.example.com/mcp",
    "auth": {"type": "bearer", "token": "secret"},
})

2. Discovery

Discover tools from a registered server by connecting via the MCP protocol and calling tools/list:

const { tools } = await client.mcp.discoverServer("server-id");
// tools: [{ name: "search", description: "...", inputSchema: {...} }]

3. Governance

Set policies on discovered tools — allow/deny and approval requirements:

await client.mcp.updatePolicy({
  tool_name: "delete_record",
  allowed: true,
  max_cost_usd: 0.5,
  requires_approval: true,
});

When a governed tool requires approval, execution returns 202 Accepted with an approval queue ID. Human operators approve or deny via the dashboard or SDK:

await client.mcp.approve("approval-id");
// or
await client.mcp.deny("approval-id");

4. Execution

Execute a tool call through the governance pipeline:

const result = await client.mcp.callTool("server-id", "search", {
  query: "recent metrics",
});

BrainstormRouter:

  1. Validates the calling key has access (allowed_key_ids)
  2. Checks governance policies (allowed, approval required)
  3. Proxies the call to the upstream server with stored credentials
  4. Logs the call with identity, result, and latency

5. Audit

Every tool call is logged with server, tool, result, latency, and calling identity:

const { entries } = await client.mcp.auditLog({ limit: 20 });
// entries: [{ timestamp, server_name, tool, result, latency_ms, api_key_id }]

Auth Profiles

External MCP servers support three auth types:

TypeHeader SentWhen to Use
bearerAuthorization: Bearer Standard bearer token auth
api-key: (defaults to X-API-Key)Custom header-based auth
oauth2Authorization: Bearer RFC 6749 client credentials grant with token caching

OAuth2 servers require clientId, tokenUrl, and optionally clientSecret and scopes. BrainstormRouter automatically fetches and caches access tokens, refreshing on expiry or 401 responses.

Governance Engine

The governance engine enforces policies before tool execution:

FeatureDescription
Tool allow/denyBlock specific tools from being called
Approval workflowsQueue calls for human approval when requires_approval is set (202 Accepted)
Cost annotationTag policies with max_cost_usd for tracking (enforcement planned)
Rate limitingSession-level rate limits (default 60 calls/min)
Approval timeoutQueued approvals auto-expire (default 5 minutes)

BrainstormRouter as MCP Server

BrainstormRouter itself is an MCP server exposing 64 tools via Streamable HTTP:

POST https://api.brainstormrouter.com/v1/mcp/connect

Tool Categories

CategoryToolsPermission
Routing & Modelsbr_route_completion, br_list_models, br_get_usage, br_set_alias, br_list_aliases, br_patch_aliases, br_get_healthrouter., config., audit.read
Memorybr_memory_list, br_memory_store, br_memory_querymemory.*
Configbr_list_prompts, br_list_presets, br_list_config, br_get_config, br_set_configconfig.*
Ops & Insightsbr_get_ops_status, br_get_insights, br_get_governance, br_get_insights_daily, br_get_insights_forecastrouter.read, audit.read
Agentsbr_list_agents, br_get_leaderboard, br_bootstrap_agent, br_agent_status, br_agent_limits, br_agent_anomalyagent.*
Delegationbr_delegate_agent, br_list_sub_agents, br_terminate_sub_agentagent.delegate
Capacitybr_get_capacityrouter.read
Securitybr_get_security_status, br_get_policies, br_test_policysecurity.read
Budgetbr_get_budget_status, br_get_budget_forecastaudit.read
Kill Switchbr_activate_killswitch, br_deactivate_killswitch, br_get_killswitch_statussecurity.*
Platform Adminbr_list_tenants, br_approve_tenant, br_reject_tenant, br_get_business_digest, br_create_invite_codeplatform.admin

Kill Switch Enforcement

When the kill switch is active, only governance-related tools remain callable (br_get_budget_status, br_get_budget_forecast, br_activate_killswitch, br_deactivate_killswitch, br_get_killswitch_status). All other tools return an error.

REST API

All endpoints require API key authentication (Authorization: Bearer br_live_...).

Server Management

MethodEndpointDescription
POST/v1/mcp/serversRegister an external MCP server
GET/v1/mcp/serversList registered servers
GET/v1/mcp/servers/:idGet server details + tools
PUT/v1/mcp/servers/:idUpdate server config
DELETE/v1/mcp/servers/:idRemove a server
POST/v1/mcp/servers/:id/discoverDiscover tools from server

Tool Execution

MethodEndpointDescription
GET/v1/mcp/toolsList all tools across servers
POST/v1/mcp/tools/:server/:toolExecute a tool call

Governance

MethodEndpointDescription
GET/v1/mcp/governanceGovernance engine status
GET/v1/mcp/approvalsList pending approvals
POST/v1/mcp/approvals/:id/approveApprove a queued call
POST/v1/mcp/approvals/:id/denyDeny a queued call
PUT/v1/mcp/governance/policyUpdate a tool policy

Audit

MethodEndpointDescription
GET/v1/mcp/auditTool call audit log

MCP Server (BrainstormRouter as MCP Server)

MethodEndpointDescription
POST/v1/mcp/connectStreamable HTTP transport endpoint
GET/v1/mcp/connectServer info and tool list