Skip to content

Unable to pass config.json to container-ized server. #622

@wbste

Description

@wbste

How do I correctly pass the config file to the prebuilt container? I tried various ways and none worked. Alternatively would love to have a env MCP_PROXY_FULL_ADDRESS that I can define in my compose.

  • Added - CONFIG_PATH=/app/config.json
  • Added command: ["npx", "@modelcontextprotocol/inspector", "--config", "/app/config.json"]
services:
  mcp-inspect:
    ports:
      - 127.0.0.1:3008:6274 # client ui
      - 127.0.0.1:3009:6277 # mcp server proxy
    container_name: mcp-inspect
    environment:
      - ALLOWED_ORIGINS=https://inspect.mydomain.com,http://127.0.0.1:3008
      - CLIENT_PORT=6274
      - SERVER_PORT=6277
      - HOST=0.0.0.0
      - DANGEROUSLY_OMIT_AUTH=true
      - MCP_AUTO_OPEN_ENABLED=false
    image: ghcr.io/modelcontextprotocol/inspector:latest
    restart: unless-stopped
    volumes:
      - ./config.json:/app/config.json

Here's my caddyserver caddyfile in case anyone runs across it. Only testing streamable http at the moment...

*.mydomain.com {
    tls ...
    }

    @inspect host inspect.mydomain.com
    handle @inspect {
        handle /config* {
            reverse_proxy localhost:3009
        }
        handle /health* {
            reverse_proxy localhost:3009
        }
        handle /mcp {
            reverse_proxy localhost:3009
        }
        handle {
            reverse_proxy localhost:3008
        }
    }

config.json

{
    "mcpServers": {
        "default-server": {
            "type": "streamable-http",
            "url": "https://mcp.mydomain.com/mcp",
            "note": "For Streamable HTTP connections, add this URL directly in your MCP Client"
        }
    },
    "MCP_PROXY_FULL_ADDRESS": {
        "label": "Inspector Proxy Address",
        "description": "Set this if you are running the MCP Inspector Proxy on a non-default address. Example: http://10.1.1.22:5577",
        "value": "https://inspect.mydomain.com",
        "is_session_item": false
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions