Agent skill

MCP Dart Client

by leehack in leehack/mcp_dart

A skill your agent uses when connecting a Dart or Flutter app to a Model Context Protocol (MCP) server with mcpdart: creating an McpClient, launching a local server over stdio or reaching a remote…

MITAuto-check passedAgent Workflows

Install MCP Dart Client

skills CLI
$ npx skills add leehack/mcp_dart --skill mcp-dart-client -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install leehack/mcp_dart mcp-dart-client --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/leehack/mcp_dart.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/mcp-dart-client .claude/skills/mcp-dart-client && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
mcp-dart-client
GitHub stars
116
Token cost
~1.8k tokens
SKILL.md length
413 words
Files
1
Skills in repo
4
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when connecting a Dart or Flutter app to a Model Context Protocol (MCP) server with mcpdart: creating an McpClient, launching a local server over stdio or reaching a remote…

  • Connecting a Dart
  • SKILL.md covers Guidelines, Examples and More
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Flutter app to a Model Context Protocol (MCP) server with mcpdart: creating an McpClient

What it does

MCP Dart Client is an agent skill from leehack/mcp_dart. Use when connecting a Dart or Flutter app to a Model Context Protocol (MCP) server with mcpdart: creating an McpClient, launching a local server over stdio or reaching a remote one over Streamable HTTP, listing and calling tools, reading resources, getting prompts, paginating, handling tool errors, timeouts and cancellation, or exposing MCP tools to an LLM host.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Agent Workflows, covering MCP servers and Cross-platform mobile apps. It works with Model Context Protocol, Dart and Flutter. The repository describes itself as: Dart implementation of MCP SDK. The licence is MIT.

When your agent uses it

  • Connecting a Dart
  • Flutter app to a Model Context Protocol (MCP) server with mcpdart: creating an McpClient
  • Launching a local server over stdio
  • Reaching a remote one over Streamable HTTP

Example prompts

  • “/mcp-dart-client”

Requirements

  • Python 3

What it can do on your machine

Read from SKILL.md and the folder at commit 69ffef3. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are dart).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

MCP Dart Client loads about 1.8k tokens when it runs. Until then it costs about 95 tokens; SKILL.md has 413 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~95
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from leehack/mcp_dart at commit 69ffef3, republished under its MIT licence (© leehack). 413 words, ~1,836 tokens.

