akashi_mcp 0.3.0 copy "akashi_mcp: ^0.3.0" to clipboard
akashi_mcp: ^0.3.0 copied to clipboard

Model Context Protocol (MCP) tools for the Akashi agent framework: connect to an MCP server via dart_mcp and expose its tools as Akashi tools an agent can call.

example/akashi_mcp_example.dart

// Connects to an MCP server over stdio and lists the tools it exposes (which
// you can then hand to a ToolLoopAgent).
//
// Usage: dart run example/akashi_mcp_example.dart <command> [args...]
//   e.g. dart run example/akashi_mcp_example.dart \
//          npx -y @modelcontextprotocol/server-everything
import 'dart:io';

import 'package:akashi_mcp/akashi_mcp.dart';

Future<void> main(List<String> argv) async {
  if (argv.isEmpty) {
    stderr.writeln('Usage: akashi_mcp_example <command> [args...]');
    exit(64);
  }

  final toolset = await McpToolset.connectStdio<Object?>(
    command: argv.first,
    args: argv.skip(1).toList(),
  );
  try {
    stdout.writeln('Discovered ${toolset.tools.length} MCP tool(s):');
    for (final tool in toolset.tools) {
      stdout.writeln('  - ${tool.name}: ${tool.description}');
    }
    // Then: final agent = ToolLoopAgent(model: model, tools: toolset.tools);
  } finally {
    await toolset.close();
  }
}
0
likes
160
points
99
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Model Context Protocol (MCP) tools for the Akashi agent framework: connect to an MCP server via dart_mcp and expose its tools as Akashi tools an agent can call.

Repository (GitHub)
View/report issues

Topics

#ai #agents #llm #mcp

License

MIT (license)

Dependencies

akashi, dart_mcp, stream_channel

More

Packages that depend on akashi_mcp