[GH-ISSUE #18] Stuck on "Waiting for application startup" #15

Closed
opened 2026-10-18 21:10:16 +00:00 by bsakaguchi · 6 comments
Owner

Originally created by @Dawaner on GitHub (Apr 2, 2025).
Original GitHub issue: https://github.com/open-webui/mcpo/issues/18

install any package, like:

uv add pymysql

main.py

import pymysql
from mcp.server.fastmcp import FastMCP

mcp = FastMCP("mcp_server")

run shell

uvx mcpo --host localhost --port 8000 -- mcp run main.py

Stuck on "Waiting for application startup"

Image

comment import package, then run shell

Image

Originally created by @Dawaner on GitHub (Apr 2, 2025). Original GitHub issue: https://github.com/open-webui/mcpo/issues/18 **install any package, like:** ```shell uv add pymysql ``` **main.py** ```python import pymysql from mcp.server.fastmcp import FastMCP mcp = FastMCP("mcp_server") ``` **run shell** ```shell uvx mcpo --host localhost --port 8000 -- mcp run main.py ``` **Stuck on "Waiting for application startup"** ![Image](https://github.com/user-attachments/assets/56cfc016-5677-45b3-a6c4-2d4517e43614) **comment import package, then run shell** ![Image](https://github.com/user-attachments/assets/511dfe51-44a7-4e28-be6f-1b7374054a29)
Author
Owner

@Dawaner commented on GitHub (Apr 3, 2025):

I have found the solution, but I don't know what caused it

  1. copy source code
async def init():
    await mcpo.run(server_command=["mcp", "run", "main.py"])

if __name__ == "__main__":
    asyncio.run(init())
  1. run
<!-- gh-comment-id:2774787204 --> @Dawaner commented on GitHub (Apr 3, 2025): I have found the solution, but I don't know what caused it 1. copy source code 2. ```python async def init(): await mcpo.run(server_command=["mcp", "run", "main.py"]) if __name__ == "__main__": asyncio.run(init()) ``` 3. run
Author
Owner

@Dawaner commented on GitHub (Apr 3, 2025):

Additionally, the following methods are also feasible

pip install mcpo
mcpo --port 8000 --api-key "top-secret" -- your_mcp_server_command

only error on uvx

<!-- gh-comment-id:2774835375 --> @Dawaner commented on GitHub (Apr 3, 2025): Additionally, the following methods are also feasible ```shell pip install mcpo mcpo --port 8000 --api-key "top-secret" -- your_mcp_server_command ``` **only error on uvx**
Author
Owner

@trufae commented on GitHub (Apr 9, 2025):

Same error here. mcpo works fine with a shellscript mcp server. but any plain C server just hangs forever

<!-- gh-comment-id:2788145641 --> @trufae commented on GitHub (Apr 9, 2025): Same error here. mcpo works fine with a shellscript mcp server. but any plain C server just hangs forever
Author
Owner

@okineadev commented on GitHub (Apr 10, 2025):

Same

<!-- gh-comment-id:2792043160 --> @okineadev commented on GitHub (Apr 10, 2025): Same
Author
Owner

@trufae commented on GitHub (Apr 10, 2025):

After some try and error i end up finding out that mcpo is quite tricky in the way that it comunicates with the mcp servers. this is, sending the json to stdin in random size chunks instead of a single write, performing some requests and expect no answer from them, as well as being way more strict than Claude, what i find it easier to debug this was to use this bash script for testing https://dev.to/antonum/minimalistic-mcp-server-in-bash-script-10k5

This patch contains all the changes i had to do to my r2mcp server written in C to make it work with mcpo github.com/radareorg/radare2-mcp@33b7f61110

<!-- gh-comment-id:2792066330 --> @trufae commented on GitHub (Apr 10, 2025): After some try and error i end up finding out that mcpo is quite tricky in the way that it comunicates with the mcp servers. this is, sending the json to stdin in random size chunks instead of a single write, performing some requests and expect no answer from them, as well as being way more strict than Claude, what i find it easier to debug this was to use this bash script for testing https://dev.to/antonum/minimalistic-mcp-server-in-bash-script-10k5 This patch contains all the changes i had to do to my r2mcp server written in C to make it work with mcpo https://github.com/radareorg/radare2-mcp/commit/33b7f61110aef868c2d3ac6bed101def09af1800
Author
Owner

@okineadev commented on GitHub (Apr 10, 2025):

UPD: I figured out what my problem was

I wanted to run my tool:

uvx mcpo --port 8000 -- bunx @some/tool

And here it hung

Then I tried running the tool with pnpx:

uvx mcpo --port 8000 -- pnpx @some/tool

And it worked!

I don't even know why, it doesn't work with bunx, but pnpx does

<!-- gh-comment-id:2792208125 --> @okineadev commented on GitHub (Apr 10, 2025): **UPD**: I figured out what my problem was I wanted to run my tool: ```bash uvx mcpo --port 8000 -- bunx @some/tool ``` And here it hung Then I tried running the tool with `pnpx`: ```bash uvx mcpo --port 8000 -- pnpx @some/tool ``` And it worked! I don't even know why, it doesn't work with `bunx`, but `pnpx` does
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#15
No description provided.