mcp_models 1.0.2
mcp_models: ^1.0.2 copied to clipboard
Dart model classes for the Model Context Protocol (MCP) — tools, resources, prompts, sampling, tasks and notifications. No codegen.
1.0.2 #
- 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.
1.0.1 #
- Fixed Pubspec metadata
1.0.0 #
- 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.