MCP for Dart

by leehack

Not rated
GitHub

About

A Dart SDK for building MCP servers and clients.

Details

Author
leehack
Categories
Developer Tools

Setup

Install MCP for Dart in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/leehack/mcp_dart

Follow the installation instructions in the repository README, then restart your MCP client.

mcp_dartis a dual-era Dart and Flutter SDK for MCP clients, servers, and AI hosts. It implements the complete core client/server wire surface of the locked MCP 2026-07-28 specification, retains the MCP 2025-11-25 feature set, and negotiates supported earlier initialization-based specifications.

Here, core means the normative wire requirements assigned to client and server roles by the pinned final specification. It excludes optional MCP extensions, host UI behavior, an authorization-server implementation, JSON Schema external-reference resolution, and custom JSON Schema vocabularies.

[!IMPORTANT] The current stable packages aremcp_dart 2.4.1andmcp_dart_cli 0.2.0; the CLI's^2.3.0SDK constraint accepts 2.4. Current source passes every scored requirement in the official alpha.11 MCP2025-11-25and2026-07-28client and server sets, including all 25 required 2026 authorization scenarios, plus bidirectional published TypeScript SDK 2.0.0 and Python SDK 2.0.0 interoperability.

The project is pursuingMCP SDK Tier 1. Tier 1 is not yet claimed or assigned. The technical baseline is green; the remaining official audit, repository-governance, and SDK Working Group steps are tracked in theroadmapand48-feature coverage inventory.

The public maintenance contract is documented in thecontribution guide,security policy,dependency policy, andversioning policy.

SDK-only generated projects retain the SDK's Dart 3.4 minimum. CLI projects use Dart 3.12 because the CLI and its toolchain target that release.

Use the latest stable package for production projects:

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

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

The SDK and CLI are versioned independently. The stable CLI's^2.3.0constraint remains compatible with the 2.4 SDK.

For direct SDK integration, start with thegetting-started guide. The CLI below is optional and provides scaffolding, inspection, and conformance commands.

- MCP servers, clients, and host integrations with null-safe Dart APIs.
- Core tools, resources, prompts, completion, elicitation, subscriptions, logging, roots, and sampling APIs with behavior selected for the negotiated protocol era. MCP 2026-07-28 logging is retained for compatibility but is deprecated upstream.
- Stdio, Streamable HTTP, IO stream, and custom transports.
- OAuth client discovery/PKCE hooks, server authentication callbacks, DNS rebinding protection, and strict Streamable HTTP validation.
- An experimental Tasks extension implementation, MCP Apps metadata helpers, and generic extension negotiation. Extensions are separate from core protocol coverage; Tasks is not an official extension or part of the SDK's core conformance claim.
- Automated MCP 2025-11-25 and MCP 2026-07-28 conformance, bidirectional published TypeScript SDK 2.0.0 interoperability, bidirectional Python SDK 2.0.0 interoperability, real-browser transport tests, a real Flutter Web service integration in Chrome, deterministic widget tests, and an independent pinned JSON Schema Test Suite gate.
- mcp_dart 2.4.1hardens Streamable HTTP access and JSON-RPC error diagnostics and retains the deprecated, opt-in legacy HTTP+SSE client with same-origin routing and bidirectional interoperability against official TypeScript SDK 1.30.0 and Python SDK 2.0.0 peers.

MCP has three roles: a host owns the user experience, a client connects that host to one server, and a server exposes tools, resources, and prompts. A host can manage multiple clients and servers.

UsestableProtocolVersionordefaultProtocolVersionfor MCP2026-07-28.previewProtocolVersionremains as a deprecated alias for applications built against a 2.3 prerelease.latestInitializationProtocolVersionremains2025-11-25when the default profile falls back to the legacy lifecycle. For compatibility,latestProtocolVersionandsupportedProtocolVersionsretain their mcp_dart 2.2 initialization-era values; useallSupportedProtocolVersionsfor the dual-era list.

