Python MCP Server Template
plantilla de servidor py-mcp
Este repositorio es una plantilla que te ayuda a crear tus propios servidores MCP (Protocolo de Contexto de Modelo) en Python. Bifurca este repositorio para empezar.
Configuración con uv
Este proyecto utiliza uv para el empaquetado de Python y la gestión de entornos virtuales. Si no tiene uv instalado, consulte la guía oficial de instalación de uv .
Clona tu repositorio bifurcado:
git clone https://github.com/YOUR_USERNAME/YOUR_REPOSITORY_NAME.git cd YOUR_REPOSITORY_NAMECree y active el entorno virtual:
uvnormalmente crea un directorio.venven la raíz del proyecto.uv venv source .venv/bin/activate # On macOS/Linux # .venv\Scripts\activate # On WindowsInstalar dependencias: este proyecto utiliza
pyproject.tomlpara administrar las dependencias.uv pip install .Si agrega nuevas dependencias, defínalas en su archivo
pyproject.tomly vuelva a ejecutar este comando. Si utiliza un archivorequirements.txtpor algún motivo, puede instalarlo conuv pip install -r requirements.txt.
Related MCP server: mcp-framework-starter
Ejecución del servidor
El script mcp_server.py inicia el servidor MCP.
Para ejecutar el servidor directamente:
uv run python mcp_server.pyIntegración con Claude Desktop o Cursor
Para usar este servidor MCP con una aplicación como Claude Desktop o Cursor, deberá configurarlo en la configuración de la aplicación. La configuración generalmente implica especificar el comando para ejecutar el servidor.
Aquí tienes un ejemplo de fragmento de configuración. Deberás reemplazar /ABSOLUTE/PATH/TO/PARENT/FOLDER/YOUR_REPOSITORY_NAME por la ruta absoluta real al directorio de tu proyecto en el sistema.
{
"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"
}
}
}Explicación de la configuración:
"my-custom-python-server": este es el nombre que le da a la configuración de su servidor."command": "uv": especificauvcomo el comando a ejecutar."args": una lista de argumentos para el comandouv:"run": le indicauvque ejecute un comando dentro de su entorno administrado."--python": Especifica el intérprete de Python que se usará. Es importante apuntar esto al intérprete de Python dentro de su entorno virtualuv(.venv/bin/python)."/ABSOLUTE/PATH/TO/PARENT/FOLDER/YOUR_REPOSITORY_NAME/mcp_server.py": La ruta absoluta a su script de servidor.
"workingDirectory": especifica el directorio de trabajo para el proceso del servidor, que debe ser el directorio raíz de su proyecto.
Importante:
Asegúrese de que las rutas en
argsyworkingDirectorysean correctas para su sistema.Si la aplicación no puede localizar
uv, podrías tener que especificar su ruta completa en el campo"command". Normalmente, puedes encontrar esta ruta ejecutandowhich uven tu terminal en macOS o Linux, owhere uven Windows.El servidor escucha en
stdiode manera predeterminada, tal como está configurado enmcp_server.py(mcp.run(transport='stdio')), que es normalmente lo que esperan aplicaciones como Cursor.
Después de la configuración, la aplicación debería poder comunicarse con su servidor Python MCP.
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.
3 tool updates
- First observed
get_joke - First observed
get_ping - First observed
get_weather
TDQS
Scored across 3 tools
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
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.110 npm14MIT
- 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.25 npm-
- 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.25 npm-