MCP Python Starter

MCP Python Starter

mcp-python-starter•bysammorrowdrums

A feature-complete Model Context Protocol server template in Python built on the official MCP Python SDK, demonstrating core MCP features.

License: MIT License•Runtime: Awaiting documentation review•Category: developer tools

WHAT IT DOES

  • •Provides tools including a basic hello tool, a structured-data weather tool, an LLM sampling tool, a long-running task with progress updates, and dynamic tool loading.
  • •Exposes resources and resource templates, including a static info resource, a file-based markdown resource, and personalized greeting and data lookup templates.
  • •Includes prompts such as a greeting in various styles and a code review with focus areas.
  • •Supports both stdio transport for local development and HTTP transport for remote or web deployment.

BEST FOR

  • •Developers looking for a Python starting point to build their own MCP servers.
  • •Learning and testing core MCP features like tools, resources, templates, prompts, sampling, and progress notifications.

ABOUT MCP-PYTHON-STARTER

MCP Python Starter is cataloged as an MCP server attributed to sammorrowdrums. A feature-complete Model Context Protocol server template in Python built on the official MCP Python SDK, demonstrating core MCP features. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT License. Check the source repository's current license and terms before using, modifying or distributing this software.

Capability inspector

Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.

Tools (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Resources (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Prompts (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for MCP Python Starter are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

How does the server handle sampling on different protocol versions?

It uses multi-round-trip requests for sampling on modern protocol versions and a legacy back-channel for older clients.

Upstream README

View this exact version on GitHub

README.md · 8d2c0ff8c0d2 · Fetched 2026-11-13 09:56:27 UTC

Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.

Showing the last retrieved documentation snapshot; check the source for current changes.

MCP Python Starter

CI Python Ruff License: MIT MCP

A feature-complete Model Context Protocol (MCP) server template in Python using the official MCP Python SDK. This starter demonstrates core MCP features with clean, Pythonic code.

📚 Documentation

✨ Features

CategoryFeatureDescription
ToolshelloBasic tool with annotations
get_weatherTool returning structured data
ask_llmTool that invokes LLM sampling
long_taskTool with 5-second progress updates
load_bonus_toolDynamically loads a new tool
Resourcesinfo://aboutStatic informational resource
file://example.mdFile-based markdown resource
Templatesgreeting://{name}Personalized greeting
data://items/{id}Data lookup by ID
PromptsgreetGreeting in various styles
code_reviewCode review with focus areas

🚀 Quick Start

Prerequisites

Installation

# Clone the repository
git clone https://github.com/SamMorrowDrums/mcp-python-starter.git
cd mcp-python-starter

# Install with uv (recommended)
uv sync

# Or with pip
pip install -e .

Running the Server

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

🔧 VS Code Integration

This project includes VS Code configuration for seamless development:

  1. Open the project in VS Code
  2. The MCP configuration is in .vscode/mcp.json
  3. Test the server using VS Code's MCP tools

Using DevContainers

  1. Install the Dev Containers extension
  2. Open command palette: "Dev Containers: Reopen in Container"
  3. Everything is pre-configured and ready to use!

📁 Project Structure

.
├── mcp_starter/
│   ├── __init__.py
│   ├── tools.py       # Tool definitions (hello, get_weather, ask_llm, etc.)
│   ├── resources.py   # Resource and template definitions
│   ├── prompts.py     # Prompt definitions
│   └── server.py      # Server orchestration (imports and wires modules)
├── .vscode/
│   ├── mcp.json       # MCP server configuration
│   ├── settings.json  # Python settings
│   └── extensions.json
├── .devcontainer/
│   └── devcontainer.json
├── pyproject.toml     # Project configuration (uv/pip, Ruff config)
└── .python-version

🛠️ Development

# Run the server (Python reloads automatically on changes)
uv run mcp-python-starter --stdio

# Use MCP Inspector for debugging
uv run mcp dev mcp_starter/server.py

# Format code
uv run ruff format .

# Lint
uv run ruff check .

# Lint with auto-fix
uv run ruff check --fix .

# Type check
uv run pyright

Live Reload

Python scripts reload automatically when run with uv run. For enhanced debugging, use mcp dev which provides the MCP Inspector UI.

🔍 MCP Inspector

The MCP Inspector is an essential development tool for testing and debugging MCP servers.

Running Inspector

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

What Inspector Provides

  • Tools Tab: List and invoke all registered tools with parameters
  • Resources Tab: Browse and read resources and templates
  • Prompts Tab: View and test prompt templates
  • Logs Tab: See JSON-RPC messages between client and server
  • Schema Validation: Verify tool input/output schemas

Debugging Tips

  1. Start Inspector before connecting your IDE/client
  2. Use the "Logs" tab to see exact request/response payloads
  3. Test tool annotations (ToolAnnotations) are exposed correctly
  4. Verify progress notifications appear for long_task
  5. Check that Context injection works for sampling tools

📖 Feature Examples

Tool with Annotations (MCPServer decorator)

from mcp.types import ToolAnnotations


@mcp.tool(
    title="Say Hello",
    description="A friendly greeting tool",
    annotations=ToolAnnotations(read_only_hint=True),
)
def hello(name: str) -> str:
    """Say hello to someone.

    Args:
        name: The name to greet
    """
    return f"Hello, {name}!"

Resource Template

@mcp.resource("greeting://{name}")
def greeting_template(name: str) -> str:
    """Generate a personalized greeting."""
    return f"Hello, {name}!"

Tool with Progress Updates

@mcp.tool(title="Long Task")
async def long_task(
    task_name: str,
    ctx: Context,
) -> 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!"

Tool with Sampling

from typing import Annotated

from mcp.server.mcpserver import Resolve, Sample
from mcp.types import CreateMessageResult, SamplingMessage, TextContent


def request_sample(prompt: str) -> Sample:
    return Sample([SamplingMessage(role="user", content=TextContent(text=prompt))], max_tokens=100)


@mcp.tool(title="Ask LLM")
async def ask_llm(
    prompt: str,
    result: Annotated[CreateMessageResult, Resolve(request_sample)],
) -> str:
    if isinstance(result.content, TextContent):
        return result.content.text
    return "[non-text response]"

The server uses multi-round-trip requests for sampling on modern protocol versions and the legacy back-channel for older clients.

🔐 Environment Variables

Copy .env.example to .env and configure:

cp .env.example .env

🤝 Contributing

Contributions welcome! Please ensure your changes maintain feature parity with other language starters.

📄 License

MIT License - see LICENSE for details.

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for MCP Python Starter from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/mcp-python-starter)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

Downloads and pulls

Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.

No reviewed package or image identity; download statistics are not listed yet.

Related developer tools MCP Servers

Alternative and complementary servers in the same category

View all in developer tools →
Postbye
postbye-mcp•postbye-team

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools
Singapore Proxy MCP
singapore-proxy-mcp•Xavierfok

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

0
Developer Tools

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools