mcp_proxy
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
ο»Ώ
Agnostic MCP HTTP/SSE Proxy Server (SDK v2.0.0+)
A highly extensible, API-agnostic Model Context Protocol (MCP) proxy gateway built using Python's modern MCP SDK 2.0.0+, FastAPI, and Starlette.
This server acts as a centralized routing engine that discovers, sanitizes, namespaces, and executes tools published across multiple independent, downstream remote HTTP/SSE or unified gateway MCP servers (such as Yahoo Finance or AlphaVantage) without hardcoding explicit routes or functions.
π Key Features
Agnostic Schema Discovery: Merges dynamic tool capabilities across distinct downstream endpoints seamlessly.
Isolation Namespacing: Auto-prefixes remote tools using the syntax
{server_name}__{original_tool_name}to isolate environments and prevent asset collisions.Protocol Failure Resilience: Automatically strips conflicting
output_schemafields from non-compliant remote servers to prevent runtime deserialization exceptions.Production-Grade Project Layout: Fully modularized layout cleanly separating configurations, server logic, network routers, and telemetry wrappers.
Daily Rotating Local Logging: Built-in rolling log files saved to a dedicated
logs/directory with explicit date-stamps.
Related MCP server: MCP Proxy Server
π Project Architecture Layout
The codebase implements a decoupled design pattern to ensure straightforward maintainability:
mcp_proxy/
β
βββ config/
β βββ __init__.py
β βββ manager.py # Handles reading/persisting proxy_servers.json relative to the module
β
βββ observability/
β βββ __init__.py
β βββ tracker.py # Async context manager placeholder for tiktoken and future MLflow metrics
β
βββ core/
β βββ __init__.py
β βββ proxy.py # Primary MCP server engine and namespaced call routing loops
β
βββ api/
β βββ __init__.py
β βββ routes.py # Connects raw Starlette routes bypassing FastAPI middleware issues
β
βββ logs/
β βββ mcp_proxy.log # Active file logging sink (daily timestamp rotated)
β
βββ .gitignore # Eradicates runtime cache and configuration leakage to VCS trackers
βββ proxy_servers.json # Local flat registry containing active remote endpoints
βββ main.py # Application lifecycle entry point (Uvicorn launchpad)π οΈ Quick Start
1. Installation
Clone the repository, initialize your virtual environment, and install dependencies utilizing trusted host flags to bypass SSL roadblocks:
# Create and activate environment
python -m venv venv
./venv/Scripts/activate # On Windows Powershell
# Install dependencies securely
pip install -r requirements.txt2. Configure Downstream Servers
Populate the configuration registry file inside the config/ directory. Create config/proxy_servers.json:
{
"yahoo_finance": "https://gateway.mcpservers.org/yahoo-finance/mcp",
"alphavantage_mcp": "http://localhost:8001/mcp"
}3. Launch the Server
Execute the uvicorn launchpad from the root project directory:
python main.pyπ§ͺ cURL Testing Sequences
The proxy operates using asynchronous Server-Sent Events (SSE). Testing requires a two-step approach: opening a persistent listening stream channel first, followed by sending JSON-RPC payloads containing an active tracking token.
Step 1: Open the Streaming Monitor Connection
Open a first terminal window.
Initialize β capture the session id.
curl -i -X POST http://localhost:8000/mcp
-H "Content-Type: application/json"
-H "Accept: application/json, text/event-stream"
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2026-07-28",
"capabilities": {},
"clientInfo": {"name": "curl-client", "version": "1.0"}
}
}'
Look at the response headers (-i prints them) for: Mcp-Session-Id: Grab that value.
Send the required initialized notification (some servers reject calls before this)
$ curl -i -X POST http://localhost:8000/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "Mcp-Session-Id: a1d13341fca34c7eb5c6684e9983e6b9" \
-d '{
"jsonrpc": "2.0",
"method": "notifications/initialized"
}'
HTTP/1.1 202 Accepted
date: Wed, 09 Sep 2026 12:05:51 GMT
server: uvicorn
content-type: application/json
mcp-session-id: a1d13341fca34c7eb5c6684e9983e6b9
content-length: 0
Step 2: Fetch the Consolidated Tools List
Open a second terminal window and push a tools/list JSON-RPC request frame. Replace the session_id parameter at the end of the URL with your copied token:
curl -s -X POST http://localhost:8000/mcp
-H "Content-Type: application/json"
-H "Accept: application/json, text/event-stream"
-H "Mcp-Session-Id: a1d13341fca34c7eb5c6684e9983e6b9"
-d '{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/list"
}' | python3 -m json.tool
The | python3 -m json.tool just pretty-prints it β drop that if you want the raw single-line response.
Step 3: Execute a Proxied Tool Call
To invoke an environment-isolated remote tool, execute a tools/call JSON-RPC payload in your second terminal window, embedding the target parameters inside the flat schema layout:
curl -i -X POST http://localhost:8000/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "Mcp-Session-Id: a1d13341fca34c7eb5c6684e9983e6b9" \
-d '{
"jsonrpc": "2.0",
"id": 5,
"method": "tools/call",
"params": {
"name": "yahoofinance_mcp__get_quote",
"arguments": {
"symbols": ["MSFT", "AAPL"]
}
}
}'
---
### Step 4: Interrogate Internal Proxy Management Tools
You can check proxy states or update bindings on-the-fly using native management tools:
#### List Registered Upstream Hosts
#### Dynamically Register a New Remote Server
####
curl -i -X POST http://localhost:8000/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "Mcp-Session-Id: a1d13341fca34c7eb5c6684e9983e6b9" \
-d '{
"jsonrpc": "2.0",
"id": 5,
"method": "tools/call",
"params": {
"name": "yahoofinance_mcp__get_quote",
"arguments": {
"symbols": ["MSFT", "AAPL"]
}
}
}'
# MLFLOW Logging and URL Configuration resides in .env file Create on ROOT Directory .env file has
MCP_PROXY_LOGGING=false
MLFLOW_TRACKING_URI=http://127.0.0.1:5000Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP federation gateway: route, govern and observe agent tools across clouds and MCP servers.
MCP Gateway: wrap any MCP server with cold-start retries, uptime SLA, and per-execution MPP billing.
Streamable HTTP MCP gateway for NV oOS fleets β one API key, namespaced tools, quotas and policy.
Remote MCP server exposing SMI Aware tools, resources, and skills over Streamable HTTP.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA configurable MCP gateway that runs multiple Streamable HTTP MCP servers and exposes all their tools through a single endpoint, enabling tool aggregation and routing for MCP clients.1-
- AlicenseNot gradedqualityAmaintenanceEnables connecting to and managing multiple backend MCP servers (Stdio, SSE, Streamable HTTP), aggregating their tools/resources, and exposing them through unified SSE, Streamable HTTP, or Stdio endpoints with routing, authentication, and optional web-based administration.120 npmMIT
- AlicenseNot gradedqualityAmaintenanceAggregates and routes requests across multiple backend MCP servers, exposing their combined tools and resources through unified SSE, Streamable HTTP, or Stdio endpoints. Supports optional Web UI management, granular tool control, and endpoint authentication.120 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables aggregating and routing multiple backend MCP resource servers so clients can access their combined tools and resources through a unified SSE, Streamable HTTP, or Stdio interface, with optional authentication and web-based management.120 npmMIT