
girey0211/mcp_templete
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
A clean template for building Model Context Protocol (MCP) servers using Python and fastmcp.
Обзор
A clean template for building Model Context Protocol (MCP) servers using Python and fastmcp. This template is configured to use over HTTP on port , making it compatible with various MCP clients that support HTTP/SSE. - 🚀 : Built on top of the high-performance FastMCP framework. - 📡 : Ready for remote connections or local HTTP integration. - 📦 : managed with uv. - Python 3.10+ - uv (recommended for dependency management) 2. (Optional) Configure environment variables: You can run the server directly using uv: The server will start on http://127.0.0.1:9000/sse. 1. : Edit pyproject.toml and change name and description. 2. : Open src/template_server/server.py and add your own functions decorated with @mcp.tool(). 3. : Use @mcp.resource() to expose data resources.
README
MCP Server Template
A clean template for building Model Context Protocol (MCP) servers using Python and fastmcp.
This template is configured to use SSE (Server-Sent Events) transport over HTTP on port 9000, making it compatible with various MCP clients that support HTTP/SSE.
Features
- 🚀 FastMCP: Built on top of the high-performance FastMCP framework.
- 📡 HTTP/SSE Transport: Ready for remote connections or local HTTP integration.
- 📦 Modern Tooling: managed with
uv.
Prerequisites
- Python 3.10+
- uv (recommended for dependency management)
Installation
- Install dependencies:
uv sync
- (Optional) Configure environment variables:
cp .env.example .env
# Edit .env if needed
Usage
Running the Server
You can run the server directly using uv:
uv run mcp-server
Or using python directly:
uv run python -m template_server.server
The server will start on http://127.0.0.1:9000/sse.
Customization
- Rename the project: Edit
pyproject.tomland changenameanddescription. - Add Tools: Open
src/template_server/server.pyand add your own functions decorated with@mcp.tool(). - Add Resources: Use
@mcp.resource()to expose data resources.
Project Structure
mcp-template/
├── src/
│ └── template_server/
│ ├── __init__.py
│ └── server.py # Main server logic and tools
├── pyproject.toml # Dependencies and Metadata
├── .env.example # Environment variable template
└── README.md # Documentation
Установка
This server does not publish a one-line install command.
Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →