mcpField
M
MCP-Compose-Proxy-Shim

MCP-Compose-Proxy-Shim

Local
github.com/phildoughertyDeveloper Tools3Updated 77w ago

About MCP-Compose-Proxy-Shim

A Node.js bridge for connecting local MCP clients such as Claude Desktop to MCP-Compose servers running in Docker. It forwards local protocol requests through the MCP-Compose proxy to the containerized servers.

Key features

  1. 01Bridge local clients to remote servers
  2. 02Forward requests through MCP-Compose proxy
  3. 03Support API-key authentication
  4. 04Configure caching, retries, and logging
  5. 05Apply path and request-size limits

Use cases

  1. 01Use Docker-hosted servers from Claude Desktop
  2. 02Connect local clients to an MCP-Compose proxy
  3. 03Inspect forwarded requests with debug logs

MCP support

The shim presents a local MCP server interface to clients and forwards requests to the MCP-Compose proxy, which communicates with the Docker-hosted MCP servers.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

MCP-Compose-Proxy-Shim

A bridge that connects local LLM clients (such as Claude Desktop) to remote MCP-Compose servers running in Docker containers.

🚀 Overview

MCP-Compose-Proxy-Shim allows you to use containerized MCP servers with LLM clients that expect to run MCP servers locally. It acts as a transparent bridge, intercepting local MCP server calls and redirecting them to a remote MCP-Compose proxy.

Key benefits:

  • Use Claude Desktop with MCP servers running in Docker containers
  • Avoid limitations and costs of paid remote MCP servers
  • Leverage all the power and flexibility of Docker-based MCP servers
  • Works with filesystem, memory, weather and other MCP servers

This project is designed to integrate with MCP-Compose, a tool for running Model Context Protocol (MCP) servers in Docker containers.

📋 Requirements

  • Node.js v14 or later
  • Claude Desktop or another MCP-compatible LLM client
  • MCP-Compose running with a proxy (see MCP-Compose)

🔧 Installation

  1. Clone this repository:

    git clone https://github.com/phildougherty/mcp-compose-proxy-shim.git
    cd mcp-compose-proxy-shim
    
  2. Install dependencies:

    npm install
    
  3. Make scripts executable:

    chmod +x bin/npx lib/mcp-shim.js
    

🔌 Configuration

Claude Desktop Configuration

Since the "Import Servers" feature requires a Claude Max plan, you need to manually edit Claude's configuration file:

  1. Locate Claude Desktop's configuration directory:

    • macOS: ~/Library/Application Support/Claude
    • Windows: %APPDATA%\Claude
    • Linux: ~/.config/Claude
  2. Create or edit the MCP servers configuration file:

    • Create a file called claude_desktop_config.json in the configuration directory
    • Add the following content (adjust paths to your environment):
{
  "mcpServers": {
    "filesystem": {
      "command": "/absolute/path/to/mcp-compose-proxy-shim/bin/npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "/Users/phildougherty/Documents",
        "/Users/phildougherty/Downloads"
      ]
    },
    "memory": {
      "command": "/absolute/path/to/mcp-compose-proxy-shim/bin/npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-memory"
      ]
    }
  }
}
  1. Important: Restart Claude Desktop after editing the configuration file.

🚀 Usage

Set Up MCP-Compose First
  1. First, make sure MCP-Compose is installed and running:

    cd /path/to/mcp-compose
    ./mcp-compose up
    ./mcp-compose proxy
    

    This starts the MCP servers in Docker containers and the proxy on port 9876.

Environment Variables

Before running Claude Desktop, set these environment variables:

VariableDescriptionDefault
MCP_PROXY_URLURL of the MCP-Compose proxyhttp://localhost:9876
MCP_API_KEYAPI key for authentication""
MCP_DEBUGEnable debug outputfalse
MCP_LOG_LEVELLog level (trace, debug, info, warn, error)info
MCP_CACHEEnable response cachingtrue
MCP_CACHE_TTL_MSCache TTL in milliseconds300000 (5 min)
MCP_MAX_RETRIESMaximum retry attempts3
MCP_LOG_FILEEnable logging to filefalse

🔍 How It Works

  1. The bin/npx script intercepts calls to MCP servers that Claude would normally make locally
  2. Instead of running the actual server, it starts our lib/mcp-shim.js script
  3. The shim communicates with Claude via stdin/stdout as expected
  4. Behind the scenes, it forwards all requests to your MCP-Compose proxy
  5. The proxy handles the actual communication with Docker containers
  6. Results flow back through the proxy to the shim and then to Claude

📝 Logging

Logs are written to:

  • Console (stderr) when MCP_DEBUG=true
  • File at /tmp/mcp-shim-[server].log when MCP_LOG_FILE=true

🔒 Security Features

  • Path sanitization to prevent directory traversal
  • Rate limiting to prevent abuse
  • Request size limiting
  • Authentication via API keys
  • Secure error handling

📚 Related Projects

🤝 Contributing

Contributions are welcome! Please feel free to submit a pull request.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.