[GH-ISSUE #172] issue: Unable to use docker command as the server command when running mcpo as a container #78

Closed
opened 2026-10-18 21:11:24 +00:00 by bsakaguchi · 4 comments
Owner

Originally created by @jtabox on GitHub (Jun 5, 2025).
Original GitHub issue: https://github.com/open-webui/mcpo/issues/172

Check Existing Issues

  • I have searched the existing issues and discussions.
  • I am using the latest version of mcpo.

mcpo Version

no clue where i can see that. the version you get when you run docker run ghcr.io/open-webui/mcpo:main

Open WebUI Version (if applicable)

No response

Operating System

Windows 11 Pro - Build 10.0.26100.4202

Browser (if applicable)

No response

Confirmation

  • I have read and followed all instructions in README.md.
  • I am using the latest version of both MCPO and Open WebUI.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have listed steps to reproduce the bug in detail.

Expected Behavior

To be able to use Docker MCP Toolkit with MCPO by running the following command:

docker run -p 8000:8000 ghcr.io/open-webui/mcpo:main --api-key "whatever" -- docker mcp gateway run

Actual Behavior

It didn't work. Threw a FileNotFound error and exited.

Steps to Reproduce

  1. Run the Docker version of mcpo and use Docker MCP Toolkit's command as the server command

Logs & Screenshots

❯ docker run -p 8000:8000 ghcr.io/open-webui/mcpo:main --api-key "whatever" -- docker mcp gateway run

Unable to find image 'ghcr.io/open-webui/mcpo:main' locally
main: Pulling from open-webui/mcpo
4f4fb700ef54: Pull complete
01a0dc88bbdb: Pull complete
f17c1e9d2ed5: Pull complete
e3c6f8fcdc44: Pull complete
6564b7366bd3: Pull complete
e70bd8d6005c: Pull complete
0c2a5709b400: Pull complete
3d97007bfc7f: Pull complete
2d7411f6611b: Pull complete
29a6a1d2278a: Pull complete
a3d5ed709dd6: Pull complete
Digest: sha256:d3d8838e7c5480e129db37b25ea20d0ed052eb52ff900d1efc9d66b16bef58ec
Status: Downloaded newer image for ghcr.io/open-webui/mcpo:main
2025-06-05 22:41:51,672 - INFO - Starting MCPO Server...
2025-06-05 22:41:51,672 - INFO -   Name: MCP OpenAPI Proxy
2025-06-05 22:41:51,672 - INFO -   Version: 1.0
2025-06-05 22:41:51,672 - INFO -   Description: Automatically generated API from MCP Tool Schemas
2025-06-05 22:41:51,672 - INFO -   Hostname: db438189239e
2025-06-05 22:41:51,672 - INFO -   Port: 8000
2025-06-05 22:41:51,672 - INFO -   API Key: Provided
2025-06-05 22:41:51,672 - INFO -   CORS Allowed Origins: ['*']
2025-06-05 22:41:51,672 - INFO -   Path Prefix: /
2025-06-05 22:41:51,673 - INFO - Configuring for a single Stdio MCP Server with command: docker mcp gateway run
2025-06-05 22:41:51,673 - INFO - Uvicorn server starting...
INFO:     Started server process [1]
INFO:     Waiting for application startup.
ERROR:    Traceback (most recent call last):
  File "/app/.venv/lib/python3.11/site-packages/starlette/routing.py", line 692, in lifespan
    async with self.lifespan_context(app) as maybe_state:
  File "/usr/lib/python3.11/contextlib.py", line 204, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/mcpo/main.py", line 109, in lifespan
    async with stdio_client(server_params) as (reader, writer):
  File "/usr/lib/python3.11/contextlib.py", line 204, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/mcp/client/stdio/__init__.py", line 114, in stdio_client
    process = await _create_platform_compatible_process(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/mcp/client/stdio/__init__.py", line 216, in _create_platform_compatible_process
    process = await anyio.open_process(
              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/anyio/_core/_subprocesses.py", line 190, in open_process
    return await get_async_backend().open_process(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2561, in open_process
    process = await asyncio.create_subprocess_exec(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/subprocess.py", line 218, in create_subprocess_exec
    transport, protocol = await loop.subprocess_exec(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 1694, in subprocess_exec
    transport = await self._make_subprocess_transport(
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/unix_events.py", line 207, in _make_subprocess_transport
    transp = _UnixSubprocessTransport(self, protocol, args, shell,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_subprocess.py", line 36, in __init__
    self._start(args=args, shell=shell, stdin=stdin, stdout=stdout,
  File "/usr/lib/python3.11/asyncio/unix_events.py", line 810, in _start
    self._proc = subprocess.Popen(
                 ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 1024, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.11/subprocess.py", line 1901, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'docker'

ERROR:    Application startup failed. Exiting.
Starting MCP OpenAPI Proxy on 0.0.0.0:8000 with command: docker mcp gateway run

Additional Information

No response

Originally created by @jtabox on GitHub (Jun 5, 2025). Original GitHub issue: https://github.com/open-webui/mcpo/issues/172 ### Check Existing Issues - [x] I have searched the existing issues and discussions. - [x] I am using the latest version of mcpo. ### mcpo Version no clue where i can see that. the version you get when you run docker run ghcr.io/open-webui/mcpo:main ### Open WebUI Version (if applicable) _No response_ ### Operating System Windows 11 Pro - Build 10.0.26100.4202 ### Browser (if applicable) _No response_ ### Confirmation - [x] I have read and followed all instructions in `README.md`. - [x] I am using the latest version of **both** MCPO and Open WebUI. - [x] I have included the browser console logs. - [x] I have included the Docker container logs. - [x] I have listed steps to reproduce the bug in detail. ### Expected Behavior To be able to use Docker MCP Toolkit with MCPO by running the following command: ```shell docker run -p 8000:8000 ghcr.io/open-webui/mcpo:main --api-key "whatever" -- docker mcp gateway run ``` ### Actual Behavior It didn't work. Threw a FileNotFound error and exited. ### Steps to Reproduce 1. Run the Docker version of mcpo and use Docker MCP Toolkit's command as the server command ### Logs & Screenshots ```python ❯ docker run -p 8000:8000 ghcr.io/open-webui/mcpo:main --api-key "whatever" -- docker mcp gateway run Unable to find image 'ghcr.io/open-webui/mcpo:main' locally main: Pulling from open-webui/mcpo 4f4fb700ef54: Pull complete 01a0dc88bbdb: Pull complete f17c1e9d2ed5: Pull complete e3c6f8fcdc44: Pull complete 6564b7366bd3: Pull complete e70bd8d6005c: Pull complete 0c2a5709b400: Pull complete 3d97007bfc7f: Pull complete 2d7411f6611b: Pull complete 29a6a1d2278a: Pull complete a3d5ed709dd6: Pull complete Digest: sha256:d3d8838e7c5480e129db37b25ea20d0ed052eb52ff900d1efc9d66b16bef58ec Status: Downloaded newer image for ghcr.io/open-webui/mcpo:main 2025-06-05 22:41:51,672 - INFO - Starting MCPO Server... 2025-06-05 22:41:51,672 - INFO - Name: MCP OpenAPI Proxy 2025-06-05 22:41:51,672 - INFO - Version: 1.0 2025-06-05 22:41:51,672 - INFO - Description: Automatically generated API from MCP Tool Schemas 2025-06-05 22:41:51,672 - INFO - Hostname: db438189239e 2025-06-05 22:41:51,672 - INFO - Port: 8000 2025-06-05 22:41:51,672 - INFO - API Key: Provided 2025-06-05 22:41:51,672 - INFO - CORS Allowed Origins: ['*'] 2025-06-05 22:41:51,672 - INFO - Path Prefix: / 2025-06-05 22:41:51,673 - INFO - Configuring for a single Stdio MCP Server with command: docker mcp gateway run 2025-06-05 22:41:51,673 - INFO - Uvicorn server starting... INFO: Started server process [1] INFO: Waiting for application startup. ERROR: Traceback (most recent call last): File "/app/.venv/lib/python3.11/site-packages/starlette/routing.py", line 692, in lifespan async with self.lifespan_context(app) as maybe_state: File "/usr/lib/python3.11/contextlib.py", line 204, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/app/.venv/lib/python3.11/site-packages/mcpo/main.py", line 109, in lifespan async with stdio_client(server_params) as (reader, writer): File "/usr/lib/python3.11/contextlib.py", line 204, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/app/.venv/lib/python3.11/site-packages/mcp/client/stdio/__init__.py", line 114, in stdio_client process = await _create_platform_compatible_process( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/.venv/lib/python3.11/site-packages/mcp/client/stdio/__init__.py", line 216, in _create_platform_compatible_process process = await anyio.open_process( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/.venv/lib/python3.11/site-packages/anyio/_core/_subprocesses.py", line 190, in open_process return await get_async_backend().open_process( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/.venv/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2561, in open_process process = await asyncio.create_subprocess_exec( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/asyncio/subprocess.py", line 218, in create_subprocess_exec transport, protocol = await loop.subprocess_exec( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/asyncio/base_events.py", line 1694, in subprocess_exec transport = await self._make_subprocess_transport( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/asyncio/unix_events.py", line 207, in _make_subprocess_transport transp = _UnixSubprocessTransport(self, protocol, args, shell, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/asyncio/base_subprocess.py", line 36, in __init__ self._start(args=args, shell=shell, stdin=stdin, stdout=stdout, File "/usr/lib/python3.11/asyncio/unix_events.py", line 810, in _start self._proc = subprocess.Popen( ^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/subprocess.py", line 1024, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/lib/python3.11/subprocess.py", line 1901, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'docker' ERROR: Application startup failed. Exiting. Starting MCP OpenAPI Proxy on 0.0.0.0:8000 with command: docker mcp gateway run ``` ### Additional Information _No response_
bsakaguchi 2026-10-18 21:11:24 +00:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@tjbck commented on GitHub (Jun 6, 2025):

You should build your own custom docker image for this.

<!-- gh-comment-id:2949899504 --> @tjbck commented on GitHub (Jun 6, 2025): You should build your own custom docker image for this.
Author
Owner

@jtabox commented on GitHub (Jun 7, 2025):

So it's not possible with mcpo? What's with the passive aggressive reply, I just asked a question.

<!-- gh-comment-id:2952591239 --> @jtabox commented on GitHub (Jun 7, 2025): So it's not possible with mcpo? What's with the passive aggressive reply, I just asked a question.
Author
Owner

@hipur commented on GitHub (Jun 18, 2025):

It is possible with a little workaround.

You need create your own image based on the current and install docker-cli or edit the current entrypoint to install docker-cli (and run mcpo after). Also make sure to mount - /var/run/docker.sock:/var/run/docker.sock as a volume on mcpo container. This will make mcpo create the needed container on the same host it runs on whenever needed.

<!-- gh-comment-id:2985932755 --> @hipur commented on GitHub (Jun 18, 2025): It is possible with a little workaround. You need create your own image based on the current and install docker-cli or edit the current entrypoint to install docker-cli (and run mcpo after). Also make sure to mount `- /var/run/docker.sock:/var/run/docker.sock` as a volume on mcpo container. This will make mcpo create the needed container on the same host it runs on whenever needed.
Author
Owner

@jtabox commented on GitHub (Jun 19, 2025):

It is possible with a little workaround.

You need create your own image based on the current and install docker-cli or edit the current entrypoint to install docker-cli (and run mcpo after). Also make sure to mount - /var/run/docker.sock:/var/run/docker.sock as a volume on mcpo container. This will make mcpo create the needed container on the same host it runs on whenever needed.

Thanks for the reply.

When you say create your own image, is it mcpo's image you're referring to, or the MCP server's image?

If it's mcpo's image, it's like Docker-in-Docker or whatever it's called, right? And mount the socket file in the mcpo container so it can control its host's Docker too? Haven't spent much time at all with Docker-in-Docker configurations, but I can give it a try, thanks for the tip :D

<!-- gh-comment-id:2988605198 --> @jtabox commented on GitHub (Jun 19, 2025): > It is possible with a little workaround. > > You need create your own image based on the current and install docker-cli or edit the current entrypoint to install docker-cli (and run mcpo after). Also make sure to mount `- /var/run/docker.sock:/var/run/docker.sock` as a volume on mcpo container. This will make mcpo create the needed container on the same host it runs on whenever needed. Thanks for the reply. When you say create your own image, is it mcpo's image you're referring to, or the MCP server's image? If it's mcpo's image, it's like Docker-in-Docker or whatever it's called, right? And mount the socket file in the mcpo container so it can control its host's Docker too? Haven't spent much time at all with Docker-in-Docker configurations, but I can give it a try, thanks for the tip :D
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
open-webui/mcpo#78
No description provided.