Skip to main content

Model Context Protocol (MCP)

ACM integrates with Model Context Protocol servers to fetch deterministic context artifacts during planning and execution.

Launch a filesystem MCP server

pnpm --filter @ddse/acm-examples demo -- \
--scenario knowledge \
--use-mcp \
--mcp-server "npx -y @modelcontextprotocol/server-filesystem /tmp"

Programmatic usage

import {McpClientManager, McpToolRegistry, CombinedToolRegistry} from '@ddse/acm-mcp';

const manager = new McpClientManager();
await manager.connect({
command: 'npx',
args: ['-y', '@modelcontextprotocol/server-github']
});

const mcpRegistry = new McpToolRegistry(manager);
const toolRegistry = new CombinedToolRegistry(localTools, mcpRegistry);

Register directives with the external context provider:

contextProvider.register(mcpRegistry, {
match: directive => directive.startsWith('github:'),
buildInput: directive => ({ repo: directive.slice('github:'.length) })
});

Security & budgeting tips

  • Restrict command arguments for each MCP server (e.g., filesystem root directories).
  • Enforce policy budgets for MCP calls to avoid runaway costs.
  • Capture MCP responses inside the ledger for downstream analysis.

Supported servers in examples

ServerUse case
filesystemFetch local files for planning
githubInspect GitHub repos with GraphQL queries
brave-searchInject search results into context
memoryShare stateful artifacts between tasks

References