A small Hello World to get me started with Model Context Protocol (MCP) servers.
This minimal example sets up a simple MCP server using the python-sdk and responds with a greeting whenever a tool is called. Used https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/servers/simple-streamablehttp-stateless as a template.
- Python 3.10 or later
- uvicorn
- MCP Python SDK
To install the dependencies:
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtuv run HelloWorldMCPThen simply connect using something like Claude Desktop or I used 5ire. URL should be: http://0.0.0.0:3000/mcp