Skip to main content

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:

  1. mcp_discover_servers - Discover available MCP servers
  2. mcp_list_tools - List tools from a specific MCP server
  3. mcp_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 server
  • tags: List of tags for filtering (e.g., ["aws", "database"])
  • category: Server category (e.g., "database", "documentation")
  • command: Command to start the MCP server
  • args: Arguments for the command
  • env: 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

  1. Discover servers:

    User: "Show me database servers"
    
    Assistant calls: mcp_discover_servers(tags=["database"])
    
    Response: List of database MCP servers
    
  2. List tools:

    Assistant calls: mcp_list_tools(server_id="aws-dynamodb")
    
    Response: List of available tools (query, scan, put_item, etc.)
    
  3. 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

mcp_dynamic_proxy-0.1.2.tar.gz (39.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_dynamic_proxy-0.1.2-py3-none-any.whl (36.3 kB view details)

Uploaded Python 3

File details

Details for the file mcp_dynamic_proxy-0.1.2.tar.gz.

File metadata

  • Download URL: mcp_dynamic_proxy-0.1.2.tar.gz
  • Upload date:
  • Size: 39.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for mcp_dynamic_proxy-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5cbd98e998ec5134fd2fc6b7c21099e9618930053fb86c406fecad2b3c37e301
MD5 b4b8379391fd0788148361c58f8fceb3
BLAKE2b-256 fe3cdeaa090a2e0f1902e67095d03664e69a678d853f3f2ce533524265bf262e

See more details on using hashes here.

File details

Details for the file mcp_dynamic_proxy-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_dynamic_proxy-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 db6605f07238b456ac9c711f1ab298dea0cfc3805159016e9d22e6e7d9d49c88
MD5 c9db651b61bf2854e29cda8d52c2f27e
BLAKE2b-256 8545486ffa706a282624cc87d3bf789ab06ea86ef6e371361af945f33c25b287

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page