MCProxy
An MCP server proxy that reduces context window bloat by stripping metadata and fetching schemas on-demand, while managing backend MCP servers across multiple transports. It also provides a web dashboard for monitoring and restarting backend servers.
README
MCProxy š
MCProxy is an MCP server proxy designed to reduce Model Context Protocol (MCP) context window bloat while preserving LLM client permissions. It strips heavy metadata and JSON schemas from backend tool definitions during the discovery phase, forcing LLM clients to fetch full schemas dynamically on-demand via a deduplicated Master Server.
Disclosure: This project contains code generated mostly by Gemini, with human editing. It is not intended to be production-ready and is not feature-complete and compatible with all scenarios.
Features
- Context Compression: Strips heavy descriptions, nested properties, and large enums from backend tools, reducing token overhead significantly while preserving client-side policies and call-time permissions.
- Master Metadata Routing: Exposes a single
get_tool_detailshelper tool on a master endpoint (/mcp) so individual backend servers stay uncluttered. - Multi-Transport Support: Manages backend servers running over Stdio, Server-Sent Events (SSE), and modern Streamable HTTP.
- Fleet Management Web UI: Includes an embedded dashboard at
/statusdisplaying live server statuses and a simple one-click Restart action for individual downed or unauthenticated backends. - Nix & Home Manager Native: Easily deployable and configurable declaratively using Nix derivations and Home Manager modules.
Project Structure
src/
āāā types.ts # TypeScript interfaces and state types
āāā backendManager.ts # MCP SDK client/server lifecycle, transport factories, & caching
āāā index.ts # Express routing, Fleet Manager UI logic, & entry point
āāā views/
āāā status.ejs # EJS template for the Fleet Status dashboard
Getting Started & Development
Prerequisites
- Node.js (v22+)
- Nix (optional, but recommended for development and deployment)
Local Development (via Nix DevShell)
Clone the repository and enter the Nix development environment:
nix develop
npm install
Start the proxy locally using tsx:
npm run dev
Configuration (mcpServers.json)
MCProxy is configured via a JSON file (or generated via Nix) defining your backend MCP servers. It supports environment variable interpolation using the ${VAR_NAME} syntax.
{
"filesystem": {
"transport": "stdio",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/home/user/code"]
},
"github": {
"transport": "sse",
"url": "https://mcp.internal.mycompany.com/github/sse",
"headers": {
"Authorization": "Bearer ${GITHUB_TOKEN}"
}
}
}
Nix & Home Manager Integration
This repository includes a flake.nix and module.nix to integrate MCProxy seamlessly into your Home Manager setup.
Enable the Service
In your Home Manager configuration, enable the proxy, define your backend servers, and pipe the auto-generated configuration directly into your system-wide MCP client setup (programs.mcp):
{ config, pkgs, inputs, ... }: {
services.mcproxy = {
enable = true;
port = 11262;
servers = {
filesystem = {
transport = "stdio";
command = "npx";
args = [ "-y" "@modelcontextprotocol/server-filesystem" "/home/user/code" ];
};
};
};
# Automatically exposes the Master and Proxied Streamable HTTP endpoints
programs.mcp = {
enable = true;
servers = config.services.mcproxy.generatedConfig;
};
}
Status Dashboard
Once running, MCProxy exposes a built-in web management portal at: http://127.0.0.1:11262/status.
- Live Monitoring: View whether your backend servers are RUNNING, STARTING, or encountering an ERROR (such as a 401 Unauthorized token expiration).
- Individual Restarts: If a backend server drops or requires an updated OAuth token, resolve the issue externally and click Restart right from the UI to re-initialize that specific backend without restarting the entire proxy fleet.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.