Skip to content
Back to search

mcp_dart

Dart implementation of MCP SDK

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/leehack/mcp_dart with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/leehack/mcp_dart'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/leehack--mcp-dart/badge.svg)](/listings/leehack--mcp-dart)

HTML

<a href="/listings/leehack--mcp-dart"><img src="/api/listings/leehack--mcp-dart/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Production channel

Use the latest stable package for production projects:

dart pub add mcp_dart

Pin the stable SDK release

Pin the stable 2.4 line explicitly when reproducible dependency resolution is important:

dependencies:
  mcp_dart: ^2.4.2

The snippets below use the current stable SDK line. Package versions remain separate from protocol profiles: `McpProtocol.stable` names the SDK's default compatibility policy.

The SDK and CLI are versioned independently. The stable CLI's `^2.4.2` constraint accepts SDK versions from 2.4.2 up to, but not including, 3.0.0.

AI agent skills

`mcp_dart` ships [agent skills](https://dart.dev/tools/pub/package-skills) for building servers, building clients, and serving or connecting over Streamable HTTP. Install them into your coding agent's skills directory from your app's root:

dart run skills@ get

For direct SDK integration, start with the [getting-started guide](https://github.com/leehack/mcp_dart/blob/main/doc/getting-started.md). The CLI below is optional and provides scaffolding, inspection, and conformance commands.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 259 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. # MCP (Model Context Protocol) for Dart
  2. [![Coverage](https://img.shields.io/codecov/c/github/leehack/mcp_dart)](https://app.codecov.io/gh/leehack/mcp_dart)
  3. [![Stable package](https://img.shields.io/pub/v/mcp_dart?color=blueviolet&label=stable)](https://pub.dev/packages/mcp_dart)
  4. [![likes](https://img.shields.io/pub/likes/mcp_dart?logo=dart)](https://pub.dev/packages/mcp_dart/score)
  5. `mcp_dart` is a dual-era Dart and Flutter SDK for MCP clients, servers, and AI
  6. hosts. It implements the complete core client/server wire surface of the locked
  7. MCP 2026-07-28 specification, retains the MCP 2025-11-25 feature set, and
  8. negotiates supported earlier initialization-based specifications.
  9. Here, core means the normative wire requirements assigned to client and server
  10. roles by the pinned final specification. It excludes optional MCP
  11. extensions, host UI behavior, an authorization-server implementation, JSON
  12. Schema external-reference resolution, and custom JSON Schema vocabularies.
  13. > [!IMPORTANT]
  14. > This release is `mcp_dart 2.4.4`. The separately versioned CLI is
  15. > `mcp_dart_cli 0.2.3`, which requires `mcp_dart ^2.4.4`.
  16. > Current source passes every scored requirement in the official alpha.11 MCP
  17. > `2025-11-25` and `2026-07-28` client and server sets, including all 25
  18. > required 2026 authorization scenarios, plus bidirectional published
  19. > TypeScript SDK 2.3.1 and Python SDK 2.3.0 interoperability.
  20. ## SDK Tier 1 target
  21. The project is pursuing
  22. [MCP SDK Tier 1](https://modelcontextprotocol.io/community/sdk-tiers). Tier 1
  23. is not yet claimed or assigned. The technical baseline is green; the remaining
  24. official audit, repository-governance, and SDK Working Group steps are tracked
  25. in the [roadmap](ROADMAP.md) and
  26. [48-feature coverage inventory](doc/sdk-tier-1-feature-coverage.md).
  27. The public maintenance contract is documented in the
  28. [contribution guide](CONTRIBUTING.md), [security policy](SECURITY.md),
  29. [dependency policy](DEPENDENCY_POLICY.md), and
  30. [versioning policy](VERSIONING.md).
  31. ## Requirements
  32. | Package | Minimum Dart SDK |
  33. | --- | --- |
  34. | `mcp_dart 2.4.4` | 3.4 |
  35. | `mcp_dart_cli 0.2.3` | 3.12 |
  36. SDK-only generated projects retain the SDK's Dart 3.4 minimum. CLI projects
  37. use Dart 3.12 because the CLI and its toolchain target that release.
  38. Install Dart from [dart.dev](https://dart.dev/get-dart).
  39. ## Installation
  40. ### Production channel
  41. Use the latest stable package for production projects:
  42. ```bash
  43. dart pub add mcp_dart
  44. ```
  45. ### Pin the stable SDK release
  46. Pin the stable 2.4 line explicitly when reproducible dependency resolution is
  47. important:
  48. ```yaml
  49. dependencies:
  50. mcp_dart: ^2.4.4
  51. ```
  52. The snippets below use the current stable SDK line. Package versions
  53. remain separate from protocol profiles: `McpProtocol.stable` names the SDK's
  54. default compatibility policy.
  55. The SDK and CLI are versioned independently. The stable CLI's `^2.4.4`
  56. constraint accepts SDK versions from 2.4.4 up to, but not including, 3.0.0.
  57. ### AI agent skills
  58. `mcp_dart` ships [agent skills](https://dart.dev/tools/pub/package-skills) for
  59. building servers, building clients, and serving or connecting over Streamable
  60. HTTP. Install them into your coding agent's skills directory from your app's
  61. root:
  62. ```bash
  63. dart run skills@ get
  64. ```
  65. For direct SDK integration, start with the
  66. [getting-started guide](https://github.com/leehack/mcp_dart/blob/main/doc/getting-started.md).
  67. The CLI below is optional and provides scaffolding, inspection, and conformance
  68. commands.
  69. ## What the SDK provides
  70. - MCP servers, clients, and host integrations with null-safe Dart APIs.
  71. - Core tools, resources, prompts, completion, elicitation, subscriptions,
  72. logging, roots, and sampling APIs with behavior selected for the negotiated
  73. protocol era. MCP 2026-07-28 logging is retained for compatibility but is
  74. deprecated upstream.
  75. - Stdio, Streamable HTTP, IO stream, and custom transports.
  76. - OAuth client discovery/PKCE hooks, server authentication callbacks, DNS
  77. rebinding protection, and strict Streamable HTTP validation.
  78. - An experimental Tasks extension implementation, MCP Apps metadata helpers,
  79. and generic extension negotiation. Extensions are separate from core
  80. protocol coverage; Tasks is not an official extension or part of the SDK's
  81. core conformance claim.
  82. - Automated MCP 2025-11-25 and MCP 2026-07-28 conformance, bidirectional
  83. published TypeScript SDK 2.3.1 interoperability, bidirectional Python SDK
  84. 2.3.0 interoperability, real-browser transport tests, a real Flutter Web
  85. service integration in Chrome, deterministic widget tests, and an
  86. independent pinned JSON Schema Test Suite gate.
  87. - `mcp_dart 2.4.2` bounds incoming stdio and IO stream messages to 10 MiB by
  88. default, with configurable limits for larger messages. See the
  89. [transport guide](doc/transports.md) before upgrading integrations that
  90. exchange larger frames.
  91. - Hardened Streamable HTTP access and JSON-RPC error diagnostics, plus the
  92. deprecated, opt-in legacy HTTP+SSE client with
  93. same-origin routing and bidirectional interoperability against official
  94. TypeScript SDK 1.32.1 and Python SDK 2.3.0 peers.
  95. MCP has three roles: a host owns the user experience, a client connects that
  96. host to one server, and a server exposes tools, resources, and prompts. A host
  97. can manage multiple clients and servers.
  98. ## Protocol profiles
  99. | Profile | Protocol behavior |
  100. | --- | --- |
  101. | `McpProtocol.stable` | Default dual-era profile: prefer MCP 2026-07-28, then fall back to initialization-based MCP specifications; body-only discovery probes are bounded to 5 seconds |
  102. | `McpProtocol.legacy` | Initialization-era profile: negotiate the MCP 2025-11-25, MCP 2025-06-18, MCP 2025-03-26, MCP 2024-11-05, or MCP 2024-10-07 specification |
  103. | `McpProtocol.require2026` | Require MCP 2026-07-28 and reject legacy initialization |
  104. Use `stableProtocolVersion` or `defaultProtocolVersion` for MCP `2026-07-28`.
  105. `previewProtocolVersion` remains as a deprecated alias for applications built
  106. against a 2.3 prerelease.
  107. `latestInitializationProtocolVersion` remains `2025-11-25` when the default
  108. profile falls back to the legacy lifecycle. For compatibility,
  109. `latestProtocolVersion` and `supportedProtocolVersions` retain their mcp_dart
  110. 2.2 initialization-era values; use `allSupportedProtocolVersions` for the
  111. dual-era list.
  112. Select a profile only when you need to constrain negotiation:
  113. ```dart
  114. final legacyClient = McpClient(
  115. const Implementation(name: 'my-client', version: '1.0.0'),
  116. options: const McpClientOptions(protocol: McpProtocol.legacy),
  117. );
  118. final strict2026Server = McpServer(
  119. const Implementation(name: 'my-server', version: '1.0.0'),
  120. options: const McpServerOptions(protocol: McpProtocol.require2026),
  121. );
  122. ```
  123. See the [MCP 2026-07-28 transition guide](https://github.com/leehack/mcp_dart/blob/main/doc/mcp-2026-07-28.md)
  124. for fallback rules and APIs specific to MCP 2026-07-28, or run the
  125. [strict MCP 2026-07-28 example](https://github.com/leehack/mcp_dart/tree/main/example/mcp_2026_07_28).
  126. Applications upgrading from the stable 2.2 line should also follow the
  127. [2.2 to 2.3 migration guide](https://github.com/leehack/mcp_dart/blob/main/doc/migration-2.2-to-2.3.md).
  128. ## Quick start with the CLI
  129. Install the matching stable CLI:
  130. ```bash
  131. dart pub global activate mcp_dart_cli 0.2.3
  132. mcp_dart create my_server
  133. cd my_server
  134. mcp_dart inspect
  135. ```
  136. The `0.2.3` CLI creates a project with `mcp_dart: ^2.4.4`. The inspector
  137. launches the generated stdio server itself. After leaving the interactive
  138. inspector, you can run a single tool directly:
  139. ```bash
  140. mcp_dart inspect --tool add --json-args '{"a": 1, "b": 2}'
  141. ```
  142. Useful commands:
  143. | Command | Purpose |
  144. | --- | --- |
  145. | `create` | Scaffold a Dart MCP server using the SDK channel paired with the CLI |
  146. | `serve` | Run a generated server over stdio or HTTP |
  147. | `doctor` | Check project health and connectivity |
  148. | `inspect` | Interactively use a server's capabilities |
  149. | `inspect-server` | Produce a structured report for a live server |
  150. | `inspect-client` | Run a stdio harness that inspects a connecting client |
  151. | `trace` | Proxy and record a real stdio session |
  152. | `conformance` | Run the repository's built-in protocol regression fixtures |
  153. See the [CLI documentation](https://github.com/leehack/mcp_dart/tree/main/packages/mcp_dart_cli)
  154. for command options and scope.
  155. ## Documentation
  156. - Start: [getting started](https://github.com/leehack/mcp_dart/blob/main/doc/getting-started.md), [server guide](https://github.com/leehack/mcp_dart/blob/main/doc/server-guide.md), [client guide](https://github.com/leehack/mcp_dart/blob/main/doc/client-guide.md), [quick reference](https://github.com/leehack/mcp_dart/blob/main/doc/quick-reference.md)
  157. - Upgrade: [2.2 to 2.3 migration guide](https://github.com/leehack/mcp_dart/blob/main/doc/migration-2.2-to-2.3.md), [migration cookbooks](https://github.com/leehack/mcp_dart/blob/main/doc/migration-cookbooks.md), [MCP 2026-07-28 transition guide](https://github.com/leehack/mcp_dart/blob/main/doc/mcp-2026-07-28.md)
  158. - Build: [tools](https://github.com/leehack/mcp_dart/blob/main/doc/tools.md), [transports](https://github.com/leehack/mcp_dart/blob/main/doc/transports.md), [examples](https://github.com/leehack/mcp_dart/blob/main/doc/examples.md), [MCP Apps](https://github.com/leehack/mcp_dart/blob/main/doc/mcp-apps.md)
  159. - Deploy: [Streamable HTTP security](https://github.com/leehack/mcp_dart/blob/main/doc/transports.md#dns-rebinding-protection), [OAuth examples](https://github.com/leehack/mcp_dart/tree/main/example/authentication), [Flutter recipes](https://github.com/leehack/mcp_dart/blob/main/doc/flutter-recipes.md)
  160. - Verify: [interop matrix](https://github.com/leehack/mcp_dart/blob/main/doc/interoperability.md), [MCP 2025-11-25 coverage](https://github.com/leehack/mcp_dart/blob/main/doc/spec-coverage-2025-11-25.md), [MCP 2026-07-28 coverage](https://github.com/leehack/mcp_dart/blob/main/doc/spec-coverage-2026-07-28.md), [day-0 runbook](https://github.com/leehack/mcp_dart/blob/main/doc/mcp-2026-07-28-release-runbook.md)
  161. Standalone integration examples may declare newer Dart SDK requirements; check
  162. each example README before running it.
  163. ## Authentication
  164. `StreamableHttpClientTransport` supports `OAuthClientProvider` and optional
  165. authorization-code discovery. Servers can use `authenticator` or
  166. `authenticationHandler` and publish protected-resource metadata.
  167. The checked-in OAuth examples store tokens in plaintext files for local
  168. learning. Production applications must use platform secure storage or an
  169. encrypted credential service. See the [OAuth examples](https://github.com/leehack/mcp_dart/tree/main/example/authentication)
  170. and [Streamable HTTP authentication](https://github.com/leehack/mcp_dart/blob/main/doc/transports.md#streamable-http-authentication).
  171. Do not expose example HTTP servers directly to untrusted networks. Production
  172. deployments should use TLS, authenticate requests, and configure the documented
  173. [Host and Origin protections](https://github.com/leehack/mcp_dart/blob/main/doc/transports.md#dns-rebinding-protection).
  174. ## Platform support
  175. | Target | Stdio | Streamable HTTP | Legacy HTTP+SSE | IO/custom stream |
  176. | --- | --- | --- | --- | --- |
  177. | Dart VM / desktop server | Yes | Client and server | Client and server | Yes |
  178. | Browser / Flutter Web | No process spawning | Client | Client | Yes |
  179. | Flutter mobile | Only app-managed native helpers | Remote client | Remote client | Yes |
  180. | Flutter desktop | Local helper processes | Client and server | Client and server | Yes |
  181. Legacy HTTP+SSE is deprecated under MCP SEP-2596 and is retained only for
  182. explicit compatibility. Use Streamable HTTP for new remote integrations.
  183. See [Flutter host and client recipes](https://github.com/leehack/mcp_dart/blob/main/doc/flutter-recipes.md)
  184. for lifecycle and secure-storage guidance.
  185. ## Choosing a Dart MCP package
  186. The Dart team maintains [`dart_mcp`](https://pub.dev/packages/dart_mcp) in
  187. [`dart-lang/ai`](https://github.com/dart-lang/ai/tree/main/pkgs/dart_mcp).
  188. Choose it when you prefer the Dart team's APIs. Choose `mcp_dart` when you need
  189. this SDK's transport, security, compatibility, extension, and inspection
  190. surface. Re-check both packages' current releases before a production decision.
  191. ## Support
  192. - [Issues and bug reports](https://github.com/leehack/mcp_dart/issues)
  193. - [Contribution and issue-triage policy](https://github.com/leehack/mcp_dart/blob/main/CONTRIBUTING.md)
  194. - [Security policy](https://github.com/leehack/mcp_dart/blob/main/SECURITY.md)
  195. - [Dependency policy](https://github.com/leehack/mcp_dart/blob/main/DEPENDENCY_POLICY.md)
  196. - [Versioning policy](https://github.com/leehack/mcp_dart/blob/main/VERSIONING.md)
  197. - [Tier 1 roadmap](https://github.com/leehack/mcp_dart/blob/main/ROADMAP.md)
  198. - [SDK on pub.dev](https://pub.dev/packages/mcp_dart)
  199. - [2.4.4 API reference](https://pub.dev/documentation/mcp_dart/2.4.4/)
  200. - [Changelog](https://github.com/leehack/mcp_dart/blob/main/CHANGELOG.md)
  201. - [MCP 2026-07-28 specification](https://modelcontextprotocol.io/specification/2026-07-28)
  202. - [MCP 2025-11-25 specification](https://modelcontextprotocol.io/specification/2025-11-25)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.