@artinet/agent-relay-mcp 0.0.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin/stdio.js CHANGED
@@ -17,17 +17,15 @@ const callerId = commands[0];
17
17
  const config = {
18
18
  callerId: callerId,
19
19
  syncInterval: SYNC_INTERVAL,
20
- scanConfig: {
21
- host: "localhost",
22
- startPort: commands?.[1] ? parseInt(commands[1]) : 3000,
23
- endPort: commands?.[2] ? parseInt(commands[2]) : 3100,
24
- threads: commands?.[3] ? parseInt(commands[3]) : 10,
25
- fallbackPath: "/.well-known/agent-card.json",
26
- },
20
+ host: "localhost",
21
+ startPort: commands?.[1] ? parseInt(commands[1]) : 3000,
22
+ endPort: commands?.[2] ? parseInt(commands[2]) : 3100,
23
+ threads: commands?.[3] ? parseInt(commands[3]) : 10,
24
+ fallbackPath: "/.well-known/agent-card.json",
27
25
  };
28
26
  const server = new RelayServer({
29
27
  name: "agent-relay-server",
30
- version: "0.0.1",
28
+ version: "0.1.0",
31
29
  }, {});
32
30
  async function runServer() {
33
31
  console.error("Starting Agent Relay MCP Server on stdio...");
@@ -5,11 +5,11 @@
5
5
  import { ServerOptions } from "@modelcontextprotocol/sdk/server/index.js";
6
6
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
7
7
  import { Implementation } from "@modelcontextprotocol/sdk/types.js";
8
- import { AgentRelayConfig } from "@artinet/agent-relay";
8
+ import { DiscoverConfig } from "@artinet/agent-relay";
9
9
  declare class RelayServer extends McpServer {
10
10
  private relay;
11
11
  constructor(info?: Implementation, options?: ServerOptions);
12
12
  close(): Promise<void>;
13
- init(config: AgentRelayConfig): Promise<void>;
13
+ init(config: DiscoverConfig): Promise<void>;
14
14
  }
15
15
  export { RelayServer };
@@ -1,8 +1,8 @@
1
1
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
- import { AgentRelay } from "@artinet/agent-relay";
2
+ import { Discover } from "@artinet/agent-relay";
3
3
  import { v4 as uuidv4 } from "uuid";
4
- import { TaskSchema, AgentCardSchema, SendMessageSuccessResultSchema, getContent, } from "@artinet/sdk";
5
- import { z } from "zod";
4
+ import * as sdk from "@artinet/sdk";
5
+ import { z } from "zod/v4";
6
6
  class RelayServer extends McpServer {
7
7
  relay = null;
8
8
  constructor(info = {
@@ -38,11 +38,11 @@ The assistant should always return the result to the user in a clear and concise
38
38
  });
39
39
  }
40
40
  async close() {
41
- await this.relay?.close();
41
+ await this.relay?.stop();
42
42
  await super.close();
43
43
  }
44
44
  async init(config) {
45
- this.relay = await AgentRelay.create(config);
45
+ this.relay = await Discover.create(config);
46
46
  this.registerTool("sendMessage", {
47
47
  title: "Send Message",
48
48
  description: "A message will be sent to the target agent and a response object containing the full details of request will be returned to the assistant. Which contains the task id and the message sent to the agent, the conversation history and the artifacts created by the agent.",
@@ -55,25 +55,28 @@ The assistant should always return the result to the user in a clear and concise
55
55
  .string()
56
56
  .describe("The id of the task that the message is related to. If not provided, a new task will be created.")
57
57
  .optional(),
58
- }).shape,
58
+ }),
59
59
  outputSchema: z.object({
60
- result: SendMessageSuccessResultSchema,
61
- }).shape,
60
+ result: sdk.A2A.SendMessageSuccessResultSchema,
61
+ }),
62
62
  }, async (args) => {
63
- const result = await this.relay?.sendMessage(args.agentId, {
64
- message: {
65
- role: "user",
66
- messageId: uuidv4(),
67
- kind: "message",
68
- parts: [{ text: args.message, kind: "text" }],
69
- taskId: args.taskId ?? uuidv4(),
63
+ const result = await this.relay?.sendMessage({
64
+ agentId: args.agentId,
65
+ messageSendParams: {
66
+ message: {
67
+ role: "user",
68
+ messageId: uuidv4(),
69
+ kind: "message",
70
+ parts: [{ text: args.message, kind: "text" }],
71
+ taskId: args.taskId ?? uuidv4(),
72
+ },
70
73
  },
71
74
  });
72
75
  return {
73
76
  content: [
74
77
  {
75
78
  type: "text",
76
- text: getContent(result) ??
79
+ text: sdk.extractTextContent(result) ??
77
80
  "No result from the agent. This may be because the agent is not responding or the message was not sent.",
78
81
  },
79
82
  ],
@@ -92,11 +95,16 @@ The assistant should always return the result to the user in a clear and concise
92
95
  .describe("The id of the agent to get the task from."),
93
96
  taskId: z.string().describe("The id of the task to get."),
94
97
  })
95
- .describe("The agent id and task query to get the status of a running task from the agent.").shape,
96
- outputSchema: TaskSchema.shape,
98
+ .describe("The agent id and task query to get the status of a running task from the agent."),
99
+ outputSchema: sdk.A2A.TaskSchema,
97
100
  }, async (args) => {
98
- const result = await this.relay?.getTask(args.agentId, {
99
- id: args.taskId,
101
+ const result = await this.relay?.getTask({
102
+ agentId: args.agentId,
103
+ taskQuery: {
104
+ id: args.taskId,
105
+ metadata: {},
106
+ historyLength: undefined,
107
+ },
100
108
  });
101
109
  return {
102
110
  content: [
@@ -119,11 +127,15 @@ The assistant should always return the result to the user in a clear and concise
119
127
  .describe("The id of the agent to cancel the task from."),
120
128
  taskId: z.string().describe("The id of the task to cancel."),
121
129
  })
122
- .describe("The agent id and task id to cancel a running task from the agent.").shape,
123
- outputSchema: TaskSchema.shape,
130
+ .describe("The agent id and task id to cancel a running task from the agent."),
131
+ outputSchema: sdk.A2A.TaskSchema,
124
132
  }, async (args) => {
125
- const result = await this.relay?.cancelTask(args.agentId, {
126
- id: args.taskId,
133
+ const result = await this.relay?.cancelTask({
134
+ agentId: args.agentId,
135
+ taskId: {
136
+ id: args.taskId,
137
+ metadata: {},
138
+ },
127
139
  });
128
140
  return {
129
141
  content: [
@@ -143,10 +155,12 @@ The assistant should always return the result to the user in a clear and concise
143
155
  agentId: z
144
156
  .string()
145
157
  .describe("The id of the agent to get the agent card from."),
146
- }).shape,
147
- outputSchema: AgentCardSchema.shape,
158
+ }),
159
+ outputSchema: sdk.A2A.AgentCardSchema,
148
160
  }, async (args) => {
149
- const result = await this.relay?.getAgentCard(args.agentId);
161
+ const result = await this.relay?.getAgentCard({
162
+ agentId: args.agentId,
163
+ });
150
164
  const text = result
151
165
  ? JSON.stringify(result, null, 2)
152
166
  : "No agent card found. This may be because the agent is not registered or the agent is not responding.";
@@ -165,10 +179,10 @@ The assistant should always return the result to the user in a clear and concise
165
179
  description: "View the agents that are registered with the relay.",
166
180
  outputSchema: z.object({
167
181
  agents: z
168
- .array(AgentCardSchema)
182
+ .array(sdk.A2A.AgentCardSchema)
169
183
  .describe("The agents that are registered with the relay."),
170
- }).shape,
171
- }, async (_) => {
184
+ }),
185
+ }, async () => {
172
186
  const result = (await this.relay?.getAgentCards()) ?? [];
173
187
  const text = result && result.length > 0
174
188
  ? JSON.stringify({ agents: result }, null, 2)
@@ -190,14 +204,14 @@ The assistant should always return the result to the user in a clear and concise
190
204
  description: "Search for agents by name, description, or skills. The query is case insensitive and will match against the entire name, description, and skills of the agents.",
191
205
  inputSchema: z.object({
192
206
  query: z.string().describe("The query to search against."),
193
- }).shape,
207
+ }),
194
208
  outputSchema: z.object({
195
209
  agents: z
196
- .array(AgentCardSchema)
210
+ .array(sdk.A2A.AgentCardSchema)
197
211
  .describe("The agents that match the query."),
198
- }).shape,
212
+ }),
199
213
  }, async (args) => {
200
- const result = (await this.relay?.searchAgents(args.query)) ?? [];
214
+ const result = (await this.relay?.searchAgents({ query: args.query })) ?? [];
201
215
  const text = result && result.length > 0
202
216
  ? JSON.stringify({ agents: result }, null, 2)
203
217
  : "No agents found. This may be because the query is not valid or the agents are not responding.";
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@artinet/agent-relay-mcp",
3
- "version": "0.0.4",
3
+ "version": "0.1.5",
4
4
  "description": "A Model Context Protocol (MCP) server for relaying messages between A2A enabled AI agents.",
5
5
  "author": "artinet",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "git+https://github.com/the-artinet-project/mcp.git#main"
9
+ "url": "git+https://github.com/the-artinet-project/artinet.git#main"
10
10
  },
