mcp_models 1.0.2 copy "mcp_models: ^1.0.2" to clipboard
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. error field in JSONRPCErrorResponse).
  • 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.
  • MCP base interface with toMap() and named factory TypeName.toMCP(Map) on every type.
  • MapMC<K,V> / MapModel<K,V> base classes for types whose serialised form is the map itself.
  • McpBuilder helper 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 McpBuilder registration.
  • End-to-end example in example/mcp_models_example.dart.
4
likes
160
points
67
downloads

Documentation

API reference

Publisher

verified publisherfinchdart.com

Weekly Downloads

Dart model classes for the Model Context Protocol (MCP) — tools, resources, prompts, sampling, tasks and notifications. No codegen.

Repository (GitHub)
View/report issues
Contributing

License

MIT (license)

More

Packages that depend on mcp_models