Skip to content

Conversation

@felixweinberger
Copy link
Contributor

@felixweinberger felixweinberger commented Nov 6, 2025

Summary

Adds reference server implementing MCP protocol features for conformance testing.

Motivation and Context

Validates that the Python SDK correctly implements the MCP specification. Provides reference implementation for all features and enables regression testing of SDK changes.

How Has This Been Tested?

Passes all 25 conformance test scenarios (initialization, logging, completion, 11 tools, 6 resources, 5 prompts).

CleanShot 2025-11-06 at 18 51 56@2x

Breaking Changes

None.

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

  • Uses FastMCP with StreamableHTTP transport (~350 lines)
  • Passes pyright with 0 errors (3 targeted ignores for private API with TODO)
  • Matches TypeScript everything-server functionality

@felixweinberger felixweinberger force-pushed the fweinberger/conformance-everything-server branch 6 times, most recently from 9882e20 to 8c25177 Compare November 6, 2025 19:02
Comment on lines 287 to 288
# TODO(felix): Add public APIs to FastMCP for subscribe_resource, unsubscribe_resource,
# and set_logging_level to avoid accessing protected _mcp_server attribute.
Copy link
Contributor Author

@felixweinberger felixweinberger Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some of these features aren't available via FastMCP yet; good reason to add this in a folllow-up PR...

@felixweinberger felixweinberger force-pushed the fweinberger/conformance-everything-server branch from 8c25177 to 22dcd3e Compare November 6, 2025 19:20
Implements a comprehensive reference server that exercises all MCP protocol
features for conformance testing. This server validates that the Python SDK
correctly implements the MCP specification by passing all 25 conformance
test scenarios.

Features implemented:
- 11 tools covering all content types (text, image, audio, embedded resources,
  mixed content, logging, progress, error handling, sampling, elicitation)
- 4 resources (static text/binary, templates, subscribable resources)
- 4 prompts with various content types
- Logging support (logging/setLevel)
- Completion support (completion/complete)
- Resource subscriptions (resources/subscribe, resources/unsubscribe)
- Session management with StreamableHTTP transport

Implementation uses FastMCP with proper type safety:
- All URIs wrapped with AnyUrl() for type correctness
- Context properly typed with ServerSession parameter
- Subscribe/unsubscribe handlers use correct AnyUrl parameter and None return
- Completion handler returns Completion objects
- ElicitationResult uses discriminated union narrowing via action field
- Relative imports in __main__.py to avoid type stub warnings

Type checking: Passes pyright with 0 errors (only 3 targeted ignores for
accessing _mcp_server private API, documented with TODO to add public APIs
to FastMCP in the future).

Conformance: Passes all 25 test scenarios.
@felixweinberger felixweinberger force-pushed the fweinberger/conformance-everything-server branch from 22dcd3e to a2f030e Compare November 6, 2025 19:26
@felixweinberger felixweinberger marked this pull request as ready for review November 6, 2025 19:30
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.

2 participants