inspector icon indicating copy to clipboard operation
inspector copied to clipboard

Example usage with dockerised servers

Open alex-hh opened this issue 8 months ago • 1 comments

Hi, I'm just getting started with this tool. Is it possible to use it to interact with e.g. dockerised mcp servers like the https://github.com/github/github-mcp-server in addition to servers under development? If so I'd find it useful to see examples of this usage!

alex-hh avatar Apr 24 '25 21:04 alex-hh

Hi @alex-hh , yes you can use Inspector with MCP servers that run using Docker. You just need to use docker as the command and then pass everything after that as args.

Here's one way to do this using a config file with Inspector (which can be more user-friendly than needing to paste in the command and args):

Example config file:

{
  "mcpServers": {
    "github": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "GITHUB_PERSONAL_ACCESS_TOKEN",
        "ghcr.io/github/github-mcp-server"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "your_token_here"
      }
    }
  }
}

Then you can specify the config file and server like this, in order to start Inspector with that configuration:

npx @modelcontextprotocol/inspector@latest --config config.json --server github

After that, Inspector should start and both the command plus args should be populated with the correct commands so you can click the Connect button.

Here's a screenshot of what it looks like after using this config, clicking Connect, and then listing tools from the Github server:

Image

This should also work with any other optional args mentioned in the GithHub MCP server readme, although personally I haven't tested those other options with Inspector yet. Let me know how it goes.

olaservo avatar May 03 '25 23:05 olaservo

@claude lets update the Readme to include an example of using MCP inspector with a Dockerized server, as mentioned in this issue and comments.

olaservo avatar Aug 18 '25 13:08 olaservo

Claude finished @olaservo's task —— View jobclaude/issue-349-20250818-1329Create PR ➔


Updating README with Docker usage example ✅

Successfully added Docker usage documentation to the README based on the example provided in this issue.

Todo List:

  • [x] Read the current README file to understand structure
  • [x] Identify the best location for Docker documentation
  • [x] Add new section with Docker usage example
  • [x] ~~Run build/lint commands to verify changes~~ (Build commands require approval - skipped)
  • [x] Commit and push changes
  • [x] Provide PR creation link

Summary of Changes

Added a new section "Using with Docker containers" to the README that includes:

  1. Command-line approach: Direct usage with docker as the command
  2. Configuration file approach: More comprehensive setup using config files with environment variables
  3. Complete example: Based on the GitHub MCP server example from this issue's discussion

The documentation shows users how to:

  • Use Inspector with dockerized MCP servers directly from command line
  • Create configuration files for complex Docker setups
  • Pass environment variables securely
  • Manage multiple dockerized servers

claude[bot] avatar Aug 18 '25 13:08 claude[bot]

@claude lets keep it simple and minimal and just include something like the below section you added to the Readme, but not all the other stuff:

To connect to a dockerized MCP server directly from the command line, use docker as the command and pass the container arguments:

npx @modelcontextprotocol/inspector docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-server

olaservo avatar Aug 18 '25 14:08 olaservo

Claude finished @olaservo's task —— View jobclaude/issue-349-20250818-1413Create PR ➔


Simplifying Docker documentation ✅

Successfully added the minimal Docker usage example to the README as requested.

Todo List:

  • [x] Read current README to locate Docker documentation
  • [x] Add minimal Docker example to README
  • [x] Commit and push changes
  • [x] Provide PR creation link

Summary of Changes

Added a simple "Using with Docker containers" section to the README that shows exactly what was requested:

  • Basic command-line usage with docker as the command
  • Example using the GitHub MCP server container
  • Minimal and focused documentation

The section is placed after the basic usage examples and before the "Servers File Export" section for logical flow.

claude/issue-349-20250818-1413

claude[bot] avatar Aug 18 '25 14:08 claude[bot]