MCP · Lesson 76 of 120
Packaging a Server
Uv and pyproject.
Sharing a server as a folder of files is fragile. A proper Python package lists its dependencies, and gives users one command to run it.

- Folders are fragile
- A package
- One command
pyproject.toml
The project section names the package, and lists its dependencies, here the MCPSDK. Project scripts creates a command called northwind MCP, which calls the main function in our server. The build system section tells tools how to build it.
pyproject.tomltoml
[project]
name = "northwind-mcp"
version = "1.0.0"
requires-python = ">=3.11"
dependencies = ["mcp>=2.3"]
[project.scripts]
northwind-mcp = "northwind:main"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"northwind.py
In the server, main simply calls run. That's the function the script points to.
northwind.pypython
# ... tools, resources and prompts as before ...
def main():
mcp.run()
if __name__ == "__main__":
main()Running it
Once it's published, UVX downloads and runs it in one step. Hosts can use UVX northwind MCP as the command. No folders, and no manual installs.
| key | value |
|---|---|
| Run | uvx northwind-mcp |
| Host command | uvx |
| Host args | northwind-mcp |
| Installs | automatic |
Summary
Package your server with a pyproject file and a script entry, so users run it with one command. Next, Docker.
Key takeaways- pyproject.toml
- project.scripts
- uvx
Next up: Docker for MCP — a container