GitHub Stars
0
User Rating
Not Rated
Favorites
0
Views
6
Forks
0
Issues
0
DartMCP
A Dart implementation of the Model Context Protocol (MCP) for AI agent interactions.
Overview
DartMCP is a Model Context Protocol (MCP) implementation in Dart, providing both server and client components for building interoperable AI/LLM tools and services.
Requirements
- Dart SDK 3.7.2 or later
- Works on any platform supported by Dart (macOS, Linux, Windows)
Project Structure
The project is organized into two main components:
lib/src/server.dart
: The server implementationlib/src/client.dart
: The client implementation
Dependencies
Installation
- Add DartMCP to your project:
dependencies:
dart_mcp: ^0.1.0
- Install dependencies:
dart pub get
Server
The DartMCP server component provides a Model Context Protocol server implementation in Dart. It enables AI agents and tools to interact with Dart applications using the standard MCP protocol.
Features
- Built with Dart 3.7.2+
- Implements MCP protocol over standard I/O or custom channels
- Includes support for logging, prompts, resources, and tools
- Cross-platform support
Getting Started
- Implement your server logic using
Server
fromlib/src/server.dart
. - Run your server as a Dart application:
dart run path/to/your_server.dart
Server Component Details
The server component is responsible for:
- Handling incoming MCP connections
- Managing model context and state
- Processing client requests
- Maintaining state synchronization
Location: lib/src/server.dart
Client
The DartMCP client component allows Dart applications to connect to and interact with MCP-compatible AI agents and servers.
Features
- Built with Dart 3.7.2+
- Implements MCP client over standard I/O or custom channels
- Simple API for initializing and communicating with MCP servers
- Streams for server notifications (tools, resources, logs, etc.)
Getting Started
- Use the
Client
class fromlib/src/client.dart
in your Dart application. - Example usage:
import 'package:dartmcp/dartmcp.dart';
void main() {
var client = Client();
client.main();
}
Client Component Details
The client component provides:
- Connection management to MCP servers
- Model context synchronization
- Real-time updates handling
- Client-side state management
Location: lib/src/client.dart
Example
See example/dartmcp_example.dart
for a minimal usage example.
Software Engineer | Flutter Developer (Android/iOS/Web) | SwiftUI Developer | Master of Computer Application | Building Design System (Component Library)
110
Followers
110
Repositories
6
Gists
0
Total Contributions