diff --git a/ts/deploy/docker-compose.yml b/ts/deploy/docker-compose.yml index 8d6839e0..9b9f9c6d 100644 --- a/ts/deploy/docker-compose.yml +++ b/ts/deploy/docker-compose.yml @@ -298,6 +298,18 @@ services: - trustgraph restart: unless-stopped + mcp-tool: + image: trustgraph-ts:local + command: ["node", "entrypoints/mcp-tool.mjs"] + environment: + - NATS_URL=nats://nats:4222 + depends_on: + nats: + condition: service_healthy + networks: + - trustgraph + restart: unless-stopped + librarian: image: trustgraph-ts:local command: ["node", "entrypoints/librarian.mjs"] diff --git a/ts/entrypoints/mcp-tool.mjs b/ts/entrypoints/mcp-tool.mjs new file mode 100644 index 00000000..3418eb71 --- /dev/null +++ b/ts/entrypoints/mcp-tool.mjs @@ -0,0 +1,6 @@ +import("../packages/flow/dist/agent/mcp-tool/service.js") + .then((m) => m.McpToolService.launch("mcp-tool")) + .catch((err) => { + console.error(err); + process.exit(1); + }); diff --git a/ts/packages/flow/src/agent/mcp-tool/service.ts b/ts/packages/flow/src/agent/mcp-tool/service.ts index 1d70d64e..6fdc2be3 100644 --- a/ts/packages/flow/src/agent/mcp-tool/service.ts +++ b/ts/packages/flow/src/agent/mcp-tool/service.ts @@ -36,9 +36,9 @@ export class McpToolService extends FlowProcessor { super(config); this.registerSpecification( - new ConsumerSpec("request", this.onRequest.bind(this)), + new ConsumerSpec("mcp-tool-request", this.onRequest.bind(this)), ); - this.registerSpecification(new ProducerSpec("response")); + this.registerSpecification(new ProducerSpec("mcp-tool-response")); this.registerConfigHandler(this.onMcpConfig.bind(this)); } @@ -79,7 +79,7 @@ export class McpToolService extends FlowProcessor { const requestId = properties.id; if (!requestId) return; - const responseProducer = flowCtx.flow.producer("response"); + const responseProducer = flowCtx.flow.producer("mcp-tool-response"); try { const result = await this.invokeTool(