nexus
Govern & Secure your AI
claude mcp add --transport stdio nexus-router-nexus nexus
How to use
Nexus acts as an aggregator and router for multiple MCP servers, APIs, and LLM providers. It lets you connect various downstream MCP services (STDIO, SSE, HTTP) under a single endpoint, while providing unified tooling for routing to OpenAI, Anthropic, Google, and AWS Bedrock providers with tool-calling support. With Nexus you can perform intelligent searches across all connected tools using natural language queries, and you can configure multi-level rate limits, TLS, CSRF protection, and OAuth2 for secure operation. The server is designed to be flexible via a TOML-based configuration (nexus.toml) and supports substituting environment variables for sensitive values, making it suitable for both local development and production deployments. Nexus also offers Docker images for quick deployment and can function as a central control plane for your AI stack.
To use the tools and capabilities, start Nexus using the binary (nexus) or a container image, and point it at your configuration file (e.g., nexus.toml). You can expose a REST/HTTP endpoint (default /mcp) to receive MCP requests and route them to the appropriate downstream servers or LLM providers. The configuration supports: configuring multiple MCP servers (each with its own protocol and authentication), setting up LLM providers (OpenAI, Anthropic, etc.) with API keys, and enabling features like structured content for MCP responses. Expect to interact with the unified endpoint to perform MCP actions, tool lookups, and LLM invocations across your connected services.
How to install
Prerequisites:
- Rust toolchain (for building from source) or Docker for containerized deployment
- Git
- Optional: Docker and Docker Compose for containerized deployment
Install from source (Linux/macOS/Windows):
- Install Rust and Cargo from https://www.rust-lang.org/tools/install
- Clone the repository: git clone https://github.com/grafbase/nexus cd nexus
- Build in release mode: cargo build --release
- Run the binary (assuming the build produced an executable named
nexusin target/release): ./target/release/nexus
Install via Docker (preferred for quick start):
- Pull the image: docker pull ghcr.io/grafbase/nexus:latest
- Run with a mounted configuration file (nexus.toml): docker run -p 8000:8000 -v /path/to/nexus.toml:/etc/nexus.toml ghcr.io/grafbase/nexus:latest
Docker Compose (example):
- Create nexus.toml with your configuration
- Use a docker-compose.yml similar to: services: nexus: image: ghcr.io/grafbase/nexus:latest ports: - "8000:8000" volumes: - ./nexus.toml:/etc/nexus.toml environment: - GITHUB_TOKEN=${GITHUB_TOKEN}
Prerequisites recap:
- A configured nexus.toml file defining your MCP servers and LLM providers
- Access to required API keys for LLM providers (OPENAI_API_KEY, ANTHROPIC_API_KEY, etc.)
- If using Docker, ensure Docker is running and you have network access to pull the image
Additional notes
Tips and common considerations:
- Nexus uses a TOML-based configuration with environment-variable substitution for sensitive values. Populate nexus.toml with provider credentials and MCP server definitions, ensuring proper path and access rights.
- When using HTTP-based MCP servers, you can define headers (static values) that Nexus will insert on requests to those servers. Be mindful that only static values are supported and environment variables can be substituted using {{ env.VAR }} syntax.
- For secure deployments, enable TLS/HTTPS and OAuth2 as needed. Configure health checks and consider Redis or in-memory backends for rate limiting as per your load profile.
- If you encounter issues with JSON-RPC formatting from STDIO MCP servers, verify that the downstream process outputs valid JSON-RPC messages to stdout.
- Check Nexus logs for configuration loading errors and ensure that environment variables referenced in nexus.toml are actually set in your runtime environment.
Related MCP Servers
mcp-agent
Build effective agents using Model Context Protocol and simple workflow patterns
grafbase
The Grafbase GraphQL Federation Gateway
mcp_on_ruby
💎 A Ruby implementation of the Model Context Protocol
mxcp
Model eXecution + Context Protocol: Enterprise-Grade Data-to-AI Infrastructure
offeryn
Build tools for LLMs in Rust using Model Context Protocol
mcp-protocol-sdk
[DEPRECATED] Moved to prism-mcp-rs - Enterprise-grade Rust MCP SDK