- Home
- MCP servers
- Python
Python
- python
13
GitHub Stars
python
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"sontallive-mcp-server-python-template": {
"command": "python",
"args": [
"server.py",
"--transport",
"stdio"
]
}
}
}This Python MCP Server provides a ready-to-run template for building Model Context Protocol (MCP) servers. It includes a weather example, multiple transport options, and embedded MCP guidance to help you develop, run, and test MCP-powered tools with ease.
How to use
You run the MCP server locally and connect with an MCP client to invoke tools defined in your server. Start the weather example in stdio mode to interact via a CLI, or use the SSE transport to expose a web-friendly endpoint. Create or modify tools, then call them from your MCP client by name and pass parameters as defined in your tool interfaces.
Practical usage patterns include starting the server in stdio mode for script-based tooling, or starting in SSE mode to integrate with web applications. Your MCP client will discover tools, send requests with the required parameters, and receive structured responses from the server. Tools are defined using the @mcp.tool decorator and can perform actions such as fetching data or computing results.
How to install
Prerequisites: Python 3.12 or newer, Git.
- Clone the project and navigate into it.
git clone https://github.com/sontallive/mcp-server-python-template.git
cd mcp-server-python-template
- Create a virtual environment and install dependencies.
python -m venv .venv
# On macOS/Linux
source .venv/bin/activate
# On Windows
.venv\Scripts\activate
pip install -e .
- Run the example MCP server in stdio mode or SSE mode as shown below.
# Run with stdio transport (CLI tooling)
python server.py --transport stdio
# Run with SSE transport (web applications)
python server.py --transport sse --host 0.0.0.0 --port 8080
Available tools
your_tool_function
An example MCP tool decorated with @mcp.tool that accepts param1 (string) and param2 (int) and returns a string result.