
Python MCP Server Template
A template repository for creating custom Model Context Protocol (MCP) servers in Python that can be integrated with applications like Claude Desktop or Cursor.
README
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_NAME
-
Create and activate the virtual environment:
uv
typically creates a.venv
directory in your project root.uv venv source .venv/bin/activate # On macOS/Linux # .venv\Scripts\activate # On Windows
-
Install dependencies: This project uses
pyproject.toml
to manage dependencies.uv pip install .
If you add new dependencies, define them in your
pyproject.toml
file and run this command again. If you are using arequirements.txt
file for some reason, you can install it withuv pip install -r requirements.txt
.
Running the Server
The mcp_server.py
script starts the MCP server.
To run the server directly:
uv run python mcp_server.py
Integrating 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"
: Specifiesuv
as the command to execute."args"
: A list of arguments for theuv
command:"run"
: Tellsuv
to 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 youruv
virtual 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
args
andworkingDirectory
are 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 uv
in your terminal on macOS or Linux, orwhere uv
on Windows. - The server listens on
stdio
by 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.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.