Select a profile only when you need to constrain negotiation:

final legacyClient = McpClient( const Implementation(name: 'my-client', version: '1.0.0'), options: const McpClientOptions(protocol: McpProtocol.legacy), ); final strict2026Server = McpServer( const Implementation(name: 'my-server', version: '1.0.0'), options: const McpServerOptions(protocol: McpProtocol.require2026), );

See theMCP 2026-07-28 transition guidefor fallback rules and APIs specific to MCP 2026-07-28, or run thestrict MCP 2026-07-28 example. Applications upgrading from the stable 2.2 line should also follow the2.2 to 2.3 migration guide.

dart pub global activate mcp_dart_cli 0.2.0 mcp_dart create my_server cd my_server mcp_dart inspect

The0.2.0CLI creates a project withmcp_dart: ^2.3.0. The inspector launches the generated stdio server itself. After leaving the interactive inspector, you can run a single tool directly:

mcp_dart inspect --tool add --json-args '{"a": 1, "b": 2}'

See theCLI documentationfor command options and scope.

- Start:getting started,server guide,client guide,quick reference
- Upgrade:
2.2 to 2.3 migration guide,migration cookbooks,MCP 2026-07-28 transition guide
- Build:
tools,transports,examples,MCP Apps
- Deploy:
Streamable HTTP security,OAuth examples,Flutter recipes
- Verify:
interop matrix,MCP 2025-11-25 coverage,MCP 2026-07-28 coverage,day-0 runbook

Standalone integration examples may declare newer Dart SDK requirements; check each example README before running it.

StreamableHttpClientTransportsupportsOAuthClientProviderand optional authorization-code discovery. Servers can useauthenticatororauthenticationHandlerand publish protected-resource metadata.

The checked-in OAuth examples store tokens in plaintext files for local learning. Production applications must use platform secure storage or an encrypted credential service. See theOAuth examplesandStreamable HTTP authentication.

Do not expose example HTTP servers directly to untrusted networks. Production deployments should use TLS, authenticate requests, and configure the documentedHost and Origin protections.

Legacy HTTP+SSE is deprecated under MCP SEP-2596 and is retained only for explicit compatibility. Use Streamable HTTP for new remote integrations.

SeeFlutter host and client recipesfor lifecycle and secure-storage guidance.

The Dart team maintainsdart_mcpindart-lang/ai. Choose it when you prefer the Dart team's APIs. Choosemcp_dartwhen you need this SDK's transport, security, compatibility, extension, and inspection surface. Re-check both packages' current releases before a production decision.

- Issues and bug reports
-
Contribution and issue-triage policy
-
Security policy
-
Dependency policy
-
Versioning policy
-
Tier 1 roadmap
-
SDK on pub.dev
-
2.4.1 API reference
-
Changelog
-
MCP 2026-07-28 specification
-
MCP 2025-11-25 specification

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

Create crafted UI components inspired by the best 21st.dev design engineers.

Bring agent evaluations, observability, and synthetic test set generation directly into your IDE for free with Galileo's new MCP server

An MCP server to help AI assistants to answer questions and generate AccelByte Extend SDK code more effectively .

MCP server for AI Diagram Maker — generate beautiful software engineering diagrams directly inside Cursor, Claude Desktop, Claude Code, or any MCP-compatible AI agent

ALAPI MCP Tools,Call hundreds of API interfaces via MCP

AI-powered SVG animation generator that transforms static files into animated SVG components using the Allyson platform

MCP server that gives AI assistants on-demand access to 1,500+ amCharts docs, ~300 code examples, and 1000+ class API references.

APIMatic MCP Server is used to validate OpenAPI specifications using APIMatic. The server processes OpenAPI files and returns validation summaries by leveraging APIMatic’s API.

One shared context layer for AI agents and humans — live API specs, DB schemas, and versioned contracts across repos so every agent and teammate works from the same source of truth.

Build and deploy full-stack Next.js apps with 98 tools for React, AWS, and MongoDB

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.