DEV Community

Cover image for No Dockerfile? No problem! Running Node and Python MCPs with ToolHive
Juan Antonio Osorio for Stacklok

Posted on

No Dockerfile? No problem! Running Node and Python MCPs with ToolHive

Containerizing your MCP server is great—until it isn’t. Maybe you're moving fast, testing a new idea, or you just don’t want to write a Dockerfile. We’ve been there.

That’s why ToolHive now supports running MCP servers powered by npm or uv, without needing them to be containerized up front.

ToolHive will now dynamically build a container image for you based on the MCP reference. That means:

  • No Dockerfile.

  • No need to install uv or npm on your system.

  • Just write your code and run.

How it works

We’ve added support for special transport-prefixed references to MCP servers:

  • For Node.js projects:
thv run npx://my-cool-server
Enter fullscreen mode Exit fullscreen mode
  • For Python projects using uv:
thv run uvx://my-python-server
Enter fullscreen mode Exit fullscreen mode

When ToolHive sees one of these prefixes (npx:// or uvx://), it knows to:

  1. Build a container image dynamically behind the scenes

  2. Include the appropriate runtime (Node.js or Python + uv)

  3. Execute your server just like any other MCP—no container authoring required

This all happens without you needing to install npm, npx, or uv on your local machine.

Why this matters

This feature is a huge win for:

  • Quick iterations: Skip the Dockerfile and get straight to testing.

  • Lightweight environments: Don’t want to install runtime tools globally? No problem.

  • Clean CI/CD pipelines: ToolHive encapsulates the runtime without polluting your environment.

It’s never been easier to run an MCP server with ToolHive, even if all you’ve got is a main.py or index.js.

Behind the magic

Under the hood, ToolHive builds a container image on-the-fly using the MCP reference you pass in. It wraps your package with the right runtime environment and proxies traffic into it, just like any other server launched through ToolHive.

This means you get all the benefits of the ToolHive runtime—clean shutdown, traffic proxying, process supervision—without needing to containerize anything yourself.

Get started

Just run:

thv run npx://<your-npm-package>
Enter fullscreen mode Exit fullscreen mode

or

thv run uvx://<your-python-package>
Enter fullscreen mode Exit fullscreen mode

ToolHive will take it from there.

E.g. If you’re interested in running the Playwright MCP, simply do:

thv run npx://@playwright/mcp@latest
Enter fullscreen mode Exit fullscreen mode

For more details, check out the README .

Try it out and join the fun!

We're excited to keep making ToolHive easier to use, especially for devs who want to focus on building—not on container plumbing. Got feedback or ideas? Open an issue or talk to us on Discord. We’d love to hear from you.

Happy hacking 🐝

Top comments (0)