11
11
  "issues": {
12
- "url": "https://github.com/the-artinet-project/mcp/issues"
12
+ "url": "https://github.com/the-artinet-project/artinet/issues"
13
13
  },
14
14
  "files": [
15
15
  "dist",
@@ -26,14 +26,9 @@
26
26
  "modelcontextprotocol",
27
27
  "mcp",
28
28
  "a2a",
29
- "agentic",
30
29
  "ai",
31
30
  "agent",
32
- "sdk",
33
31
  "artificial intelligence",
34
- "ai agent",
35
- "multi-agent",
36
- "multi-agent system",
37
32
  "orchestration"
38
33
  ],
39
34
  "type": "module",
@@ -50,27 +45,28 @@
50
45
  "prepublishOnly": "npm run clean:all && npm i && npm run build && npm test"
51
46
  },
52
47
  "dependencies": {
53
- "@artinet/sdk": "^0.5.14",
54
- "@artinet/agent-relay": "^0.0.4",
55
- "@artinet/types": "^0.0.5",
56
- "@modelcontextprotocol/sdk": "1.20.1",
48
+ "@artinet/agent-relay": "^0.1.1",
49
+ "@artinet/sdk": "^0.6.4",
50
+ "@artinet/types": "^0.0.9",
51
+ "@modelcontextprotocol/sdk": "^1.24.3",
57
52
  "p-limit": "^7.2.0",
58
53
  "portscanner": "^2.2.0",
59
- "uuid": "^11.1.0",
60
- "zod": "^3.23.8"
54
+ "uuid": "^13.0.0",
55
+ "zod": "^3.25"
61
56
  },
62
57
  "devDependencies": {
63
- "@types/node": "^20.17.50",
58
+ "@types/cors": "^2.8.17",
59
+ "@types/node": "^25.0.9",
64
60
  "@types/portscanner": "^2.1.4",
65
- "eslint": "^9.25.1",
66
- "jest": "^29.7.0",
67
- "rimraf": "^5.0.5",
68
- "ts-jest": "^29.2.5",
61
+ "eslint": "^9.39.2",
62
+ "jest": "^30.2.0",
63
+ "rimraf": "^6.1.2",
64
+ "ts-jest": "^29.4.6",
69
65
  "ts-node": "^10.9.2",
70
66
  "typescript": "^5.9.3",
71
- "typescript-eslint": "^8.31.0"
67
+ "typescript-eslint": "^8.53.0"
72
68
  },
73
69
  "engines": {
74
- "node": ">=18.9.1"
70
+ "node": ">=20.0.0"
75
71
  }
76
72
  }