update MCPClient.connectStdioServer to operate on streams and sinks (#204)

Updated MCPClient.connectStdioServer to take a stdin and stdout stream instead of a binary name and arguments. It no longer spawns processes on its own. This removes the `dart:io` dependency and allows more flexibility for how processes are spawned (can use package:process or even no process at all).

The migration is pretty easy, just launch your own process and pass in stdin/stdout from that.

- Closes https://github.com/dart-lang/ai/issues/195
- Enables the client to run on the web
- Run all tests on the web, with wasm and dart2js, as well as AOT and kernel (these tests are all very fast)
8 files changed
tree: ec54f5eee48a30a9973a3435130d32ee93347733
  1. .github/
  2. .vscode/
  3. mcp_examples/
  4. pkgs/
  5. .gitignore
  6. CONTRIBUTING.md
  7. LICENSE
  8. README.md
README.md

Overview

A general repository for AI / GenAI packages and explorations.

Packages

PackageDescriptionIssuesVersion
dart_mcpA package for making MCP servers and clients.issuespub package
dart_mcp_serverAn MCP server for Dart projects, exposing various developer tools to AI models.issuesn/a