mcp-python-design

Define structured MCP servers separating Resources from Tools with strict typing.

1|Updated Dec 24, 2025
One-click install
npx skills add https://github.com/HafizFasih/AIDD-Todo-App --skill mcp-python-design
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mcp-python-design
Source: https://github.com/HafizFasih/AIDD-Todo-App/tree/main/.claude/skills/mcp-python-design
Command: npx skills add https://github.com/HafizFasih/AIDD-Todo-App --skill mcp-python-design

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

MCP servers often struggle with clear separation of data context and actions, strong typing, and discoverable interfaces for LLMs. This Skill codifies best practices for creating resource-driven contexts (Resources) and action-triggering tools (Tools) using FastMCP, with explicit type hints and descriptive docstrings to guide model behavior.

Core Features & Use Cases

  • Resource vs Tool separation enforced by decorators (@mcp.resource, @mcp.tool) to improve discoverability and safety
  • Type-safe schemas generated from Python types and Annotated descriptions to help LLMs understand inputs and outputs
  • Clear URI schemes and modular design supporting end-to-end MCP servers for context-first AI workflows

Quick Start

Implement an MCP server by declaring resources and tools with the provided decorators and run the server to expose a typed, context-rich interface.

Frequently Asked Questions about mcp-python-design

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I architect MCP servers with strict type safety in Python?

Architect MCP servers with strict type safety by using FastMCP to separate data context (Resources) from actions (Tools) via decorators, enforcing explicit type hints on all parameters and returns to generate type-safe schemas for LLMs.

What is the best way to separate context and actions when building MCP servers?

The best way to separate context and actions in MCP servers is using FastMCP decorators: @mcp.resource for resource-driven contexts and @mcp.tool for action-triggering tools, improving discoverability and safety for LLM interactions.

How do I generate type-safe schemas from Python types for LLM contexts?

Generate type-safe schemas by applying Annotated descriptions and explicit type hints to Python function parameters and returns, allowing FastMCP to automatically translate these into discoverable, LLM-readable input and output schemas.

Does FastMCP support decorators for defining resources and tools?

Yes, FastMCP supports decorators like @mcp.resource and @mcp.tool to explicitly define resources and tools, enforcing a modular design with clear URI schemes for context-first AI workflows.

Why do my MCP server tools lack discoverability for LLMs?

MCP server tools lack discoverability when they fail to separate data context from actions and omit comprehensive docstrings tailored for Claude, robust error-handling patterns, and strict typing to guide model behavior.

When should I use explicit type hints and docstrings in FastMCP servers?

Use explicit type hints and comprehensive docstrings in FastMCP servers whenever defining resources or tools, as this ensures safe, debuggable behavior and generates annotated schemas that help LLMs understand inputs and outputs.