Skip to content

Conversation

@Kludex
Copy link
Member

@Kludex Kludex commented Jan 16, 2026

No description provided.

Add MCPModel base class that inherits from Pydantic BaseModel with
`extra="allow"` configuration for forward compatibility with protocol
extensions.

This change:
- Creates MCPModel as a central base class for all MCP protocol types
- Updates all protocol types to inherit from MCPModel (directly or indirectly)
- Removes redundant model_config declarations from ~80 classes
- Maintains the same runtime behavior while reducing code duplication

The MCPModel pattern centralizes the `extra="allow"` configuration that
enables MCP protocol types to accept additional fields not defined in the
schema, which is essential for forward compatibility with future protocol
versions.

Co-authored-by: Max Isbey <224885523+maxisbey@users.noreply.github.com>
@Kludex Kludex force-pushed the refactor/mcp-model-base-class branch from b753864 to 518a10f Compare January 16, 2026 09:46
@Kludex Kludex merged commit 68cbabb into main Jan 16, 2026
25 checks passed
@Kludex Kludex deleted the refactor/mcp-model-base-class branch January 16, 2026 09:51
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.

3 participants