py-mcp-server-template
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@py-mcp-server-template explain how to set up the server"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
py-mcp-server-template
This repository is a template to help you create your own MCP (Model Context Protocol) servers in Python. Fork this repository to get started.
Setup with uv
This project uses uv for Python packaging and virtual environment management. If you don't have uv installed, please refer to the official uv installation guide.
Clone your forked repository:
git clone https://github.com/YOUR_USERNAME/YOUR_REPOSITORY_NAME.git cd YOUR_REPOSITORY_NAMECreate and activate the virtual environment:
uvtypically creates a.venvdirectory in your project root.uv venv source .venv/bin/activate # On macOS/Linux # .venv\Scripts\activate # On WindowsInstall dependencies: This project uses
pyproject.tomlto manage dependencies.uv pip install .If you add new dependencies, define them in your
pyproject.tomlfile and run this command again. If you are using arequirements.txtfile for some reason, you can install it withuv pip install -r requirements.txt.
Related MCP server: MCP Server Boilerplate
Running the Server
The mcp_server.py script starts the MCP server.
To run the server directly:
uv run python mcp_server.pyIntegrating with Claude Desktop or Cursor
To use this MCP server with an application like Claude Desktop or Cursor, you'll need to configure it in the application's settings. The configuration will typically involve specifying the command to run your server.
Here's an example configuration snippet. You'll need to replace /ABSOLUTE/PATH/TO/PARENT/FOLDER/YOUR_REPOSITORY_NAME with the actual absolute path to your project directory on your system.
{
"mcpServers": {
"my-custom-python-server": {
"command": "uv",
"args": [
"run",
"--python",
"/ABSOLUTE/PATH/TO/PARENT/FOLDER/YOUR_REPOSITORY_NAME/.venv/bin/python",
"/ABSOLUTE/PATH/TO/PARENT/FOLDER/YOUR_REPOSITORY_NAME/mcp_server.py"
],
"workingDirectory": "/ABSOLUTE/PATH/TO/PARENT/FOLDER/YOUR_REPOSITORY_NAME"
}
}
}Explanation of the configuration:
"my-custom-python-server": This is a name you give to your server configuration."command": "uv": Specifiesuvas the command to execute."args": A list of arguments for theuvcommand:"run": Tellsuvto execute a command within its managed environment."--python": Specifies the Python interpreter to use. It's important to point this to the Python interpreter inside youruvvirtual environment (.venv/bin/python)."/ABSOLUTE/PATH/TO/PARENT/FOLDER/YOUR_REPOSITORY_NAME/mcp_server.py": The absolute path to your server script.
"workingDirectory": Specifies the working directory for the server process, which should be your project's root directory.
Important:
Ensure the paths in the
argsandworkingDirectoryare correct for your system.If the application cannot locate
uv, you might need to specify its full path in the"command"field. You can typically find this path by runningwhich uvin your terminal on macOS or Linux, orwhere uvon Windows.The server listens on
stdioby default as configured inmcp_server.py(mcp.run(transport='stdio')), which is typically what applications like Cursor expect.
After configuring, the application should be able to communicate with your Python MCP server.
Available Tools
3 toolsget_jokeD
Inputs: no named parameters.
get_pingD
Inputs: message (required).
get_weatherD
Inputs: city (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool targets a completely different resource: ping is a health check, joke and weather are distinct data categories. There is no overlap or ambiguity between them.
All three tools follow the same get_<noun> snake_case pattern. The verb is uniform and the nouns are clear, so the naming convention is perfectly consistent.
At three tools, the server is at the lower end of the ideal range but still reasonable for a template or demo server. Each tool is minimal and serves as an example, though the set is slightly thin for a general-purpose utility server.
The tools do not form a coherent domain; ping, joke, and weather are unrelated, with no lifecycle or deeper operations. As a template the surface may be intentional, but for any real use it is severely incomplete, e.g., weather lacks location/forecast controls and jokes have no variations.
Maintenance
Related MCP Connectors
Create guides as MCP servers to instruct coding agents to use your software (library, API, etc).
Augments MCP Server - A comprehensive framework documentation provider for Claude Code
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Related MCP Servers
- AlicenseDqualityDmaintenanceA template repository for creating custom Model Context Protocol (MCP) servers in Python that can be integrated with applications like Claude Desktop or Cursor.36MIT
- FlicenseCqualityDmaintenanceA starter template for building MCP servers that can integrate with Claude, Cursor, or other MCP-compatible AI assistants to create custom tools, resource providers, and prompt templates.26 npm-
- FlicenseAqualityDmaintenanceA starter template for building custom MCP servers that can integrate with Claude Desktop, Cursor, and other AI assistants. Provides example tools, TypeScript support, and automated publishing workflows to help developers create their own AI assistant integrations.77 npm-
- FlicenseBqualityDmaintenanceA starter template for building custom MCP servers that can integrate with Claude Desktop, Cursor, and other AI assistants. Provides example tools, TypeScript support, and automated publishing workflows to help developers quickly create their own MCP integrations.18 npm-