Dynamic MCP proxy server with progressive discovery and lazy loading
Project description
MCP Dynamic Proxy
A dynamic MCP (Model Context Protocol) proxy server that provides progressive discovery and lazy loading of MCP servers, dramatically reducing initial context size from 20-300 tools to just 3 core tools.
Features
- Progressive Discovery: Discover MCP servers by tags, category, or search term without loading them
- Lazy Loading: Load MCP servers only when needed
- Minimal Context: Only 3 core discovery/execution tools exposed initially instead of hundreds
- Full MCP Protocol: Uses official MCP SDK for end-to-end protocol support
Architecture
Assistant (Cursor) -MCP-> MCP Dynamic Proxy -MCP-> MCP Servers (AWS, PostgreSQL, etc.)
The proxy exposes only 3 core tools:
mcp_discover_servers- Discover available MCP serversmcp_list_tools- List tools from a specific MCP servermcp_execute_tool- Execute a tool on an MCP server
Installation
Prerequisites
- Python 3.12+
Setup
Install dependencies (requires Python 3.12 available on PATH):
python3.12 -m pip install -e .
For development:
python3.12 -m pip install -e ".[dev]"
Configuration
Create a config/mcp.json file with your MCP server configurations:
{
"version": "1.0",
"mcpServers": {
"aws-knowledge-mcp-server": {
"description": "AWS knowledge base with documentation, best practices, and service information",
"tags": ["aws", "documentation", "cloud", "knowledge"],
"category": "documentation",
"command": "uvx",
"args": ["fastmcp", "run", "https://knowledge-mcp.global.api.aws"]
},
"microsoft.docs.mcp": {
"description": "Microsoft Learn documentation and Azure documentation access",
"tags": ["microsoft", "azure", "documentation", "learn"],
"category": "documentation",
"command": "uvx",
"args": ["fastmcp", "run", "https://learn.microsoft.com/api/mcp"]
}
}
}
Configuration Fields
description: Human-readable description of the servertags: List of tags for filtering (e.g.,["aws", "database"])category: Server category (e.g.,"database","documentation")command: Command to start the MCP serverargs: Arguments for the commandenv: Optional environment variables (supports${VAR_NAME}expansion)
Usage
Running the Server
Run the MCP proxy server:
uvx mcp-dynamic-proxy
Or with custom config path:
MCP_CONFIG_PATH=/path/to/config.json uvx mcp-dynamic-proxy
Configuration for Cursor
Add to your Cursor MCP configuration:
{
"mcpServers": {
"mcp-dynamic-proxy": {
"command": "uvx",
"args": ["mcp-dynamic-proxy"],
"env": {
"MCP_CONFIG_PATH": "/path/to/config/mcp.json"
}
}
}
}
Example Workflow
-
Discover servers:
User: "Show me database servers" Assistant calls: mcp_discover_servers(tags=["database"]) Response: List of database MCP servers -
List tools:
Assistant calls: mcp_list_tools(server_id="aws-dynamodb") Response: List of available tools (query, scan, put_item, etc.) -
Execute tool:
Assistant calls: mcp_execute_tool( server_id="aws-dynamodb", tool_name="query", arguments={"table": "users", "key": {"id": "123"}} ) Response: Tool execution result
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_dynamic_proxy-0.1.3.tar.gz.
File metadata
- Download URL: mcp_dynamic_proxy-0.1.3.tar.gz
- Upload date:
- Size: 40.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb4914f2d14d8b2111d0550a40a26686e7b3c4d8de94766745b3f92b9b54ec3b
|
|
| MD5 |
a2974bf70b251822e6f5ecbf3205308a
|
|
| BLAKE2b-256 |
3503aacbced632a04d798ea9e1dd727268cca647fa5bb24b9dc541ce4d74764d
|
File details
Details for the file mcp_dynamic_proxy-0.1.3-py3-none-any.whl.
File metadata
- Download URL: mcp_dynamic_proxy-0.1.3-py3-none-any.whl
- Upload date:
- Size: 37.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7df425b57e4dfb4ec8716b05e337c4b919e1479ab502e6028b631f5742c5176d
|
|
| MD5 |
17b169f1053dfc1c3e1895d4ba690aae
|
|
| BLAKE2b-256 |
a2407cae8817221da74b42a3850e56f79fa309c79c0ccf4740868a09a757fa60
|