replicas-mcp 0.2.18 → 0.2.20

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-mcp",
3
- "version": "0.2.18",
3
+ "version": "0.2.20",
4
4
  "license": "UNLICENSED",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "dependencies": {
16
16
  "@modelcontextprotocol/sdk": "^1.25.0",
17
- "zod": "^3.25.0"
17
+ "zod": "^4.0.0"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@types/node": "^20.11.17",
package/src/index.ts CHANGED
@@ -5,7 +5,7 @@ import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
5
5
  import {
6
6
  getCodingAgentDisplayNames,
7
7
  getProviderDisplayName,
8
- isValidCodingAgentProvider,
8
+ isValidAgentProvider,
9
9
  type AgentProvider,
10
10
  } from '../../shared/src/agent';
11
11
  import {
@@ -17,6 +17,13 @@ import {
17
17
  import {
18
18
  VALID_LIFECYCLE_POLICIES,
19
19
  } from '../../shared/src/routes/workspaces';
20
+ import { type ListEnvironmentsResponse } from '../../shared/src/routes/environment';
21
+ import {
22
+ automationRequestFromToolInput,
23
+ automationToolInputSchema,
24
+ environmentToolSummary,
25
+ REPLICAS_MCP_TOOLS,
26
+ } from '../../shared/src/replicas-mcp';
20
27
 
21
28
  const API_URL = process.env.REPLICAS_API_URL || 'https://api.replicas.dev';
22
29
  const API_KEY = process.env.REPLICAS_API_KEY;
@@ -71,7 +78,7 @@ type RegisterToolFn = (
71
78
 
72
79
  const server = new McpServer({
73
80
  name: 'replicas-mcp',
74
- version: '0.2.18',
81
+ version: '0.2.20',
75
82
  });
76
83
 
77
84
  function registerTool(
@@ -88,7 +95,7 @@ function registerTool(
88
95
  });
89
96
  }
90
97
 
91
- const codingAgentSchema = z.string().refine(isValidCodingAgentProvider, {
98
+ const codingAgentSchema = z.string().refine(isValidAgentProvider, {
92
99
  message: `Coding agent must be ${getCodingAgentDisplayNames()}`,
93
100
  });
94
101
  const lifecyclePolicySchema = z.enum(VALID_LIFECYCLE_POLICIES);
@@ -314,5 +321,22 @@ registerTool(
314
321
  (args) => api('GET', `/v1/replica/${args.id}/hooks`)
315
322
  );
316
323
 
324
+ registerTool(
325
+ REPLICAS_MCP_TOOLS.listEnvironments,
326
+ {
327
+ description: "List the organization's environments with their ids, descriptions, and repository bindings, for choosing an environment_id",
328
+ },
329
+ async () => (await api<ListEnvironmentsResponse>('GET', '/v1/environments')).environments.map(environmentToolSummary)
330
+ );
331
+
332
+ registerTool(
333
+ REPLICAS_MCP_TOOLS.createAutomation,
334
+ {
335
+ description: 'Create an organization automation that runs a prompt in an environment on a schedule or event trigger',
336
+ inputSchema: automationToolInputSchema.shape,
337
+ },
338
+ (args) => api('POST', '/v1/automations', automationRequestFromToolInput(automationToolInputSchema.parse(args)))
339
+ );
340
+
317
341
  const transport = new StdioServerTransport();
318
342
  await server.connect(transport);