@evomap/gep-mcp-server 1.0.1 → 1.0.2

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": "@evomap/gep-mcp-server",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "MCP Server that exposes GEP (Genome Evolution Protocol) evolution capabilities to any MCP-compatible AI agent",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
package/src/index.js CHANGED
@@ -23,7 +23,7 @@ const HUB_URL = process.env.EVOMAP_HUB_URL || 'https://evomap.ai';
23
23
  const runtime = new GepRuntime({ assetsDir: ASSETS_DIR, memoryDir: MEMORY_DIR });
24
24
 
25
25
  const server = new Server(
26
- { name: 'gep-mcp-server', version: '1.0.1' },
26
+ { name: 'gep-mcp-server', version: '1.0.2' },
27
27
  { capabilities: { tools: {}, resources: {} } }
28
28
  );
29
29
 
package/src/runtime.js CHANGED
@@ -16,7 +16,8 @@ export class GepRuntime {
16
16
  this.store.ensureFiles();
17
17
  }
18
18
 
19
- evolve({ context, intent }) {
19
+ evolve(args) {
20
+ const { context, intent } = args || {};
20
21
  const signals = this._extractSignals(context);
21
22
 
22
23
  if (intent) {
@@ -96,7 +97,8 @@ export class GepRuntime {
96
97
  };
97
98
  }
98
99
 
99
- recall({ query, signals }) {
100
+ recall(args) {
101
+ const { query, signals } = args || {};
100
102
  const events = this._readGraphEvents(500);
101
103
  const querySignals = signals || this._extractSignals(query);
102
104
  const queryKey = this._computeSignalKey(querySignals);
@@ -130,7 +132,8 @@ export class GepRuntime {
130
132
  };
131
133
  }
132
134
 
133
- recordOutcome({ geneId, signals, status, score, summary }) {
135
+ recordOutcome(args) {
136
+ const { geneId, signals, status, score, summary } = args || {};
134
137
  const signalKey = this._computeSignalKey(signals);
135
138
  const ev = {
136
139
  type: 'MemoryGraphEvent',
@@ -178,7 +181,8 @@ export class GepRuntime {
178
181
  };
179
182
  }
180
183
 
181
- installGene({ gene }) {
184
+ installGene(args) {
185
+ const { gene } = args || {};
182
186
  if (!gene || gene.type !== 'Gene' || !gene.id) {
183
187
  return { ok: false, error: 'Invalid gene: must have type="Gene" and a non-empty id' };
184
188
  }
@@ -188,7 +192,8 @@ export class GepRuntime {
188
192
  return { ok: true, installed: gene.id };
189
193
  }
190
194
 
191
- exportEvolution({ outputPath, agentName }) {
195
+ exportEvolution(args) {
196
+ let { outputPath, agentName } = args || {};
192
197
  const resolvedOutput = resolve(outputPath);
193
198
  const allowedRoots = [resolve(this.assetsDir), resolve(this.memoryDir, '..')];
194
199
  if (!allowedRoots.some(root => resolvedOutput.startsWith(root + '/'))) {
@@ -217,7 +222,7 @@ export class GepRuntime {
217
222
  created_at: new Date().toISOString(),
218
223
  agent_name: agentName || 'unknown',
219
224
  statistics: this.getStatus().statistics,
220
- source: { platform: 'gep-mcp-server', version: '1.0.0' },
225
+ source: { platform: 'gep-mcp-server', version: '1.0.2' },
221
226
  };
222
227
  writeFileSync(join(tmpDir, 'manifest.json'), JSON.stringify(manifest, null, 2));
223
228
 
@@ -236,7 +241,7 @@ export class GepRuntime {
236
241
  const genes = this.store.loadGenes();
237
242
  const capsules = this.store.loadCapsules();
238
243
  const events = this.store.readAllEvents();
239
- const graphEvents = this._readGraphEvents(100);
244
+ const graphEntryCount = this._countGraphEntries();
240
245
 
241
246
  const recentEvents = events.slice(-5).map(e => ({
242
247
  id: e.id,
@@ -253,7 +258,7 @@ export class GepRuntime {
253
258
  total_genes: genes.length,
254
259
  total_capsules: capsules.length,
255
260
  total_events: events.length,
256
- memory_graph_entries: graphEvents.length,
261
+ memory_graph_entries: graphEntryCount,
257
262
  success_rate: events.length > 0 ? Math.round((successCount / events.length) * 100) / 100 : 0,
258
263
  },
259
264
  recent_events: recentEvents,
@@ -372,6 +377,14 @@ export class GepRuntime {
372
377
  return 'improve success rate and efficiency';
373
378
  }
374
379
 
380
+ _countGraphEntries() {
381
+ try {
382
+ if (!existsSync(this.memoryGraphPath)) return 0;
383
+ const raw = readFileSync(this.memoryGraphPath, 'utf8');
384
+ return raw.split('\n').filter(l => l.trim()).length;
385
+ } catch { return 0; }
386
+ }
387
+
375
388
  _readGraphEvents(limit = 1000) {
376
389
  try {
377
390
  if (!existsSync(this.memoryGraphPath)) return [];