MCP Python Starter

by SamMorrowDrums

19 157 downloads Not rated yet MIT

About

A feature-complete Model Context Protocol (MCP) server template written in Python using FastMCP. It demonstrates all major MCP features—tools, resources, templates, and prompts—with clean, Pythonic code, serving as a jumpstart for developers building their own MCP servers.

Details

License
MIT

Explore

| Category | Feature | Description |
|----------|---------|-------------|
| Tools | hello | Basic tool with annotations |
| | get_weather | Tool returning structured data |
| | ask_llm | Tool that invokes LLM sampling |
| | long_task | Tool with 5-second progress updates |
| | load_bonus_tool | Dynamically loads a new tool |
| Resources | info://about | Static informational resource |
| | file://example.md | File-based markdown resource |
| Templates | greeting://{name} | Personalized greeting |
| | data://items/{id} | Data lookup by ID |
| Prompts | greet | Greeting in various styles |
| | code_review | Code review with focus areas |

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name MCP Python Starter
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

- Python 3.11+
- uv (recommended) or pip

uv sync

stdio transport (for local development):

uv run mcp-python-starter --stdio

HTTP transport (for remote/web deployment):

uv run mcp-python-starter --http --port 3000

npx @modelcontextprotocol/inspector -- uv run mcp-python-starter

Copy .env.example to .env and configure:

cp .env.example .env
@mcp.tool(
    title="Say Hello",
    description="A friendly greeting tool",
    annotations={"readOnlyHint": True},
)
def hello(name: str) -> str:
    """Say hello to someone.
    
    Args:
        name: The name to greet
    """
    return f"Hello, {name}!"
@mcp.tool(title="Long Task")
async def long_task(
    task_name: str,
    ctx: Context[ServerSession, None],
) -> str:
    for i in range(5):
        await ctx.report_progress(
            progress=i / 5,
            total=1.0,
            message=f"Step {i + 1}/5",
        )
        await asyncio.sleep(1.0)
    return "Done!"
@mcp.tool(title="Ask LLM")
async def ask_llm(
    prompt: str,
    ctx: Context[ServerSession, None],
) -> str:
    result = await ctx.session.create_message(
        messages=[{"role": "user", "content": {"type": "text", "text": prompt}}],
        max_tokens=100,
    )
    return result.content.text

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "mcp python starter": {
            "mcp-python-starter": {
                "command": "uv",
                "args": [
                    "sync"
                ]
            }
        }
    }
}

McpServers

{
    "mcp-python-starter": {
        "command": "uv",
        "args": [
            "sync"
        ]
    }
}

CI
Python
Ruff
License: MIT
MCP

A feature-complete Model Context Protocol (MCP) server template in Python using FastMCP. This starter demonstrates all major MCP features with clean, Pythonic code.

📚 Documentation

- Model Context Protocol
- Python SDK
- FastMCP Guide

✨ Features

| Category | Feature | Description |
|----------|---------|-------------|
| Tools | hello | Basic tool with annotations |
| | get_weather | Tool returning structured data |
| | ask_llm | Tool that invokes LLM sampling |
| | long_task | Tool with 5-second progress updates |
| | load_bonus_tool | Dynamically loads a new tool |
| Resources | info://about | Static informational resource |
| | file://example.md | File-based markdown resource |
| Templates | greeting://{name} | Personalized greeting |
| | data://items/{id} | Data lookup by ID |
| Prompts | greet | Greeting in various styles |
| | code_review | Code review with focus areas |

🚀 Quick Start

Prerequisites

- Python 3.11+
- uv (recommended) or pip

Installation

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.