mcp-server-template-python
A very simple Python template for building MCP servers using Streamable HTTP transport.
Overview
This template provides a foundation for creating MCP servers that can communicate with AI assistants and other MCP clients. It includes a simple HTTP server implementation with example tools, resources & prompts to help you get started building your own MCP integrations.
Deploy
Use the following button to clone the repository and directly deploy the server to Alpic
Prerequisites
Installation
- Clone the repository:
git clone git@github.com:alpic-ai/mcp-server-template-python.git
cd mcp-server-template-python
- Install python version & dependencies:
uv python install
uv sync --locked
Usage
Start the server on port 3000:
uv run main.py
Running the Inspector
Requirements
- Node.js: ^22.7.5
Quick Start (UI mode)
To get up and running right away with the UI, just execute the following:
npx @modelcontextprotocol/inspector
The inspector server will start up and the UI will be accessible at http://localhost:6274.
You can test your server locally by selecting:
- Transport Type: Streamable HTTP
- URL: http://127.0.0.1:3000/mcp
Development
Adding New Tools
To add a new tool, modify main.py:
@mcp.tool(
title="Your Tool Name",
description="Tool Description for the LLM",
)
async def new_tool(
tool_param1: str = Field(description="The description of the param1 for the LLM"),
tool_param2: float = Field(description="The description of the param2 for the LLM")
)-> str:
"""The new tool underlying method"""
result = await some_api_call(tool_param1, tool_param2)
return result
Adding New Resources
To add a new resource, modify main.py:
@mcp.resource(
uri="your-scheme://{param1}/{param2}",
description="Description of what this resource provides",
name="Your Resource Name",
)
def your_resource(param1: str, param2: str) -> str:
"""The resource template implementation"""
# Your resource logic here
return f"Resource content for {param1} and {param2}"
The URI template uses {param_name} syntax to define parameters that will be extracted from the resource URI and passed to your function.
Adding New Prompts
To add a new prompt , modify main.py:
@mcp.prompt("")
async def your_prompt(
prompt_param: str = Field(description="The description of the param for the user")
) -> str:
"""Generate a helpful prompt"""
return f"You are a friendly assistant, help the user and don't forget to {prompt_param}."
Metadata
Release files for iflow-mcp_alpic-ai-mcp-server-template 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| iflow_mcp_alpic_ai_mcp_server_template-0.1.0.tar.gz | 3.0 kB | Without provenance | Details for iflow_mcp_alpic_ai_mcp_server_template-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| iflow_mcp_alpic_ai_mcp_server_template-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for iflow_mcp_alpic_ai_mcp_server_template-0.1.0-py3-none-any.whl |
Total release size: 6.5 kB
Release files / iflow_mcp_alpic_ai_mcp_server_template-0.1.0.tar.gz
| Download URL | iflow_mcp_alpic_ai_mcp_server_template-0.1.0.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5615b1a1f8d617e8d7e816aafbef88239f5d8c9731f5a0ebab8c5a60098c0584
|
|
BLAKE2b-256 checksum How to use checksums |
f523809cdd4ca67a530ff4e4bb5657f86d6c08748bbcc64427fb57b6fbad8f9d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / iflow_mcp_alpic_ai_mcp_server_template-0.1.0-py3-none-any.whl
| Download URL | iflow_mcp_alpic_ai_mcp_server_template-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2302402966e35e89fca681e71b40f21a5444a807902800ee9b2c4d729d2f078e
|
|
BLAKE2b-256 checksum How to use checksums |
7d1de8ea464daef0e9eafabc72c8c348330030d0a229ec8fea71b7d2bfec3768
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for iflow-mcp_alpic-ai-mcp-server-template 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.