mcp_models
Dart model classes for the Model Context Protocol (MCP) — tools, resources, prompts, subscriptions and notifications. No codegen.
2.1.0
17K downloads/mo
#2348 most downloaded on pub.dev
uproid/mcp_models
What this package is like to depend on
Last release 9 days ago
14 Aug 2026
Release timing varies
gaps range from 8 days to 3 months
Nearly every release is documented
notes for 5 of 5 stable releases
3 versions withdrawn
withdrawn after publishing
3 months old
9 releases · first in 2026
9 releases in the last 12 months
see the full history below
Release timeline
9 releases · May 2026 to Aug 2026Releases
latest 9-
2.1.014 Aug 2026 -
2.1.0-dev.314 Aug 2026 pre-releaseNothing published for this version
-
2.1.0-dev.212 Aug 2026 pre-release withdrawnNothing published for this version
-
2.1.0-dev.111 Aug 2026 pre-release withdrawnNothing published for this version
-
2.0.006 Aug 2026Release notes
Open source →Full migration to the MCP 2026-07-28 schema. This is a breaking release — no backward-compatible shim is provided.
- Added:
server/discoverRPC family:DiscoverRequest,DiscoverResultResponse,DiscoverResult. Servers now advertise capabilities out-of-band instead of via a one-time handshake.subscriptions/listenRPC family:SubscriptionFilter,SubscriptionsListenRequest/SubscriptionsListenRequestParams,SubscriptionsListenResultMetaObject,SubscriptionsListenResult/SubscriptionsListenResultResponse,SubscriptionsAcknowledgedNotification/SubscriptionsAcknowledgedNotificationParams. Replacesresources/subscribe/resources/unsubscribe.- Multi-round-trip support:
InputRequiredResult,InputResponseRequestParams(base forGetPromptRequestParams,ReadResourceRequestParams,CallToolRequestParams), andresultType-discriminated outcome unions (CallToolResultOutcome,GetPromptResultOutcome,ReadResourceResultOutcome). RequestMetaObject,NotificationMetaObject,ResultMetaObject: purpose-specific_metashapes replacing the generic, undifferentiatedMetaObjecton requests/notifications/results.RequestMetaObjectnow carries per-request protocol negotiation state (protocolVersion,clientCapabilities,clientInfo).- New error types:
HeaderMismatchError(-32020),MissingRequiredClientCapabilityError(-32021),UnsupportedProtocolVersionError(-32022). CacheScopeenum (public/private) and requiredttlMs/cacheScopefields on cacheable list/read results.SamplingMessageContentBlockrestricted content-block union (deprecated on arrival, SEP-2577).LoggingMessageNotificationwrapper class (deprecated on arrival, SEP-2577), joining the pre-existingLoggingMessageNotificationParams.
- Changed (breaking):
_metais now required (non-nullableRequestMetaObject) onRequestParams,PaginatedRequestParams, and every concrete*RequestParamstype — protocol version and capabilities are declared on every request instead of once viainitialize.Resultgained a required-on-the-wireresultTypefield (defaults to'complete') and aResultMetaObject? $meta(was a bare, mis-serialisedmetafield writing the wrong wire key'meta'instead of'_meta').CallToolResultResponse.result,GetPromptResultResponse.result,ReadResourceResultResponse.resultare now discriminated unions (InputRequiredResult | <Result>) dispatched onresultType.CancelledNotificationmethod fixed from"notification/cancelled"to"notifications/cancelled";CancelledNotificationParams.requestIdis now required.CompleteResultCompletion.valuerenamed tovalues(matches the wire key).ResourceTemplateReference.typefixed from"ref/resource_template"to"ref/resource".ElicitRequest.methodfixed to"elicitation/create";ElicitRequestParamsis now a proper discriminated union (ElicitRequestFormParams | ElicitRequestURLParams) dispatched on amodefield (wasnode); dropped the unspecifiedtask/elicitationIdfields.ResourceUpdatedNotificationParamsreshaped to{_meta?, uri}(was{resourceId, resourceType, data}).Implementation.versionis now required.Tool.inputSchema/outputSchema(ToolSchema) now round-trip arbitrary JSON Schema 2020-12 keywords losslessly viaadditionalData, alongside the existing typedproperties/required/typeconvenience fields.
- Removed:
- The entire Task system:
Task,TaskStatus,TaskMetadata,TaskStatusNotification(+Params),CreateTaskResult(+Response),GetTaskRequest(+Params),GetTaskPayloadRequest/GetTaskPayloadResult(+Response),ListTasksRequest/ListTasksResult(+Response),CancelTaskRequest/CancelTaskResult(+Response),RelatedTaskMetadata. Superseded byresultType: "input_required"+InputRequiredResult. - The
initializehandshake andping:InitializeRequest/InitializeRequestParams/InitializeResult/InitializeResultResponse,InitializedNotification,PingRequest/PingResultResponse. The 2026-07-28 schema reference no longer defines these — every request now carries its own protocol negotiation state viaRequestMetaObject, andserver/discoverreplaces capability advertisement. logging/setLevel:SetLevelRequest/SetLevelRequestParams/SetLevelResultResponse. Superseded by the (deprecated)RequestMetaObject.logLevelfield.ElicitationCompleteNotification/ElicitationCompleteNotificationParams.resources/subscribe/resources/unsubscribe:SubscribeRequest/SubscribeRequestParams/SubscribeResultResponse,UnsubscribeRequestParams/UnsubscribeResultResponse. Superseded bysubscriptions/listen.Tool.execution/ToolExecution(a Task-system casualty).- The dead, unused
TextResourceContentclass (singular — distinct from, and not to be confused with,TextResourceContents).
- The entire Task system:
- Deprecated (SEP-2577, remain functional for at least twelve months):
LoggingLevel,LoggingMessageNotification(+Params),RequestMetaObject.logLevel,Root,ListRootsRequest,ListRootsResult,CreateMessageRequest(+Params),CreateMessageResult,ModelHint,ModelPreferences,SamplingMessage,SamplingMessageContentBlock,ToolChoice,ToolResultContent,ToolUseContent,LegacyTitledEnumSchema.ClientCapabilities.roots/.samplingandServerCapabilities.loggingremain valid raw-map keys, now documented as deprecated.
- Added:
-
2.0.0-dev.105 Aug 2026 pre-release withdrawnNothing published for this version
-
1.0.208 May 2026Release notes
Open source →- Fixed some incorrect field types in the Dart models (e.g.
errorfield inJSONRPCErrorResponse). - Updated example code and tests to reflect these corrections.
- Added missing Dart doc comments on some public classes and fields.
- Fixed some incorrect field types in the Dart models (e.g.
-
1.0.108 May 2026 -
1.0.008 May 2026Release notes
Open source →- Full Dart model coverage for the MCP 2025-11-25 schema.
MCPbase interface withtoMap()and named factoryTypeName.toMCP(Map)on every type.MapMC<K,V>/MapModel<K,V>base classes for types whose serialised form is the map itself.McpBuilderhelper for declarative server capability registration (tools, resources, prompts, resource templates, custom methods).- JSON-RPC core types:
JSONRPCRequest,JSONRPCNotification,JSONRPCResultResponse,JSONRPCErrorResponse. - Standard error types:
ParseError,InvalidRequestError,MethodNotFoundError,InvalidParamsError,InternalError. - Initialization types:
InitializeRequest,InitializeResult,Implementation,ClientCapabilities,ServerCapabilities. - Tool types:
Tool,ToolSchema,ToolAnnotations,ToolExecution,CallToolRequest,CallToolResult,ListToolsResult. - Resource types:
Resource,ResourceTemplate,TextResourceContents,BlobResourceContents,ReadResourceResult,ListResourcesResult. - Prompt types:
Prompt,PromptArgument,PromptMessage,GetPromptResult,ListPromptsResult. - Sampling types:
CreateMessageRequest,CreateMessageResult,SamplingMessage,ModelPreferences,ModelHint,ToolChoice. - Elicitation types:
ElicitRequest,ElicitResult,StringSchema,NumberSchema,BooleanSchema,UntitledSingleSelectEnumSchema,TitledSingleSelectEnumSchema. - Task types:
Task,TaskStatus,TaskMetadata,ListTasksResult. - Content block types:
TextContent,ImageContent,AudioContent,EmbeddedResource,ResourceLink. - Notification types:
InitializedNotification,CancelledNotification,ProgressNotification,ToolListChangedNotification,ResourceListChangedNotification,LoggingMessageNotificationParams. - Miscellaneous types:
PingRequest,EmptyResult,Annotations,Role,LoggingLevel,MetaObject,Icon,Theme. - Dart doc comments on all public classes and fields.
- Comprehensive test suite covering serialisation round-trips, enum factories, error codes, and
McpBuilderregistration. - End-to-end example in
example/mcp_models_example.dart.