Skip to content

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

Closed as not planned

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
    }
}

Activity

  1. davidthing commented on Jul 18, 2025

    @davidthing

    I suspect that --config doesn't work for "type": "streamable-http". It also doesn't work for "sse": #415.

  2. wbste commented on Jul 18, 2025

    @wbste
    Author

    I suspect that --config doesn't work for "type": "streamable-http". It also doesn't work for "sse": #415.

    Have since changed and it's working fine with regular npx, I still can't get it to work with a containerized version of inspector. For now just passing the arguments in the url, but would love a cleaner method.

  3. olaservo commented on Nov 11, 2025

    @olaservo
    Member

    Closing as not planned and labeling with v2 in case we want to review for next version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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