{"name":"mcp-gateway: Unifying AI Tool Access with Reduced Context Overhead","description":"mcp-gateway is a powerful Rust binary designed to streamline AI agent interaction with diverse tools. It consolidates unlimited MCP servers and REST APIs behind a single, compact endpoint, drastically reducing context token overhead and enabling efficient tool access.","github":"https://github.com/MikkoParkkola/mcp-gateway","url":"https://osrepos.com/repo/mikkoparkkola-mcp-gateway","source":"osrepos.com","sourceDescription":"This repository profile is provided by osrepos.com, an open source repository discovery platform.","repositoryProfile":"https://osrepos.com/repo/mikkoparkkola-mcp-gateway","generatedFor":"open source discovery and AI-assisted research","markdown":"https://osrepos.com/repo/mikkoparkkola-mcp-gateway.md","json":"https://osrepos.com/repo/mikkoparkkola-mcp-gateway.json","topics":["ai","llm","mcp","gateway","rust","proxy","agentic-ai","tool-orchestration"],"keywords":["ai","llm","mcp","gateway","rust","proxy","agentic-ai","tool-orchestration"],"stars":null,"summary":"mcp-gateway is a powerful Rust binary designed to streamline AI agent interaction with diverse tools. It consolidates unlimited MCP servers and REST APIs behind a single, compact endpoint, drastically reducing context token overhead and enabling efficient tool access.","content":"## Introduction\n\nmcp-gateway is a universal gateway built in Rust, designed to revolutionize how AI agents interact with a multitude of tools and services. It addresses the critical challenge of managing extensive toolsets for AI, which often leads to inflated context window costs and limitations. By consolidating unlimited Model Context Protocol (MCP) servers and REST APIs behind a single, compact endpoint, mcp-gateway presents AI agents with a streamlined meta-surface of just 14-16 tools.\n\nThis intelligent routing mechanism ensures that AI agents can dynamically discover and invoke any backend tool on demand, significantly reducing context token overhead. For instance, it can achieve approximately 89% less context-token overhead on a 100-tool stack, making tool integration scalable and cost-effective.\n\n## Installation\n\nGetting started with mcp-gateway is straightforward. The recommended method for macOS/Linux is Homebrew, but other options are available.\n\n**Quick Start (Recommended):**\n\n1.  **Install:**\n    bash\n    brew trust --tap MikkoParkkola/tap\n    brew install MikkoParkkola/tap/mcp-gateway\n    \n2.  **Setup Wizard:** Import existing servers and configure clients.\n    bash\n    mcp-gateway setup wizard --configure-client\n    \n3.  **Run:** Start the gateway.\n    bash\n    mcp-gateway serve\n    \n4.  **Verify:** Check the health of your setup.\n    bash\n    mcp-gateway doctor\n    \n\n**Other Installation Methods:**\n\n*   **Cargo:** `cargo install mcp-gateway`\n*   **cargo-binstall:** `cargo binstall mcp-gateway`\n*   **Direct Binary Download:** Available for Windows x64 from the [latest release](https://github.com/MikkoParkkola/mcp-gateway/releases/latest){target=\"_blank\"}. Specific commands for macOS and Linux are also provided in the official README.\n*   **Docker:** `docker run -v $(pwd)/gateway.yaml:/config.yaml ghcr.io/mikkoparkkola/mcp-gateway:latest --config /config.yaml`\n\n## Examples\n\nmcp-gateway offers flexible ways to configure and connect your tools.\n\n**Adding Backend Servers:**\n\nYou can add servers using the built-in registry or by defining them in `gateway.yaml`.\n\n*   **Using the `add` command:**\n    bash\n    mcp-gateway add tavily # Adds a known server\n    mcp-gateway add my-server -- npx -y @some/mcp-server --flag # Add an arbitrary stdio command\n    mcp-gateway add --url https://mcp.sentry.dev/mcp sentry # Add an HTTP server\n    \n*   **Initializing with examples:** If you have no servers yet, run `mcp-gateway init --with-examples` to create a working `gateway.yaml` with public capabilities.\n\n**Connecting AI Clients:**\n\nAfter running `mcp-gateway serve`, your AI clients can connect to the gateway. The `setup export` command can automatically configure many popular AI clients.\n\n*   **Auto-export configuration:**\n    bash\n    mcp-gateway setup export --target all # Writes, backs up, and verifies client configs\n    \n*   **Manual JSON snippet for clients:** If you prefer to configure manually, add this to your client's MCP server configuration:\n    \n    {\n      \"mcpServers\": {\n        \"gateway\": {\n          \"type\": \"http\",\n          \"url\": \"http://localhost:39400/mcp\"\n        }\n      }\n    }\n    \n\n## Why Use mcp-gateway?\n\nmcp-gateway provides significant advantages for AI tool orchestration:\n\n*   **Massive Context Overhead Reduction:** Achieve approximately 89% less context overhead. On a 100-tool stack, this translates to substantial token and cost savings, as the AI agent only loads tools it uses in the current turn.\n*   **Unlimited, On-Demand Tool Discovery:** Break free from context limits. AI agents can search for (`gateway_search_tools`) and invoke (`gateway_invoke`) any tool from an unlimited catalog as needed, rather than loading everything upfront.\n*   **Effortless REST API Integration:** Easily integrate any REST API in minutes by dropping in a YAML file or importing an OpenAPI specification. The gateway ships with over 110 built-in capabilities.\n*   **Enhanced Security:** Benefit from robust security features, including a tool-poisoning validator, SHA-256 capability hash-pinning, rug-pull detection, and comprehensive coverage of the OWASP Agentic AI Top 10 risks. The entire binary is `#![forbid(unsafe_code)]`.\n*   **Production-Grade Resilience:** Built-in circuit breakers, retries with backoff, rate limiting, and health checks ensure that a single flaky backend does not compromise the entire toolchain.\n*   **Seamless Configuration Updates:** Hot-reload backends and configuration in milliseconds without restarting the AI session or losing context.\n*   **Multitenant Identity Propagation:** Securely propagate verified end-user identity to backends, enabling per-user access control and audit trails without storing long-lived credentials.\n\n## Links\n\nFor more detailed information, please refer to the official resources:\n\n*   **GitHub Repository:** [https://github.com/MikkoParkkola/mcp-gateway](https://github.com/MikkoParkkola/mcp-gateway){target=\"_blank\"}\n*   **Quick Start Guide:** [https://github.com/MikkoParkkola/mcp-gateway/blob/main/docs/QUICKSTART.md](https://github.com/MikkoParkkola/mcp-gateway/blob/main/docs/QUICKSTART.md){target=\"_blank\"}\n*   **Documentation Index:** [https://github.com/MikkoParkkola/mcp-gateway#documentation](https://github.com/MikkoParkkola/mcp-gateway#documentation){target=\"_blank\"}\n*   **Latest Releases:** [https://github.com/MikkoParkkola/mcp-gateway/releases](https://github.com/MikkoParkkola/mcp-gateway/releases){target=\"_blank\"}","metrics":{"detailViews":3,"githubClicks":1},"dates":{"published":null,"modified":"2026-08-15T16:24:31.000Z"}}