Nexus-Router/nexus
Govern & Secure your AI
434 ★25 forksRustUpdated 4mo ago
What you need to know
A Rust gateway that aggregates MCP servers (STDIO, SSE, streamable HTTP) behind one endpoint and routes LLM chat completions across OpenAI, Anthropic, Google, and AWS Bedrock with full tool calling — with context-aware tool search, OAuth2, rate limiting, and OpenTelemetry observability.
Install
curl -fsSL https://nexusrouter.com/install | bash docker pull ghcr.io/grafbase/nexus:latest git clone https://github.com/grafbase/nexus && cd nexus && cargo build --release
Usage
- •Run `nexus` (default 127.0.0.1:8000) or `docker run -p 8000:8000 -v /path/to/config:/etc/nexus.toml ghcr.io/grafbase/nexus:latest`
- •Configure nexus.toml: [mcp.servers.*] for STDIO (cmd/args/env/cwd), SSE, or streamable-http servers; [llm.providers.*] for LLM routing
- •Connect Cursor (`http://localhost:8000/mcp`), Claude Code (`claude mcp add --transport http nexus http://localhost:8000/mcp`), or Codex CLI (base_url http://127.0.0.1:8000/llm/openai/v1)
- •Use the unified OpenAI-compatible LLM API: `curl http://localhost:8000/llm/chat/completions -d '{"model": "anthropic/claude-3-5-sonnet-20241022", ...}'`
Key features
- ✓MCP aggregation across STDIO, SSE, and streamable-http servers with context-aware fuzzy `search` and `execute` tools
- ✓LLM provider routing with full tool calling (OpenAI/Anthropic/Google/Bedrock), model discovery, renaming, and token forwarding (X-Provider-API-Key)
- ✓Security: CORS, CSRF protection, OAuth2 (JWT validation), TLS, per-server auth tokens and header insertion
- ✓Rate limiting: multi-level (global/per-IP/per-server/per-tool) with in-memory or Redis backends, plus LLM token-based per-user limits
- ✓Comprehensive OpenTelemetry: metrics, distributed tracing (W3C + AWS X-Ray), logs export
Best for
Teams that want one self-hosted gateway to govern both MCP tools and LLM provider access (with OAuth2, rate limits, and telemetry) for internal agents.
Caveats
- ⚠LLM token rate limiting requires client identification to be enabled (jwt_claim or http_header) — otherwise requests fail with a config error
- ⚠AWS Bedrock: token forwarding and custom headers are not supported (IAM/SigV4); Meta Llama function calling has issues; DeepSeek tools don't work with Bedrock
- ⚠MCP header insertion only supports static values (incoming request headers are not forwarded)
- ⚠STDIO tools only appear in search results, not the base tool list; STDIO servers must output valid JSON-RPC on stdout
- ⚠Nexus is a terminal node for traces — it does not propagate trace context downstream
Platforms: Linux · macOS · Windows (WSL)Clients: Cursor · Claude Code · Codex CLI
Documentation ↗Reviewed 2026-08-07
Topics
aiapilarge-language-modelsllmopsllmsmcpmodel-context-protocol
- Stars
- 434★
- Forks
- 25
- Language
- Rust
- License
- MPL-2.0
- Created
- 2025-07-11
- Last push
- 2026-03-16