MCP Servers
Configure Model Context Protocol servers in nRouter. Connect upstream tools through a secured reverse proxy with $0 spend holds and client config exports.
Last updated
The Model Context Protocol (MCP) is an open standard that enables AI models and agents to interact with external tools, databases, and context repositories. nRouter provides a secure, centralized MCP Gateway that acts as an authenticated reverse proxy between AI clients (such as Claude Desktop, Cursor, or autonomous agents) and your private upstream tool servers.
What is the nRouter MCP Gateway?
Running MCP servers in production often exposes sensitive API credentials and creates fragmentation when each developer configures local tool connections individually. The nRouter MCP Gateway solves this by proxying tool traffic through a centralized, secured gateway endpoint:
https://api.nrouter.ai/mcp/{server_name}
┌─────────────────────────────────┐
│ AI Client (Claude / Cursor) │
│ Auth: Bearer sk-nrouter-* │
└────────────────┬────────────────┘
│
▼
┌────────────────────────────────────────────────────────┐
│ nRouter MCP Gateway (api.nrouter.ai/mcp/{server_name}) │
│ • Validates virtual key (sk-nrouter-*) │
│ • Enforces rate limits & plan allowances │
│ • $0 spend hold (no token deduction) │
│ • Decrypts upstream credentials │
│ • Strips client auth & internal headers │
└────────────────┬───────────────────────────────────────┘
│
▼
┌─────────────────────────────────┐
│ Upstream MCP Server │
│ (GitHub / Linear / PostgreSQL) │
└─────────────────────────────────┘Zero-credit proxying ($0 spend hold)
Because tool execution does not consume LLM generation tokens, nRouter handles MCP requests under a $0 spend hold policy:
- No credit reservation: Calls to
/mcpand/mcp/{server_name}do not place credit reservations or deduct token costs from your prepaid balance. - Budget and quota enforcement: Traffic is governed by your organization's rate limits (RPM), plan tier allowances, and virtual key budget ceilings rather than token list prices.
- Header filtering: The gateway strips incoming client authorization tokens and internal headers before dispatching requests to upstream servers, preventing credential leaks.
Server-Side Request Forgery (SSRF) defense
To protect internal infrastructure, the gateway strictly validates every registered upstream URL:
- Requires
https://; every other scheme is rejected (http://,file://,ftp://,gopher://). - Blocks loopback interfaces (
127.0.0.1,localhost,0.0.0.0,::1). - Blocks cloud metadata endpoints (
169.254.169.254,metadata.google.internal). - Blocks RFC 1918 private subnets (
10.0.0.0/8,172.16.0.0/12,192.168.0.0/16).
Dashboard Management
The dashboard has two pages for MCP, each with its own sidebar entry:
- MCP Hub (
/[organization]/mcp-hub): register, configure, test, and delete your MCP servers. Every member can see the list; only the Owner and Organization Admin roles can change it or run a connection test. - Tools Hub (
/[organization]/tools-hub): one searchable catalogue of the tools your servers expose, open to every member of the organization.
Registering an upstream server
To register a new MCP server:
- Navigate to MCP Hub in the dashboard sidebar.
- Click Connect Server.
- Fill in the server parameters:
- Server Name: A unique identifier within your organization (e.g.
linear,github,database-tools). This slug defines the proxy route:https://api.nrouter.ai/mcp/{server_name}. - Description: An optional human-readable summary of the tools provided by this server.
- Upstream URL: The destination endpoint where your MCP server is listening (e.g.
https://mcp.internal.acme.com/mcp). - Transport: The transport protocol used by the upstream server (Streamable HTTP).
- Authentication: The credential type required to authenticate with the upstream server.
- Server Name: A unique identifier within your organization (e.g.
- Click Connect Server.
Transports & Authentication
nRouter supports industry-standard MCP transports and upstream authentication protocols.
Supported transport
- Streamable HTTP (
streamable_http): The standard HTTP streaming JSON-RPC transport for modern MCP endpoints, supporting persistent bidirectional tool sessions.
Upstream authentication mechanisms
| Auth Type | Description | Upstream Header Added |
|---|---|---|
None (none) | Public MCP servers requiring no authentication. | None |
Bearer Token (bearer_token) | Secret token for modern SaaS APIs. | Authorization: Bearer <token> |
API Key (api_key) | Custom API key. | x-api-key: <key> |
Basic Auth (basic) | Base64-encoded username and password. | Authorization: Basic <base64> |
Cryptographic security
All upstream credentials are encrypted at rest using AES-256-GCM:
- Each secret is encrypted with a unique 12-byte initialization vector (IV) and a 16-byte authentication tag.
- Additional Authenticated Data (AAD) cryptographically binds the ciphertext to the exact organization UUID and server name (
mcp-v1:${orgId}:${serverName}:auth_value). - Renaming a server automatically decrypts and re-encrypts the secret under the new AAD within an atomic transaction.
- The dashboard never reveals plaintext secrets after entry, displaying only the masked suffix (
auth_value_last4, e.g.•••7890).
Plan Tier Allowances
Server registration limits depend on your organization's subscription tier:
| Plan Tier | Max MCP Servers | Allowance Details |
|---|---|---|
| Pay as you go (the one plan on sale) | 1 | Included on every account. Register 1 MCP server; contact support for more. |
| Existing subscribers (Starter / Pro, kept for the organizations that already have them; not sold) | 10 | Carried with the subscription those organizations already hold. |
| Enterprise / Max | 1,000 | Dedicated enterprise infrastructure with custom limits. |
Attempting to register servers beyond your plan quota returns an HTTP 403 plan_limit_reached error. The MCP API publishes quota metrics in its response headers:
x-mcp-limit: Maximum servers permitted on your plan tier.x-mcp-current: Active server count currently registered.x-mcp-plan: Organization plan tier identifier.
Live Connection Testing
Before deploying an MCP server to developer tools or autonomous agents, verify its health using the built-in connection test in the MCP Hub.
When you run the test on a server:
- nRouter's backend retrieves the encrypted credentials and decrypts them in memory.
- The probe dispatches a standard JSON-RPC
tools/listrequest with a 5,000 ms timeout:{ "jsonrpc": "2.0", "id": "nr-probe-1", "method": "tools/list", "params": {} } - The server validates reachability, measures response latency, and parses available tool definitions (enforcing a 1 MiB response ceiling to guard against unbounded payloads).
- Each listed tool is checked before it is saved: its name, description length, and the shape and size of its input schema. A tool that fails is not saved, and the test tells you how many were rejected.
- The saved tools appear in the Tools Hub with their names, descriptions, and input schemas.
Test probes are rate-limited to 10 executions per minute per organization to prevent upstream flooding.
Tools Hub
The Tools Hub lists every tool your connected servers expose, in one place:
- Search by tool name, description, or parameter name, and filter by server or by status (active or inactive).
- Open a tool to inspect its parameters and its JSON Schema.
- Each tool links to its server in the MCP Hub, and each server in the MCP Hub links to its tools.
- When two servers expose a tool with the same name, the Tools Hub also shows a unique name of the form
{server_name}__{tool_name}so you can tell them apart. Calls still go to a server's own proxy route with the tool's original name.
Client Config Export
Once a server is registered and verified, developers can connect their local clients to the nRouter gateway using the Client Integration tab of the MCP Hub.
Connecting Claude Desktop & Claude Code
Add the server to your claude_desktop_config.json (for Claude Desktop) or ~/.claude.json (for Claude Code):
{
"mcpServers": {
"linear": {
"url": "https://api.nrouter.ai/mcp/linear",
"headers": {
"Authorization": "Bearer sk-nrouter-your-virtual-key"
}
}
}
}Connecting Cursor IDE
Add the server configuration to your project's .cursor/mcp.json:
{
"mcpServers": {
"linear": {
"url": "https://api.nrouter.ai/mcp/linear",
"headers": {
"Authorization": "Bearer sk-nrouter-your-virtual-key"
}
}
}
}Using the nRouter SDK
You can also list tools and proxy MCP executions programmatically in TypeScript:
import { nRouter } from "@nrouter_ai/sdk";
const client = new nRouter();
// List tools available through the nRouter MCP proxy
const tools = await client.mcp.listTools("linear");
console.log("Available tools:", tools);Direct HTTP request example
Execute raw JSON-RPC requests directly against the proxy route using cURL:
curl -X POST https://api.nrouter.ai/mcp/linear \
-H "Authorization: Bearer $NROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": "req-1",
"method": "tools/list",
"params": {}
}'Next steps
- API Key Management — Provision virtual keys with granular access
- Dashboard Overview — Monitor gateway traffic and telemetry
- Guardrails — Enforce data privacy policies on agent interactions