home / mcp / template mcp server

Template MCP Server

Provides a minimal MCP server template with streamable HTTP transport for local development and deployment.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "avrecum-yf-mcp": {
      "url": "http://localhost:8000/mcp"
    }
  }
}

You have a lightweight MCP server template that lets you expose functions over a Streamable HTTP transport. It’s designed for quick local development and easy deployment, so you can connect an MCP client to a server running Python code and add custom tools to extend capabilities.

How to use

Start by launching the server locally and then connect your MCP client to the designated MCP endpoint. The server is accessible via the HTTP path that ends with /mcp, and you interact with it using a compatible MCP client. You can run the server in one terminal and perform a separate inspection or tooling step in another terminal if needed. When you connect a client, you’ll be able to call the exposed tools and receive results in real time.

How to install

Prerequisites you need to have installed on your development machine are Python 3.13 (or a compatible Python environment) and a Python package manager. You’ll also benefit from a conda-enabled workflow for environment management.

Step by step commands you should run locally to set up and run the server are listed here as concrete commands.

Customization

Add more tools by decorating functions with @mcp.tool. This lets you extend the MCP server with custom endpoints that your clients can call.

@mcp.tool
def calculate(x: float, y: float, operation: str) -> float:
    """Perform basic arithmetic operations."""
    if operation == "add":
        return x + y
    elif operation == "multiply":
        return x * y
    # ...

Available tools

calculate

Decorator-based tool that performs basic arithmetic operations such as add and multiply, extending the MCP with custom endpoints.