Nexus: gateway for MCP servers and LLM providers
Nexus
A Rust gateway that puts MCP servers and LLM providers behind one address and adds authorization, rate limits and tool search
- 436 ★ on the repository
- Last commit
- MPL-2.0
Broad access
Why this level
- The gateway holds LLM provider keys and MCP server tokens and passes every agent tool call through itself
- STDIO servers from the configuration start as child processes with an arbitrary `cmd` command, environment variables and a working directory
- Without OAuth2 the gateway accepts any string in place of a key, so the port has to be kept closed: by default it listens on 127.0.0.1:8000
Install
- Works in
Manual install
curl -fsSL https://nexusrouter.com/install | bashInstalls the binary on Linux, macOS and Windows through WSL. The `nexus` command starts the gateway with the `nexus.toml` file.
Access and checks
How we reviewBroad accessThe tool can change data, run commands or handle secrets.
- The gateway holds LLM provider keys and MCP server tokens and passes every agent tool call through itself
- STDIO servers from the configuration start as child processes with an arbitrary `cmd` command, environment variables and a working directory
- Without OAuth2 the gateway accepts any string in place of a key, so the port has to be kept closed: by default it listens on 127.0.0.1:8000
This is third-party code. Review the repository files before installing.
What it does
Nexus is a Rust server that sits between an agent and your MCP servers and LLM providers. The agent connects to one `/mcp` address, while Nexus talks to the connected servers over STDIO, SSE or streamable HTTP and gathers their tools into one list. The agent sees two tools. `search` finds suitable tools from a natural language query with fuzzy matching, and `execute` calls the chosen one. Names get the server prefix, for example `github__search_code` and `filesystem__read_file`. For models, Nexus offers a single OpenAI-format entry point at `/llm/openai`, and the `/llm/anthropic` path can be turned on. Requests are routed by model name and translated into the OpenAI, Anthropic, Google or AWS Bedrock format. Everything is configured in the `nexus.toml` file: group-based access, OAuth2, rate limits in memory or in Redis, TLS and OTLP telemetry.
Who it is for. For teams and developers who run several MCP servers and LLM providers and want agents to go through one protected address with shared access rules.
Good fit when
- Many MCP servers are connected and their tool lists bloat the agent's context
- You need one address for Claude Code, Cursor and Codex CLI without configuring every server separately
- You need to limit which user groups see paid or dangerous MCP tools
- You need request limits per user, per IP, per MCP server or per model, stored in Redis
- OpenAI, Anthropic, Google and Bedrock models have to be called through one OpenAI-format endpoint
Not a fit when
- One or two MCP servers are enough: connecting directly is simpler than running a separate service
- You need a cloud service with no hosting of your own: you install and run Nexus yourself
- You need a graphical management interface: configuration lives in the `nexus.toml` file
Example request
Find among the connected tools the one that searches code on GitHub and call it for a query about error handling in AxiosMCP
- Transport
- http
- Authentication
- not required
Environment variables
OPENAI_API_KEYsecret- OpenAI key for the provider block in nexus.toml. Needed only if the provider is connected.
ANTHROPIC_API_KEYsecret- Anthropic key for the provider block in nexus.toml. Needed only if the provider is connected.
Limitations
For MCP only static header insertion is supported, and only for HTTP servers: headers of incoming requests are not forwarded and the rule does not apply to STDIO servers. Keys are substituted from environment variables with the `{{ env.NAME }}` notation.
If at startup the model list cannot be fetched from at least one provider, Nexus exits so you can fix the configuration. With OAuth2 enabled, clients need a JWT, and passing the token to downstream servers is switched on with the `forward` setting when they all use one authorization server. Group limits require client identification.
OpenAI and Anthropic are connected as providers with their own keys, and their APIs are unavailable from Russia. The Docker image is published with the tags `latest`, `stable` and a specific version.
How to disable. Stop the `nexus` process or the container and remove the server from the client configuration: in Claude Code that is `claude mcp remove nexus`. The `nexus.toml` file with keys is stored separately, so delete it if the gateway is no longer needed.
FAQ
How do I connect Nexus to Claude Code?
Start Nexus, then run `claude mcp add --transport http nexus http://localhost:8000/mcp` or put the same address in the project's `.mcp.json`. Check with `claude mcp list`. The gateway has to be running before Claude Code starts.
What do the search and execute tools do?
`search` finds the needed tools across all connected MCP servers from a natural language query and returns names, descriptions and parameters. `execute` calls the chosen tool with those parameters.
How do I add an MCP server to Nexus?
In `nexus.toml` describe a `[mcp.servers.name]` block. For a local process set `cmd`, for example launching the filesystem server through `npx`, for a remote one give `url` and, if needed, `protocol`. Without a protocol Nexus tries streamable HTTP first, then SSE.
How do I route Codex CLI through Nexus?
In `~/.codex/config.toml` add a `nexus` provider with `base_url = "http://127.0.0.1:8000/llm/openai/v1"`. The `/v1` suffix is mandatory. Start with `codex -c model="anthropic/claude-3-5-haiku-latest" -c model_provider=nexus`.
How do I lock Nexus down against outsiders?
Turn on a `[server.oauth]` block with a JWKS address: then every path except `/health` and `/.well-known/oauth-protected-resource` requires a JWT. In addition you set groups with `allow` and `deny` for servers and tools, and request limits.
Discussion
No questions or reviews yet.
Related
MCP serversAgentgateway
agentgateway
A proxy for agentic traffic: routes and secures connections to MCP servers, LLMs, and other agents over A2A
An MCP server for NixOS resources: search packages and options so the agent does not invent names and settings
An IBM gateway and registry that federates MCP servers, A2A agents and REST or gRPC APIs behind one endpoint with auth and observability
A Node.js manager for MCP servers: it starts local servers, connects remote ones and gives a client one address, with a REST API for control
1c-nexus-infra: code graph, RAG and MCP bridges for 1C
1c-nexus-infra
Standalone infrastructure for a 1C developer: a static code call graph, a RAG-style decision base with a lifecycle, and bridges to external MCP servers
A Rust code-quality sensor that scores a project before and after an agent session, installable as a Claude Code plugin or MCP server
Comparison with similar tools
Entries that share the main search query, and how they differ.
| Entry | Official | Authentication | Repository stars | Main difference |
|---|---|---|---|---|
| Nexus: gateway for MCP servers and LLM providers (this entry) | no | not required | 436 | |
| Docker MCP Gateway | yes | not required | 1,616 | the docker mcp CLI plugin and gateway: MCP servers from the Docker catalog in isolated containers behind one connection point |
| ContextForge | no | API key | 4,720 | a gateway and registry from IBM that unites MCP servers, A2A agents and REST or gRPC APIs with authorization |
| 1MCP Agent | no | not required | 525 | one MCP server in place of many, serving the connected servers to the client at a single address |
README in short
The description starts with the feature list and installation, then goes through `nexus.toml` in detail: MCP server types, authentication, access rules, limits, TLS, model providers and telemetry. At the end it gives connection examples for Cursor, Claude Code and Codex CLI and client snippets in Python and JavaScript.