Python MCP Server Template
Click on "Install 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., "@Python MCP Server Templateshow me how to configure this server for Claude Desktop"
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-framework-starter
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
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Tool has no description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Tool has no description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Tool has no description.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Tool has no description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Tool has no description.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Tool has no description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_pingD
| Name | Required | Description | Default |
|---|---|---|---|
| message | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Tool has no description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Tool has no description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Tool has no description.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Tool has no description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Tool has no description.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Tool has no description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_weatherD
| Name | Required | Description | Default |
|---|---|---|---|
| city | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Tool has no description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Tool has no description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Tool has no description.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Tool has no description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Tool has no description.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Tool has no description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
3 tool updates
- First observed
get_joke - First observed
get_ping - First observed
get_weather
TDQS
Each tool has a clearly distinct purpose: get_joke retrieves jokes, get_ping checks server status, and get_weather fetches weather data. There is no overlap in functionality, making it easy for an agent to select the correct tool without confusion.
All tool names follow a consistent verb_noun pattern with 'get_' as the prefix, using snake_case throughout. This predictable naming scheme enhances readability and usability for agents.
With only 3 tools, the server feels thin for a general-purpose template, as it lacks depth in any specific domain. While the count is not extreme, it may be insufficient for complex workflows, though it's reasonable for a basic example.
The tool set is severely incomplete for a Python MCP server template, as it only includes three unrelated, trivial functions without covering any meaningful domain or lifecycle operations. There are significant gaps that would hinder agent performance in practical scenarios.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
Primarily to be used as a template repository for developing MCP servers with FastMCP in Python, P…
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
Related MCP Servers
- AlicenseCqualityDmaintenanceA starter template for building Model Context Protocol servers that can be integrated with Cursor or Claude Desktop, allowing developers to create custom tools and extensions for AI assistants.1514MIT
- FlicenseNot gradedqualityDmaintenanceA starter template for building Model Context Protocol (MCP) servers, enabling developers to create and add custom tools that can be integrated with Claude Desktop.2-
- FlicenseCqualityDmaintenanceA starter template for building Model Context Protocol servers that integrate with AI assistants like Claude and Cursor, providing custom tools, resource providers, and prompt templates.28-
- FlicenseCqualityDmaintenanceA starter template for building Model Context Protocol servers that integrate with AI assistants like Claude and Cursor, providing custom tools, resource providers, and prompt templates.28-
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/nictuku/py-mcp-server-template'
If you have feedback or need assistance with the MCP directory API, please join our Discord server