mcp_dart 2.3.0-dev.2 copy "mcp_dart: ^2.3.0-dev.2" to clipboard
mcp_dart: ^2.3.0-dev.2 copied to clipboard

Dart and Flutter SDK for building Model Context Protocol (MCP) servers, clients, hosts, and AI tools.

example/example.md

Examples #

These examples are runnable from a repository checkout or the published package archive. The default SDK profile prefers MCP 2026-07-28 and falls back to initialization-era peers; strict and legacy examples opt into one era explicitly.

Run these commands from the package root.

Strict MCP 2026-07-28 #

The client starts its paired server and exercises server/discover, subscriptions/listen, input_required, and non-object structured output:

dart run example/mcp_2026_07_28/client.dart

Client source and server source.

Default dual-era #

The stdio client starts its paired server, lists capabilities, calls a tool, reads a resource, and gets a prompt:

dart run example/client_stdio.dart

Stdio client and stdio server.

For Streamable HTTP, run these in separate terminals:

dart run example/streamable_https/server_streamable_https.dart
dart run example/streamable_https/client_streamable_https.dart

Streamable HTTP server and client.

MCP 2025-11-25 and earlier compatibility #

The interactive task client and server, elicitation server, and SSE server intentionally demonstrate retained initialization-era behavior.

Integrations #

Validation #

CI runs credential-free process smokes for stdio, strict MCP 2026-07-28, a Streamable HTTP tool flow against the high-level server, and representative legacy and MCP Apps paths. It tests and compiles the Anthropic, Gemini, and fetch packages, builds the Jaspr production bundle, and runs the Flutter Web service integration in Chrome through repeated tool requests, RPC-error recovery, and reconnect. Flutter widget tests cover the UI separately. Live provider and OAuth calls require credentials or external services; Jaspr browser and native-device sessions remain manual.

See the complete examples guide for setup, security boundaries, and additional recipes.

68
likes
160
points
148k
downloads

Documentation

Documentation
API reference

Publisher

verified publisherleehack.com

Weekly Downloads

Dart and Flutter SDK for building Model Context Protocol (MCP) servers, clients, hosts, and AI tools.

Repository (GitHub)
View/report issues

Topics

#mcp #model-context-protocol #ai #llm #api

Funding

Consider supporting this project:

buymeacoffee.com

License

MIT (license)

Dependencies

crypto, http, json_schema, meta

More

Packages that depend on mcp_dart