AA

app-appplayer/mcp_client

API 开发

本页由 AI 翻译,技术细节请以原文为准。 查看原文

17 stars 10 forks 质量 60 趋势 35MIT

A Dart plugin for implementing Model Context Protocol (MCP) clients. This plugin allows Flutter applications to connect with MCP servers and access data, functionality, and interaction patterns from...

概览

A Dart plugin for implementing Model Context Protocol (MCP) clients. This plugin allows Flutter applications to connect with MCP servers and access data, functionality, and interaction patterns from Large Language Model (LLM) applications in a standardized way. - , 2024-11-05 through 2026-07-28, plus the 2026-07-28 tasks extension — see Protocol Versions below. connect picks the revision with the server (ProtocolEra.auto) - — sealed TransportConfig for stdio / SSE / Streamable HTTP - — the specification's authorization flow (McpOAuth): discovery, registration, PKCE, resource, iss checks, step-up - — Result from createAndConnect, plus McpError for spec error codes - : - — server data, URI templates, subscriptions - — server-side functions, progress tracking, structured output (2025-06-18+) - — reusable interaction templates with completion (2025-06-18+) - — complete(ref, argument) for completion/complete argument suggestions - — filesystem boundary configuration; the server requests...

README

以下为原文 README 节选,完整内容请查看原文。

MCP Client

A Dart plugin for implementing Model Context Protocol (MCP) clients. This plugin allows Flutter applications to connect with MCP servers and access data, functionality, and interaction patterns from Large Language Model (LLM) applications in a standardized way.

Features

  • Every MCP revision, 2024-11-05 through 2026-07-28, plus the 2026-07-28 tasks extension — see Protocol Versions below. connect picks the revision with the server (ProtocolEra.auto)
  • Unified transport configuration — sealed TransportConfig for stdio / SSE / Streamable HTTP
  • OAuth 2.1 — the specification’s authorization flow (McpOAuth): discovery, registration, PKCE, resource, iss checks, step-up
  • Result-typed error handling — Result from createAndConnect, plus McpError for spec error codes
  • Core MCP primitives:
    • Resources — server data, URI templates, subscriptions
    • Tools — server-side functions, progress tracking, structured output (2025-06-18+)
    • Prompts — reusable interaction templates with completion (2025-06-18+)
    • Completion — complete(ref, argument) for completion/complete argument suggestions
    • Roots — filesystem boundary configuration; the server requests them via roots/list
    • Sampling — register a host LLM completion handler so the server can drive sampling/createMessage
    • Elicitation (2025-06-18) — register a user-input handler so the server can collect structured input (form and URL modes)
    • Tasks (2025-11-25) — callToolAsTask, getTask, taskResult, cancelTask
  • Advanced:
    • Deferred Tool Loading — lightweight metadata + on-demand schema fetch (60–80% token reduction)
    • Progress notifications — outbound notifications/progress and inbound listener
    • Cancellation — notifyCancelled(requestId, reason) per spec notification
    • Resource subscriptions — notifications/resources/updated
    • Session management — automatic session validation and reconnection support
    • Ping — ping() probes the peer, and an inbound ping is answered automatically
  • Cross-platform: Android, iOS, web, Linux, Windows, macOS (on the web, Streamable HTTP; stdio and HTTP+SSE need dart:io)

Protocol Versions

Implements every revision of the Model Context Protocol; the one in use is agreed with each server.

Version Notes
2024-11-05 Original; HTTP+SSE transport
2025-03-26 Streamable HTTP, authorization, JSON-RPC batches
2025-06-18 Elicitation, structured tool output, resource links, MCP-Protocol-Version header; batches removed
2025-11-25 Icons, sampling with tools, URL elicitation, tasks, OIDC discovery, Client ID Metadata Documents
2026-07-28 Stateless: no handshake, server/discover, per-request _meta, subscriptions/listen, multi round-trip requests, caching hints; tasks extension
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →