mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-01 09:29:38 +02:00
Add the full MCP tool pipeline enabling agents to invoke external tools (like Brave Search) via MCP servers: - Add ToolRequest/ToolResponse types and mcp-tool topics to @trustgraph/base - Create McpToolService (FlowProcessor) that connects to external MCP servers via @modelcontextprotocol/sdk StreamableHTTP transport - Add createMcpTool() to wire MCP tools into the agent's ReAct loop - Implement config-driven tool registration in AgentService with backward- compatible fallback to hardcoded tools - Add tool filtering by group and state (port of Python tool_filter.py) - Register mcp-tool in gateway dispatcher and export from @trustgraph/flow - Fix flow restart race condition: skip restart when flow definitions unchanged - Update seed config with MCP server config and tool definitions - Add run scripts for MCP tool service and Brave Search MCP server Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
18 lines
403 B
TypeScript
18 lines
403 B
TypeScript
/**
|
|
* Start the MCP tool service.
|
|
*
|
|
* Usage: pnpm tsx scripts/run-mcp-tool.ts
|
|
*
|
|
* Env:
|
|
* NATS_URL (default: nats://localhost:4222)
|
|
*/
|
|
import { McpToolService } from "../packages/flow/src/agent/mcp-tool/index.js";
|
|
|
|
async function run(): Promise<void> {
|
|
await McpToolService.launch("mcp-tool");
|
|
}
|
|
|
|
run().catch((err) => {
|
|
console.error("MCP tool service failed:", err);
|
|
process.exit(1);
|
|
});
|