mcp_server
3.1.1, released 3 weeks ago by makemind.dev
Dart implementation of Model Context Protocol (MCP) servers for LLM applications.
What it does
Exposes data, tools, prompts, and resources to Large Language Model (LLM) applications through standardized protocols. Supports stdio, legacy SSE, and Streamable HTTP transports with built-in OAuth 2.1 authorization.
AI-written summary of version 3.1.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to build an MCP server in Dart to serve resources, tools, or prompts to LLMs.
- Your Flutter or Dart backend needs to securely expose local functionality or data via stdio or HTTP transports.
Skip it when
- You are just writing a standard REST or GraphQL API without LLM integration needs.
Strengths
- Supports every MCP protocol revision through 2026-07-28.
- Includes multi-transport capabilities (stdio, SSE, Streamable HTTP).
- Provides built-in JSON schema validation and OAuth 2.1 authorization.
Weaknesses
- Niche domain specific strictly to the Model Context Protocol.
- Requires careful security and session management configuration when exposed over HTTP.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- Yes (build_runner)
- Direct dependencies
- 7
No special build steps or native permissions required; works wherever dart:io is available.
import 'package:mcp_server/mcp_server.dart';
void main() {
final server = Server(
name: 'Example Server',
version: '1.0.0',
capabilities: ServerCapabilities.simple(
tools: true,
resources: true,
prompts: true,
),
);
final transportResult = McpServer.createStdioTransport();
final transport = transportResult.get();
server.connect(transport);
}Alternatives
Packages that do the same job and could replace mcp_server.
- http2
An HTTP/2 implementation in Dart for low-level transport and pooled HTTP/2 requests.
91Compare - dart_mcp
A Dart library for building Model Context Protocol (MCP) servers and clients.
87Compare - relic
Lightweight web server framework inspired by Shelf, with typed APIs and a high‑performance native Zig adapter.
91Compare - shelf_web_socket
Shelf handler that upgrades HTTP to WebSocket and provides a WebSocketChannel per connection.
80Compare
Works with
Packages commonly used together with mcp_server: ones it builds on, ones built on it, and its own family.
- cryptomcp_server depends on itProvides SHA, MD5, and HMAC hashing functions for Dart.
- uuidmcp_server depends on itGenerates and parses RFC‑4122/9562 UUIDs (v1‑v8) for Dart.
- shelfmcp_server depends on itComposable web server middleware for Dart
- json_annotationmcp_server depends on itProvides annotations for json_serializable to generate JSON (de)serialization code.
- loggingmcp_server depends on itProvides configurable logging with levels and stream listeners for Dart apps.
- mcp_clientSame familyDart client implementation for the Model Context Protocol (MCP) supporting all revisions and transports.