myrmo-mcp 0.26.0 → 0.27.0

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/index.js CHANGED
@@ -41,10 +41,11 @@ const USAGE = `myrmo-mcp ${VERSION}: the Myrmo MCP server and its commands.
41
41
  myrmo-mcp doctor check that this machine can use the colony, and say what to fix
42
42
  myrmo-mcp config [setting value] show or change a setting (publish, hook, ...)
43
43
  myrmo-mcp export <dir> [--skill] write the colony's trails as Markdown notes
44
+ myrmo-mcp pilot-roi [days] [--json] fetch and print the Pilot ROI Summary (tokens, time, hold-out)
44
45
  myrmo-mcp --version
45
46
 
46
47
  Docs: https://myrmo.dev/docs/reference/mcp`;
47
- const COMMANDS = ["init", "doctor", "config", "export"];
48
+ const COMMANDS = ["init", "doctor", "config", "export", "pilot-roi"];
48
49
  const INIT_USAGE = `myrmo-mcp init [options]: set up the agents on this machine to use Myrmo.
49
50
 
50
51
  (no options) every agent client found: Claude Code (plugin), Cursor, Windsurf, Gemini CLI,
@@ -136,6 +137,57 @@ if (args[0] === "export") {
136
137
  process.exit(0);
137
138
  }
138
139
  const colonyKey = process.env.MYRMO_API_KEY?.trim() || savedColony?.api_key;
140
+ if (args[0] === "pilot-roi") {
141
+ const daysArg = args.find((a, i) => i > 0 && !a.startsWith("-"));
142
+ const days = daysArg ? parseInt(daysArg, 10) || 14 : 14;
143
+ const adminKey = process.env.MYRMO_ADMIN_KEY?.trim() || colonyKey;
144
+ const url = `${colonyUrl.replace(/\/+$/, "")}/v1/admin/pilot-roi?days=${days}`;
145
+ try {
146
+ const res = await fetch(url, {
147
+ headers: {
148
+ accept: "application/json",
149
+ ...(adminKey ? { authorization: `Bearer ${adminKey}` } : {}),
150
+ },
151
+ signal: AbortSignal.timeout(10000),
152
+ });
153
+ if (!res.ok) {
154
+ const errBody = await res.text();
155
+ console.error(`Failed to fetch Pilot ROI from ${url} (${res.status}): ${errBody || res.statusText}`);
156
+ if (res.status === 401) {
157
+ console.error("Tip: Provide MYRMO_ADMIN_KEY=<admin_key> or configure MYRMO_API_KEY.");
158
+ }
159
+ process.exit(1);
160
+ }
161
+ const data = (await res.json());
162
+ if (flag("--json")) {
163
+ console.log(JSON.stringify(data, null, 2));
164
+ process.exit(0);
165
+ }
166
+ console.log(`\n=== Myrmo Pilot ROI Summary (Last ${data.days ?? days} Days) ===`);
167
+ console.log(`Colony: ${colonyUrl}`);
168
+ console.log(`Trails Searched: ${Number(data.trails_searched ?? 0).toLocaleString()}`);
169
+ console.log(`Colony Hits Followed: ${Number(data.hits_followed ?? 0).toLocaleString()}`);
170
+ console.log(`Success Rate With Colony: ${((Number(data.success_rate_with_colony) || 0) * 100).toFixed(1)}%`);
171
+ console.log(`Success Rate Without: ${((Number(data.success_rate_without_colony) || 0) * 100).toFixed(1)}% (via hold-out / baseline)`);
172
+ console.log(`Hold-outs Evaluated: ${Number(data.holdouts_evaluated ?? 0).toLocaleString()}`);
173
+ if (data.saved) {
174
+ console.log(`Tokens Saved: ~${Number(data.saved.tokens_estimated ?? 0).toLocaleString()} tokens`);
175
+ console.log(`Developer Time Saved: ~${data.saved.hours_estimated ?? 0}h (~${Number(data.saved.seconds_estimated ?? 0).toLocaleString()}s across ${data.saved.turns_saved ?? 0} turns)`);
176
+ if (data.saved.cost_dollars_estimated != null) {
177
+ console.log(`Estimated Token Savings: ~$${data.saved.cost_dollars_estimated}`);
178
+ }
179
+ }
180
+ if (data.team) {
181
+ console.log(`Active Team Members: ${data.team.active_keys ?? 0} / ${data.team.total_keys ?? 0} keys`);
182
+ }
183
+ console.log("====================================================\n");
184
+ process.exit(0);
185
+ }
186
+ catch (err) {
187
+ console.error(`Error connecting to colony at ${url}: ${err.message}`);
188
+ process.exit(1);
189
+ }
190
+ }
139
191
  /** GET /v1/version from the colony, or null. The saved key belongs to the saved colony only (fileColony matches the URL). */
140
192
  async function askVersion(timeoutMs) {
141
193
  try {
package/dist/server.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
2
  import { Colony, type PublishMode, type RejectionDetail } from "myrmo";
3
- export declare const VERSION = "0.26.0";
3
+ export declare const VERSION = "0.27.0";
4
4
  export interface ServerOptions {
5
5
  colony: Colony;
6
6
  /** Who this server acts as, for the agent to read: a prefix of the key's hash, or of the agent id. Never the key. */
package/dist/server.js CHANGED
@@ -5,7 +5,7 @@ import * as sdk from "myrmo";
5
5
  import { MyrmoError, detectEnvironment, formatResult, writeConfig } from "myrmo";
6
6
  import { z } from "zod";
7
7
  import { buildInstructions } from "./instructions.js";
8
- export const VERSION = "0.26.0"; // x-release-please-version
8
+ export const VERSION = "0.27.0"; // x-release-please-version
9
9
  const PUBLIC_HOSTS = new Set(["myrmo.dev", "www.myrmo.dev"]);
10
10
  /**
11
11
  * Whether the server runs for an organisation's colony, where agents keep its internal names. Never for the public
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myrmo-mcp",
3
- "version": "0.26.0",
3
+ "version": "0.27.0",
4
4
  "description": "Myrmo MCP server: gives Claude Code, Cursor, Windsurf and any MCP client a shared memory of solved errors. Search fixes other AI agents found, report outcomes, publish new ones.",
5
5
  "license": "Apache-2.0",
6
6
  "mcpName": "io.github.MartinM10/myrmo",
@@ -51,7 +51,7 @@
51
51
  },
52
52
  "dependencies": {
53
53
  "myrmo": ">=0.9.0 <1.0.0",
54
- "@modelcontextprotocol/sdk": "^1.31.0",
54
+ "@modelcontextprotocol/sdk": "^1.32.0",
55
55
  "zod": "^3.25.0"
56
56
  },
57
57
  "devDependencies": {