A template repository for developing MCP servers in Python
Configuration
View docs{
"mcpServers": {
"anirbanbasu-pymcp": {
"command": "uv",
"args": [
"run",
"pymcp"
],
"env": {
"FASTMCP_HOST": "localhost",
"FASTMCP_PORT": "8000",
"PYMCP_LOG_LEVEL": "INFO",
"RESPONSE_CACHE_TTL": "30",
"MCP_SERVER_TRANSPORT": "stdio",
"ASGI_CORS_ALLOWED_ORIGINS": "[\"*\"]"
}
}
}
}You can run a Python-based MCP server template that leverages FastMCP to expose a set of ready-to-use tools. This server is designed to be extended and used as a starting point for building MCP endpoints in Python, with practical tooling you can try out locally and via MCP clients.
Start the PyMCP server in standalone mode using a standard input/output transport. This is the simplest way to run the server locally and test with an MCP client. You will be able to connect using an MCP client, explore the available tools, and issue requests to generate responses.
To run the server directly, use the following command. It starts the MCP server on the local machine and exposes it via the stdio transport.
uv run pymcpConnect using an MCP client that supports FastMCP. Choose the stdio transport to connect directly from your development environment or use a client that can target a local stdio endpoint. This approach is ideal for quick experiments and debugging.
If your client supports the MCP Inspector workflow, you can pair the local server with the inspector to explore tools and responses in a UI. Use the standard local URL and authentication token provided after starting the server.
Prerequisites you need before installing and running the server:
Install the required tools and dependencies in your working directory, then install the project dependencies with a minimal setup.
just installAfter installation, start the server using the standard command shown here. This launches the MCP server and makes it available for MCP clients on the local machine.
uv run pymcpGreets the caller with a Hello World message and optionally a name, returning a UTC time-stamped greeting.
Generates a random password of a specified length with optional special characters and complexity guarantees.
Performs a web search using the DDGS service and returns a list of results with optional region, max results, and pages.
Calculates the number of ordered selections (nPk) from a set of n items.
Summarises input text in pirate style using client-side sampling.
Generates a random number from the von Mises distribution using client elicitation for kappa.
Retrieves the Base64 encoded PyMCP logo along with its SHA3-512 hash.
Retrieves the SVG logo for PyMCP.
Computes modulus-10 of a number and returns a Unicode character representing odd/even parity.
Generates a coding task prompt for Python based on a given description.