npm, PyPI, OCI, or remote: choosing how to ship your MCP server.
Each distribution format trades install friction against control. Only one of them can charge agents per call — here's how to pick, and why shipping two formats is often right.
An MCP server is just a program speaking JSON-RPC, so it can ship as an npm package, a PyPI package, an OCI image, a NuGet package, an MCPB bundle, or not ship at all — running instead as a remote endpoint that clients reach by URL.
The format you choose decides who can run your server, how painful setup is, what you can observe, and whether you can charge for it. Most of those trade-offs are invisible until users start filing setup issues, so it's worth choosing deliberately.
Local packages: npm and PyPI
npm is the default for TypeScript servers because every MCP client can spawn npx, and most developer machines already have Node. PyPI plus uvx gives Python servers nearly the same one-line install, with uv resolving dependencies into an isolated environment. Both formats run on the user's machine, with the user's filesystem and the user's API keys — which is exactly right for tools that need local access.
The cost is that you've shipped your code into environments you can't see. Version skew, OS quirks, and missing runtimes become your issue queue, and you have no usage telemetry unless you build it.
# npm — runs anywhere Node is installed
npx -y @acme/mcp-server
# PyPI — uvx resolves into an isolated env
uvx acme-mcp-server
# OCI — pinned and hermetic, needs Docker
docker run -i --rm ghcr.io/acme/mcp-server:1.4.2
# Remote — nothing to install, clients connect by URL
# https://mcp.acme.dev/mcpOCI, NuGet, and MCPB
An OCI image is the answer when your server has system dependencies a package manager can't express — headless Chrome, ffmpeg, a specific libc. The image is hermetic and version-pinned, but you've added Docker as a hard requirement, which rules out a surprising share of desktop users. NuGet serves the .NET ecosystem the way npm serves Node; reach for it only if your audience lives there.
MCPB (MCP Bundle) packages a server into a single file a desktop client can install with a double-click. It's the lowest-friction local format for non-developer users, at the cost of being supported by fewer clients than plain npm.
Remote endpoints: the format that can take payment
A remote server over Streamable HTTP inverts every trade-off above. Users install nothing; you operate everything. You control the version, see every request, and fix bugs once — and because each tool call is an HTTP request to your infrastructure, it can be gated with x402. The agent receives a 402 with a price, pays in USDC, settlement clears on Base in about two seconds, and your handler runs.
No local format can do this: code running on the user's machine has no payment gate you control. If monetization is anywhere on your roadmap, a remote endpoint isn't optional — it's the product.
A decision rule, and why two formats beat one
Needs the user's filesystem or local credentials: npm or PyPI, matching your implementation language. Heavy system dependencies: OCI. Targeting non-technical desktop users: MCPB. Want zero-install reach, observability, or revenue: remote.
The strongest setups ship a free local package and a paid remote endpoint from the same codebase. Self-hosters use the package; agents that want a working URL pay per call — $0.01 minimum on Loomal — for the hosted one. The official MCP registry supports declaring both packages and remotes on a single server entry, so clients and indexes see the full picture.
FAQ
Can I publish the same MCP server in multiple formats?
Yes, and the official registry is built for it — a single server.json entry can declare npm, PyPI, and OCI packages alongside a remote endpoint. Clients pick the format they support, and you maintain one codebase behind all of them.
Which format do MCP clients support most widely?
npm via npx is the safest bet for local servers — effectively every desktop MCP client can spawn it. Remote Streamable HTTP support is now standard in major clients too. Docker and MCPB support varies more, so check your target clients before committing.
Why can't I charge for an npm or PyPI package per call?
Because the code executes on the user's machine, there's no request passing through infrastructure you control — nothing to gate. x402 works by returning HTTP 402 from your endpoint and running the handler only after USDC payment settles, which requires the server to be yours.
Does my distribution format affect my Loomal listing?
Loomal indexes servers from the official MCP registry with their declared packages and remotes. Any format can be listed and discovered; only a remote endpoint can be linked as a priced, x402-payable listing that agents pay per call.
See how others ship.
Browse real servers and their distribution formats on the Loomal Index.