Skip to content

Conversation

@dgenio
Copy link

@dgenio dgenio commented Nov 28, 2025

Summary

Adds documentation and examples for organizing larger FastMCP servers and managing tool versions.

Closes #1681

Changes

Documentation

  • New: docs/server_organization.md - Comprehensive guide on:
    • Recommended project layout (server.py + tools/ structure)
    • Name-based tool versioning pattern (tool_v1, tool_v2)
    • When to create new versions vs. maintaining backward compatibility
    • Client consumption strategies (whitelists, version selection)
    • Advanced patterns (shared logic, deprecation)

Examples

  • New: examples/snippets/servers/server_layout/ - Runnable example showing:
    • Organized tool structure with separate modules
    • Two versions of a tool (get_info_v1, get_info_v2) demonstrating breaking changes
    • Clean separation between server wiring and tool implementation

Other Changes

  • Updated mkdocs.yml to include new docs page in navigation
  • Updated examples/snippets/servers/__init__.py to include new example

Design Decisions

  • Name-based versioning: Uses tool names like get_info_v1, get_info_v2 - compatible with current main branch, no protocol changes needed
  • No dependency on unmerged PRs: This pattern works with the SDK as-is today
  • Docs-only scope: No modifications to core library behavior under src/mcp/
  • Follows existing patterns: Consistent with other snippet examples and documentation style

Testing

Run the example:
uv run examples/snippets/servers/server_layout/server.py## Checklist

  • Documentation follows existing style and conventions
  • Example code uses proper type hints
  • Example follows existing snippet patterns
  • No changes to core library behavior
  • mkdocs.yml navigation updated
  • Code passes ruff formatting/linting
  • Example is runnable and self-contained

@dgenio dgenio force-pushed the feature/fastmcp-server-layout-docs branch from d3f0370 to 642a915 Compare November 28, 2025 10:56
…tools

- Add docs/server_organization.md with recommended patterns

- Create examples/snippets/servers/server_layout/ demonstrating organization

- Show name-based tool versioning (tool_v1, tool_v2)

- Wire new docs page into mkdocs.yml navigation

- No changes to core library behavior
@dgenio dgenio force-pushed the feature/fastmcp-server-layout-docs branch from 642a915 to 2280c33 Compare November 28, 2025 10:59
@dgenio dgenio marked this pull request as ready for review November 28, 2025 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document recommended FastMCP server layout and tool version organization (server.py + tools/ modules)

1 participant