Download SKILL.mdSave it as .claude/skills/mcp-dart-client/SKILL.md (or your agent's skills folder).
name
mcp-dart-client
description
Use when connecting a Dart or Flutter app to a Model Context Protocol (MCP) server with mcp_dart: creating an McpClient, launching a local server over stdio or reaching a remote one over Streamable HTTP, listing and calling tools, reading resources, getting prompts, paginating, handling tool errors, timeouts and cancellation, or exposing MCP tools to an LLM host.

Building an MCP client with mcp_dart

McpClient connects to one MCP server through a transport. By default it tries MCP 2026-07-28 discovery and falls back to initialization-era versions (MCP 2025-11-25 and earlier) for legacy servers, so it works with Dart, TypeScript and Python servers alike. Import everything from package:mcp_dart/mcp_dart.dart.

Guidelines

  • Create one McpClient per server connection and always await client.close() in a finally block or when the owning object is disposed. close() also stops a spawned stdio process.
  • Pick the transport by where the server runs:
    • Local helper process (Dart VM, desktop): StdioClientTransport( StdioServerParameters(command: ..., args: [...])).
    • Remote service, browser, Flutter Web or mobile: StreamableHttpClientTransport( Uri.parse('https://host/mcp')). Browsers and mobile apps cannot spawn stdio servers.
    • SseClientTransport is deprecated legacy HTTP+SSE; use it only for old servers that lack Streamable HTTP.
  • Keep the default McpProtocol.stable profile. Pass McpClientOptions(protocol: McpProtocol.legacy) or McpProtocol.require2026 only to pin an era. The era is fixed per connection; open a new connection to change it.
  • Stdio child processes inherit the parent environment by default. To keep host secrets from a third-party server, pass a sanitized environment and includeParentEnvironment: false.
  • After connect, check client.getServerCapabilities() before optional operations (resources, prompts, completions, legacy resources.subscribe). An SDK method existing does not mean the server supports it.
  • Treat listTools() results as the source of truth for tool names and input schemas. List methods are paginated: pass nextCursor back unchanged until it is null, and stop if a cursor repeats.
  • callTool returns CallToolResult. Check result.isError first: it marks a tool-domain failure the model should see and may retry. Protocol failures (unknown tool, malformed request, timeout) throw McpError; compare error.code with ErrorCode.x.value.
  • Inspect every item in result.content (TextContent, ImageContent, AudioContent, EmbeddedResource, ResourceLink). Prefer result.structuredContent when the tool declares an outputSchema.
  • Pass RequestOptions(timeout: ..., onprogress: ..., signal: ...) to long-running calls. Cancel with a BasicAbortController; the pending future then completes with AbortError.
  • Server-initiated features need both a client capability and a handler: ClientCapabilities(sampling: ...) with client.onSamplingRequest, or ClientCapabilities(elicitation: ...) with client.onElicitRequest. Set handlers before connect, and advertise only what the host implements.
  • To hand MCP tools to an LLM, map each Tool to the provider's tool format with tool.name, tool.description and tool.inputSchema.toJson(), then forward the model's tool calls to client.callTool.
Show full SKILL.md (56 more words)Show less

Examples

Launch a local stdio server, list all tools across pages, call one and read a resource:

dart
import 'dart:io';

import 'package:mcp_dart/mcp_dart.dart';

Future<List<Tool>> listAllTools(McpClient client) async {
  final tools = <Tool>[];
  final seen = <String>{};
  String? cursor;
  do {
    final page = await client.listTools(
      params: cursor == null ? null : ListToolsRequest(cursor: cursor),
    );
    tools.addAll(page.tools);
    cursor = page.nextCursor;
    if (cursor != null && !seen.add(cursor)) {
      throw StateError('tools/list repeated cursor "$cursor"');
    }
  } while (cursor != null);
  return tools;
}

Future<void> main() async {
  final client = McpClient(
    const Implementation(name: 'notes-client', version: '1.0.0'),
  );
  try {
    await client.connect(
      StdioClientTransport(
        const StdioServerParameters(
          command: 'dart',
          args: ['run', 'bin/server.dart'],
        ),
      ),
    );
    print('connected to ${client.getServerVersion()?.name} '
        'using MCP ${client.getProtocolVersion()}');

    for (final tool in await listAllTools(client)) {
      print('${tool.name}: ${tool.description ?? ''}');
    }

    final result = await client.callTool(
      const CallToolRequest(
        name: 'add_note',
        arguments: {'id': 'todo', 'text': 'Ship the release'},
      ),
      options: const RequestOptions(timeout: Duration(seconds: 30)),
    );
    for (final content in result.content) {
      if (content is TextContent) {
        (result.isError ? stderr : stdout).writeln(content.text);
      }
    }

    if (client.getServerCapabilities()?.resources != null) {
      final read = await client.readResource(
        const ReadResourceRequest(uri: 'notes://index'),
      );
      for (final contents in read.contents) {
        if (contents is TextResourceContents) {
          print(contents.text);
        }
      }
    }
  } on McpError catch (error) {
    stderr.writeln('MCP error ${error.code}: ${error.message}');
  } finally {
    await client.close();
  }
}

Connect to a remote server, get a prompt, and cancel a slow tool call with progress:

dart
import 'package:mcp_dart/mcp_dart.dart';

Future<void> main() async {
  final client = McpClient(
    const Implementation(name: 'remote-client', version: '1.0.0'),
  );
  try {
    await client.connect(
      StreamableHttpClientTransport(Uri.parse('https://mcp.example.com/mcp')),
    );

    if (client.getServerCapabilities()?.prompts != null) {
      final prompt = await client.getPrompt(
        const GetPromptRequest(
          name: 'summarize_note',
          arguments: {'id': 'todo'},
        ),
      );
      for (final message in prompt.messages) {
        final content = message.content;
        if (content is TextContent) {
          print('${message.role.name}: ${content.text}');
        }
      }
    }

    final controller = BasicAbortController();
    final pending = client.callTool(
      const CallToolRequest(name: 'export_rows', arguments: {'rows': 5000}),
      options: RequestOptions(
        signal: controller.signal,
        onprogress: (progress) {
          print('${progress.progress}/${progress.total} ${progress.message}');
          if (progress.progress >= 1000) {
            controller.abort('User cancelled');
          }
        },
      ),
    );
    try {
      await pending;
    } on AbortError {
      print('export cancelled');
    }
  } finally {
    await client.close();
  }
}

More

© leehack, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/mcp-dart-client of leehack/mcp_dart.

Open the folder on GitHubat commit 69ffef3

Compare with similar skills

MCP Dart Client next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

MCP Dart Client compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
MCP Dart Client this skillleehack/mcp_dart116—~1.8kAutomated safety check: PassMIT
Flutter MCP E2E HarnessArenukvern/mcp_flutter385—~2.2kAutomated safety check: PassMIT
Flutter MCP Toolkit DebugArenukvern/mcp_flutter385—~4.7kAutomated safety check: PassMIT
Retrieving Developer Knowledgegoogle/skills21k—~2kAutomated safety check: PassApache-2.0
Flutter MCP Toolkit Custom ToolsArenukvern/mcp_flutter385—~1.9kAutomated safety check: PassMIT
Aaalice Dev SessionsAaalice233/Aaalice_NAI_Launcher187—~902Automated safety check: PassMIT

Similar skills

  • Flutter MCP E2E Harness

    Arenukvern/mcp_flutter

    A skill your agent uses when writing or running repeatable E2E scenarios for Flutter apps as checked-in Dart with the fluttermcpharness package (packages/harness) — build/launch the app, attach to…

    385 GitHub stars~2.2k tokensUpdated 4 days ago
    MobileAuto-check passed
  • Flutter MCP Toolkit Debug

    Arenukvern/mcp_flutter

    Diagnose problems in a running Flutter app — read logs, evaluate Dart expressions, interpret error envelopes.

    385 GitHub stars~4.7k tokensUpdated 4 days ago
    MobileAuto-check passed
  • Official

    Searches, retrieves, and synthesizes official Google developer documentation across Google Cloud, AI/Gemini, Android, Chrome, Web, Flutter, Go, Firebase, and other Google developer platforms.

    21k GitHub stars~2k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Flutter MCP Toolkit Custom Tools

    Arenukvern/mcp_flutter

    A skill your agent uses when the agent exposes app-specific surfaces by registering custom MCP tools and resources inside the Flutter app (mcptoolkit dynamic registry — AgentCallEntry, addEntries).

    385 GitHub stars~1.9k tokensUpdated 4 days ago
    MobileAuto-check passed
  • Aaalice Dev Sessions

    Aaalice233/Aaalice_NAI_Launcher

    管理 Aaalice NAI Launcher 项目专用的 Windows 与 Android Flutter 开发会话。用户提到 PC热重载、安卓热重载、启动/关闭/重建独立命令行窗口、模拟器启动异常或检查双端会话时使用。

    187 GitHub stars~902 tokensUpdated 2 days ago
    MobileAuto-check passed
  • Npgsqlrest

    NpgsqlRest/NpgsqlRest

    Build and modify REST APIs with NpgsqlRest — exposing PostgreSQL as HTTP endpoints from two sources (database functions/procedures/tables/views, and plain .sql files), driven by SQL comment…

    132 GitHub stars~7k tokensUpdated 4 days ago
    DatabasesAuto-check: notes

More from leehack/mcp_dart

  • MCP Dart Server

    leehack/mcp_dart

    A skill your agent uses when building or extending a Model Context Protocol (MCP) server in Dart with mcpdart: structuring the project, creating an McpServer, adding tools, resources, resource…

    116 GitHub stars~4.1k tokensUpdated 2 days ago
    Auto-check passed
  • MCP Dart Streamable HTTP

    leehack/mcp_dart

    A skill your agent uses when serving an MCP server over HTTP with mcpdart or connecting to a remote one: StreamableMcpServer setup, Host and Origin allowlists (DNS rebinding protection), CORS for…

    116 GitHub stars~2k tokensUpdated 2 days ago
    Auto-check passed
  • MCP Developer

    leehack/mcp_dart

    A skill your agent uses when building, testing, debugging, or reviewing Model Context Protocol servers, clients, transports, tools, resources, prompts, and agent host configuration.

    116 GitHub stars~770 tokensUpdated 2 days ago
    Auto-check passed

Categories

Questions about MCP Dart Client

What does MCP Dart Client do?

A skill your agent uses when connecting a Dart or Flutter app to a Model Context Protocol (MCP) server with mcpdart: creating an McpClient, launching a local server over stdio or reaching a remote…. MCP Dart Client is an agent skill from leehack/mcp_dart. Use when connecting a Dart or Flutter app to a Model Context Protocol (MCP) server with mcpdart: creating an McpClient, launching a local server over stdio or reaching a remote one over Streamable HTTP, listing and calling tools, reading resources, getting prompts, paginating, handling tool errors, timeouts and cancellation, or exposing MCP tools to an LLM host.

When should I use MCP Dart Client?

MCP Dart Client fits situations like: connecting a Dart; flutter app to a Model Context Protocol (MCP) server with mcpdart: creating an McpClient; launching a local server over stdio; reaching a remote one over Streamable HTTP.

How do I install MCP Dart Client in Claude Code?

Run `npx skills add leehack/mcp_dart --skill mcp-dart-client -a claude-code`. Or copy the skill folder (skills/mcp-dart-client in leehack/mcp_dart) into .claude/skills/mcp-dart-client in your project. Claude Code loads it when a task matches its description.

How do I install MCP Dart Client in Codex?

Run `npx skills add leehack/mcp_dart --skill mcp-dart-client -a codex`. Or copy the skill folder (skills/mcp-dart-client in leehack/mcp_dart) into .agents/skills/mcp-dart-client in your project. Codex loads it when a task matches its description.

Can I use MCP Dart Client in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add leehack/mcp_dart --skill mcp-dart-client -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/mcp-dart-client, .gemini/skills/mcp-dart-client, .github/skills/mcp-dart-client and .opencode/skills/mcp-dart-client in your project.

What does MCP Dart Client need to run?

SKILL.md names no scripts, command-line tools or credentials: MCP Dart Client is instructions for the agent only. Our summary lists: Python 3.

Does MCP Dart Client access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is MCP Dart Client safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does MCP Dart Client use?

MCP Dart Client is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does MCP Dart Client use?

About 1.8k tokens (SKILL.md is roughly 7.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to MCP Dart Client?

Skills that share tags, products or a category with MCP Dart Client: Flutter MCP E2E Harness (Arenukvern/mcp_flutter, 385 stars), Flutter MCP Toolkit Debug (Arenukvern/mcp_flutter, 385 stars), Retrieving Developer Knowledge (google/skills, 21k stars) and Flutter MCP Toolkit Custom Tools (Arenukvern/mcp_flutter, 385 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains MCP Dart Client?

leehack (a GitHub user) maintains it in leehack/mcp_dart, which has 116 GitHub stars. The repository holds 4 skills in this directory. The repository was last updated on October 5, 2026.

Source: leehack/mcp_dart on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.