cograph-mcp 0.1.7 → 0.1.9

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/README.md CHANGED
@@ -29,6 +29,7 @@ npx -y cograph-mcp
29
29
 
30
30
  ## Tools exposed
31
31
 
32
+ - `agent` — the single conversational front door to the Ask-AI agent. Send a natural-language message; the agent classifies intent and either answers a question, asks a clarifying question, or proposes a multi-step plan (enrich attributes, clean/normalize values, merge duplicates, inspect/extend the ontology). A plan is **not executed** until you confirm it by calling `agent` again with the returned `plan_id` as `confirm_plan_id`. Planning is free; any paid step a plan contains (e.g. web enrichment) is authorized server-side at execute time, so confirming honors your tenant's entitlements.
32
33
  - `list_knowledge_graphs` — list available KGs and descriptions
33
34
  - `ask` — ask a natural language question; returns the answer
34
35
  - `ingest_csv` — ingest a CSV file by absolute path into a named KG
package/dist/index.js CHANGED
@@ -214,6 +214,95 @@ server.registerTool(
214
214
  }
215
215
  }
216
216
  );
217
+ function describeAgentResult(r) {
218
+ const lines = [];
219
+ switch (r.kind) {
220
+ case "answer": {
221
+ const answer = r.answer ?? "(no answer)";
222
+ lines.push(`Answer: ${answer}`);
223
+ if (r.narrative) lines.push(`
224
+ ${String(r.narrative)}`);
225
+ if (r.sparql) lines.push(`
226
+ SPARQL:
227
+ ${String(r.sparql)}`);
228
+ break;
229
+ }
230
+ case "clarify":
231
+ lines.push(
232
+ `Clarification needed: ${String(r.question ?? "Could you clarify?")}`
233
+ );
234
+ break;
235
+ case "plan": {
236
+ const steps = Array.isArray(r.steps) ? r.steps : [];
237
+ lines.push(
238
+ `Proposed plan (${steps.length} step${steps.length === 1 ? "" : "s"}) \u2014 NOT yet executed. Review, then confirm by calling agent again with confirm_plan_id="${String(r.plan_id ?? "")}".`
239
+ );
240
+ for (const s of steps) {
241
+ const cap = String(s.capability ?? "?");
242
+ const action = String(s.action ?? "?");
243
+ const rationale = s.rationale ? ` \u2014 ${String(s.rationale)}` : "";
244
+ lines.push(` \u2022 [${cap}] ${action}${rationale}`);
245
+ const cost = s.cost;
246
+ if (cost?.note) lines.push(` cost: ${String(cost.note)}`);
247
+ }
248
+ break;
249
+ }
250
+ case "result": {
251
+ const steps = Array.isArray(r.steps) ? r.steps : [];
252
+ lines.push(`Executed plan ${String(r.plan_id ?? "")}:`);
253
+ for (const s of steps) {
254
+ const status = String(s.status ?? "?");
255
+ const msg = s.message ? ` \u2014 ${String(s.message)}` : "";
256
+ lines.push(` \u2022 [${String(s.capability ?? "?")}] ${status}${msg}`);
257
+ }
258
+ break;
259
+ }
260
+ case "error":
261
+ lines.push(`Agent error: ${String(r.error ?? "unknown error")}`);
262
+ break;
263
+ default:
264
+ lines.push(`Agent returned: ${String(r.kind)}`);
265
+ }
266
+ lines.push("", "Raw result:", JSON.stringify(r, null, 2));
267
+ return lines.join("\n");
268
+ }
269
+ server.registerTool(
270
+ "agent",
271
+ {
272
+ description: "Talk to the Cograph Ask-AI agent \u2014 the single conversational front door to a knowledge graph. Send a natural-language message and the agent classifies your intent and either ANSWERS a question directly, asks a CLARIFYing question, or proposes a PLAN of actions (enrich attributes, clean/normalize values, merge duplicates, inspect/extend the ontology). A plan is NOT executed until you confirm it: call this tool again with the returned plan_id as `confirm_plan_id`. Planning is free; any paid step a plan contains (e.g. web enrichment) is authorized server-side at execute time, so confirming honors your tenant's entitlements. Prefer this over the lower-level tools for conversational, multi-step work.",
273
+ inputSchema: {
274
+ message: z.string().optional().describe(
275
+ "Your natural-language message to the agent (e.g. 'how many mentors speak Persian?' or 'enrich the company for managers'). Optional when confirm_plan_id is set (a confirm turn carries no new message)."
276
+ ),
277
+ kg_name: z.string().optional().describe(
278
+ "Knowledge graph to operate within. Use list_knowledge_graphs to see available KGs."
279
+ ),
280
+ type_name: z.string().optional().describe(
281
+ "Optional active type to scope the turn to (needed for enrich / clean / dedup planning, e.g. 'Mentor')."
282
+ ),
283
+ session_id: z.string().optional().describe(
284
+ "Optional conversation id to keep multi-turn context across calls."
285
+ ),
286
+ confirm_plan_id: z.string().optional().describe(
287
+ "When set, CONFIRM and EXECUTE the previously-proposed plan with this id (the only mutating path) instead of sending a new message. Use the plan_id from a prior 'plan' result."
288
+ )
289
+ }
290
+ },
291
+ async ({ message, kg_name, type_name, session_id, confirm_plan_id }) => {
292
+ try {
293
+ const result = await client().agent({
294
+ message,
295
+ kgName: kg_name,
296
+ typeName: type_name,
297
+ sessionId: session_id,
298
+ confirmPlanId: confirm_plan_id
299
+ });
300
+ return textResult(describeAgentResult(result));
301
+ } catch (err) {
302
+ return errorResult(err);
303
+ }
304
+ }
305
+ );
217
306
  async function main() {
218
307
  const transport = new StdioServerTransport();
219
308
  await server.connect(transport);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\nimport { Client, CographError } from \"cograph\";\nimport type { ResolvedChange } from \"cograph\";\nimport { z } from \"zod\";\n\nconst VERSION = \"0.1.0\";\n\nconst server = new McpServer(\n {\n name: \"cograph\",\n version: VERSION,\n },\n {\n instructions:\n \"Cograph is a knowledge graph platform. Use these tools to query \" +\n \"structured data across multiple knowledge graphs using natural language.\",\n },\n);\n\nfunction client(): Client {\n return new Client();\n}\n\nfunction textResult(text: string) {\n return {\n content: [{ type: \"text\" as const, text }],\n };\n}\n\nfunction errorResult(err: unknown) {\n const msg =\n err instanceof CographError\n ? `Cograph error: ${err.message}`\n : err instanceof Error\n ? err.message\n : String(err);\n return {\n content: [{ type: \"text\" as const, text: msg }],\n isError: true,\n };\n}\n\nserver.registerTool(\n \"list_knowledge_graphs\",\n {\n description:\n \"List all available knowledge graphs and their descriptions.\",\n inputSchema: {},\n },\n async () => {\n try {\n const kgs = await client().listKgs();\n if (!kgs.length) return textResult(\"No knowledge graphs found.\");\n const lines = kgs.map((kg) => {\n const name = String(kg.name ?? \"?\");\n const desc = kg.description ? `: ${kg.description}` : \"\";\n return `- ${name}${desc}`;\n });\n return textResult(lines.join(\"\\n\"));\n } catch (err) {\n return errorResult(err);\n }\n },\n);\n\nserver.registerTool(\n \"ask\",\n {\n description:\n \"Ask a natural language question against a knowledge graph. \" +\n 'Use list_knowledge_graphs to see available KGs first.',\n inputSchema: {\n question: z\n .string()\n .describe(\n 'The natural language question to ask (e.g., \"How many events are in San Francisco?\")',\n ),\n kg_name: z\n .string()\n .optional()\n .describe(\n \"Name of the knowledge graph to query. Use list_knowledge_graphs to see available KGs.\",\n ),\n },\n },\n async ({ question, kg_name }) => {\n try {\n const data = await client().ask(question, { kg: kg_name });\n const answer = data.answer ?? \"No answer\";\n const explanation = data.explanation;\n let out = `Answer: ${answer}`;\n if (explanation) out += `\\nExplanation: ${explanation}`;\n return textResult(out);\n } catch (err) {\n return errorResult(err);\n }\n },\n);\n\nserver.registerTool(\n \"ingest_csv\",\n {\n description:\n \"Ingest a CSV file into a knowledge graph. The schema is automatically inferred.\",\n inputSchema: {\n file_path: z\n .string()\n .describe(\"Absolute path to the CSV file to ingest.\"),\n kg_name: z\n .string()\n .describe(\n 'Name for the knowledge graph (e.g., \"sales-data\", \"customer-records\").',\n ),\n },\n },\n async ({ file_path, kg_name }) => {\n try {\n const result = await client().ingest(file_path, { kg: kg_name });\n const entities = Number(result.entities_resolved ?? 0);\n const triples = Number(result.triples_inserted ?? 0);\n return textResult(\n `Ingestion complete: ${entities} entities resolved, ${triples} triples inserted into \"${kg_name}\".`,\n );\n } catch (err) {\n return errorResult(err);\n }\n },\n);\n\nserver.registerTool(\n \"view_ontology\",\n {\n description:\n \"View the ontology (types, attributes, relationships) across all knowledge graphs.\",\n inputSchema: {},\n },\n async () => {\n try {\n const types = await client().ontologyTypes();\n if (!types.length) return textResult(\"No ontology types defined yet.\");\n const lines: string[] = [];\n for (const t of types) {\n const name = String(t.name ?? \"?\");\n lines.push(`Type: ${name}`);\n const attrs = (t.attributes ?? []) as Array<Record<string, unknown>>;\n if (attrs.length) {\n lines.push(\n ` Attributes: ${attrs.map((a) => String(a.name ?? \"?\")).join(\", \")}`,\n );\n }\n const rels = (t.relationships ?? []) as Array<Record<string, unknown>>;\n if (rels.length) {\n lines.push(\n ` Relationships: ${rels\n .map(\n (r) =>\n `${String(r.predicate ?? \"?\")} -> ${String(r.target_type ?? \"?\")}`,\n )\n .join(\", \")}`,\n );\n }\n }\n return textResult(lines.join(\"\\n\"));\n } catch (err) {\n return errorResult(err);\n }\n },\n);\n\nfunction describeChange(c: ResolvedChange): string {\n const verb =\n c.kind === \"relationship\"\n ? `relationship \"${c.name}\" from ${c.subject_type} -> ${c.datatype_or_target}`\n : `attribute \"${c.name}\" (${c.datatype_or_target}) on ${c.subject_type}`;\n return `[${c.action}] ${verb} — confidence ${c.confidence.toFixed(2)}: ${c.reason}`;\n}\n\nserver.registerTool(\n \"evolve_ontology\",\n {\n description:\n \"Evolve the knowledge-graph ontology from a plain-language description of \" +\n \"the change you want. You do NOT need to know exact type, attribute, or \" +\n 'relationship names — just describe the change in natural language (e.g. ' +\n '\"track which company a person works for\" or \"people should have a birth ' +\n 'date\") and the server resolves it against the existing ontology. ' +\n \"High-confidence changes are applied automatically; lower-confidence ones \" +\n \"are returned as proposals for you to confirm by passing them to \" +\n \"apply_ontology_change.\",\n inputSchema: {\n ask: z\n .string()\n .describe(\n \"A plain-language description of the ontology change to make \" +\n '(e.g. \"track which company a person works for\"). No exact schema ' +\n \"names required.\",\n ),\n knowledge_graph: z\n .string()\n .optional()\n .describe(\n \"Optional name of the knowledge graph to scope the change to. \" +\n \"Use list_knowledge_graphs to see available KGs.\",\n ),\n },\n },\n async ({ ask, knowledge_graph }) => {\n try {\n const result = await client().ontologyResolve(ask, { knowledge_graph });\n const lines: string[] = [result.summary];\n\n if (result.applied.length) {\n lines.push(\"\", \"Auto-applied:\");\n for (const c of result.applied) lines.push(` ${describeChange(c)}`);\n } else {\n lines.push(\"\", \"Auto-applied: none\");\n }\n\n if (result.proposals.length) {\n lines.push(\n \"\",\n \"Proposals needing confirmation (pass one straight to apply_ontology_change):\",\n );\n for (const c of result.proposals) lines.push(` ${describeChange(c)}`);\n lines.push(\n \"\",\n \"Raw proposal objects:\",\n JSON.stringify(result.proposals, null, 2),\n );\n } else {\n lines.push(\"\", \"Proposals needing confirmation: none\");\n }\n\n return textResult(lines.join(\"\\n\"));\n } catch (err) {\n return errorResult(err);\n }\n },\n);\n\nserver.registerTool(\n \"apply_ontology_change\",\n {\n description:\n \"Confirm and apply a single ontology change proposal returned by \" +\n \"evolve_ontology. Pass one of the raw proposal objects through unchanged \" +\n \"as `proposal`.\",\n inputSchema: {\n proposal: z\n .object({\n kind: z.enum([\"attribute\", \"relationship\"]),\n subject_type: z.string(),\n name: z.string(),\n datatype_or_target: z.string(),\n action: z.enum([\"reuse\", \"extend\", \"create\"]),\n confidence: z.number(),\n reason: z.string(),\n })\n .describe(\n \"A ResolvedChange proposal object exactly as returned by \" +\n \"evolve_ontology.\",\n ),\n },\n },\n async ({ proposal }) => {\n try {\n const result = await client().ontologyApply(proposal as ResolvedChange);\n const lines = [result.summary];\n lines.push(\"\", `Operations applied: ${result.operations}`);\n lines.push(describeChange(result.applied));\n return textResult(lines.join(\"\\n\"));\n } catch (err) {\n return errorResult(err);\n }\n },\n);\n\nasync function main(): Promise<void> {\n const transport = new StdioServerTransport();\n await server.connect(transport);\n}\n\nmain().catch((err) => {\n process.stderr.write(\n `cograph-mcp failed to start: ${err instanceof Error ? err.message : String(err)}\\n`,\n );\n process.exit(1);\n});\n"],"mappings":";;;AAAA,SAAS,iBAAiB;AAC1B,SAAS,4BAA4B;AACrC,SAAS,QAAQ,oBAAoB;AAErC,SAAS,SAAS;AAElB,IAAM,UAAU;AAEhB,IAAM,SAAS,IAAI;AAAA,EACjB;AAAA,IACE,MAAM;AAAA,IACN,SAAS;AAAA,EACX;AAAA,EACA;AAAA,IACE,cACE;AAAA,EAEJ;AACF;AAEA,SAAS,SAAiB;AACxB,SAA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,KAAK;AACZ,aAAO,YAAY,GAAG;AAAA,IACxB;AAAA,EACF;AACF;AAEA,eAAe,OAAsB;AACnC,QAAM,YAAY,IAAI,qBAAqB;AAC3C,QAAM,OAAO,QAAQ,SAAS;AAChC;AAEA,KAAK,EAAE,MAAM,CAAC,QAAQ;AACpB,UAAQ,OAAO;AAAA,IACb,gCAAgC,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,CAAC;AAAA;AAAA,EAClF;AACA,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\nimport { Client, CographError } from \"cograph\";\nimport type { AgentResult, ResolvedChange } from \"cograph\";\nimport { z } from \"zod\";\n\nconst VERSION = \"0.1.0\";\n\nconst server = new McpServer(\n {\n name: \"cograph\",\n version: VERSION,\n },\n {\n instructions:\n \"Cograph is a knowledge graph platform. Use these tools to query \" +\n \"structured data across multiple knowledge graphs using natural language.\",\n },\n);\n\nfunction client(): Client {\n return new Client();\n}\n\nfunction textResult(text: string) {\n return {\n content: [{ type: \"text\" as const, text }],\n };\n}\n\nfunction errorResult(err: unknown) {\n const msg =\n err instanceof CographError\n ? `Cograph error: ${err.message}`\n : err instanceof Error\n ? err.message\n : String(err);\n return {\n content: [{ type: \"text\" as const, text: msg }],\n isError: true,\n };\n}\n\nserver.registerTool(\n \"list_knowledge_graphs\",\n {\n description:\n \"List all available knowledge graphs and their descriptions.\",\n inputSchema: {},\n },\n async () => {\n try {\n const kgs = await client().listKgs();\n if (!kgs.length) return textResult(\"No knowledge graphs found.\");\n const lines = kgs.map((kg) => {\n const name = String(kg.name ?? \"?\");\n const desc = kg.description ? `: ${kg.description}` : \"\";\n return `- ${name}${desc}`;\n });\n return textResult(lines.join(\"\\n\"));\n } catch (err) {\n return errorResult(err);\n }\n },\n);\n\nserver.registerTool(\n \"ask\",\n {\n description:\n \"Ask a natural language question against a knowledge graph. \" +\n 'Use list_knowledge_graphs to see available KGs first.',\n inputSchema: {\n question: z\n .string()\n .describe(\n 'The natural language question to ask (e.g., \"How many events are in San Francisco?\")',\n ),\n kg_name: z\n .string()\n .optional()\n .describe(\n \"Name of the knowledge graph to query. Use list_knowledge_graphs to see available KGs.\",\n ),\n },\n },\n async ({ question, kg_name }) => {\n try {\n const data = await client().ask(question, { kg: kg_name });\n const answer = data.answer ?? \"No answer\";\n const explanation = data.explanation;\n let out = `Answer: ${answer}`;\n if (explanation) out += `\\nExplanation: ${explanation}`;\n return textResult(out);\n } catch (err) {\n return errorResult(err);\n }\n },\n);\n\nserver.registerTool(\n \"ingest_csv\",\n {\n description:\n \"Ingest a CSV file into a knowledge graph. The schema is automatically inferred.\",\n inputSchema: {\n file_path: z\n .string()\n .describe(\"Absolute path to the CSV file to ingest.\"),\n kg_name: z\n .string()\n .describe(\n 'Name for the knowledge graph (e.g., \"sales-data\", \"customer-records\").',\n ),\n },\n },\n async ({ file_path, kg_name }) => {\n try {\n const result = await client().ingest(file_path, { kg: kg_name });\n const entities = Number(result.entities_resolved ?? 0);\n const triples = Number(result.triples_inserted ?? 0);\n return textResult(\n `Ingestion complete: ${entities} entities resolved, ${triples} triples inserted into \"${kg_name}\".`,\n );\n } catch (err) {\n return errorResult(err);\n }\n },\n);\n\nserver.registerTool(\n \"view_ontology\",\n {\n description:\n \"View the ontology (types, attributes, relationships) across all knowledge graphs.\",\n inputSchema: {},\n },\n async () => {\n try {\n const types = await client().ontologyTypes();\n if (!types.length) return textResult(\"No ontology types defined yet.\");\n const lines: string[] = [];\n for (const t of types) {\n const name = String(t.name ?? \"?\");\n lines.push(`Type: ${name}`);\n const attrs = (t.attributes ?? []) as Array<Record<string, unknown>>;\n if (attrs.length) {\n lines.push(\n ` Attributes: ${attrs.map((a) => String(a.name ?? \"?\")).join(\", \")}`,\n );\n }\n const rels = (t.relationships ?? []) as Array<Record<string, unknown>>;\n if (rels.length) {\n lines.push(\n ` Relationships: ${rels\n .map(\n (r) =>\n `${String(r.predicate ?? \"?\")} -> ${String(r.target_type ?? \"?\")}`,\n )\n .join(\", \")}`,\n );\n }\n }\n return textResult(lines.join(\"\\n\"));\n } catch (err) {\n return errorResult(err);\n }\n },\n);\n\nfunction describeChange(c: ResolvedChange): string {\n const verb =\n c.kind === \"relationship\"\n ? `relationship \"${c.name}\" from ${c.subject_type} -> ${c.datatype_or_target}`\n : `attribute \"${c.name}\" (${c.datatype_or_target}) on ${c.subject_type}`;\n return `[${c.action}] ${verb} — confidence ${c.confidence.toFixed(2)}: ${c.reason}`;\n}\n\nserver.registerTool(\n \"evolve_ontology\",\n {\n description:\n \"Evolve the knowledge-graph ontology from a plain-language description of \" +\n \"the change you want. You do NOT need to know exact type, attribute, or \" +\n 'relationship names — just describe the change in natural language (e.g. ' +\n '\"track which company a person works for\" or \"people should have a birth ' +\n 'date\") and the server resolves it against the existing ontology. ' +\n \"High-confidence changes are applied automatically; lower-confidence ones \" +\n \"are returned as proposals for you to confirm by passing them to \" +\n \"apply_ontology_change.\",\n inputSchema: {\n ask: z\n .string()\n .describe(\n \"A plain-language description of the ontology change to make \" +\n '(e.g. \"track which company a person works for\"). No exact schema ' +\n \"names required.\",\n ),\n knowledge_graph: z\n .string()\n .optional()\n .describe(\n \"Optional name of the knowledge graph to scope the change to. \" +\n \"Use list_knowledge_graphs to see available KGs.\",\n ),\n },\n },\n async ({ ask, knowledge_graph }) => {\n try {\n const result = await client().ontologyResolve(ask, { knowledge_graph });\n const lines: string[] = [result.summary];\n\n if (result.applied.length) {\n lines.push(\"\", \"Auto-applied:\");\n for (const c of result.applied) lines.push(` ${describeChange(c)}`);\n } else {\n lines.push(\"\", \"Auto-applied: none\");\n }\n\n if (result.proposals.length) {\n lines.push(\n \"\",\n \"Proposals needing confirmation (pass one straight to apply_ontology_change):\",\n );\n for (const c of result.proposals) lines.push(` ${describeChange(c)}`);\n lines.push(\n \"\",\n \"Raw proposal objects:\",\n JSON.stringify(result.proposals, null, 2),\n );\n } else {\n lines.push(\"\", \"Proposals needing confirmation: none\");\n }\n\n return textResult(lines.join(\"\\n\"));\n } catch (err) {\n return errorResult(err);\n }\n },\n);\n\nserver.registerTool(\n \"apply_ontology_change\",\n {\n description:\n \"Confirm and apply a single ontology change proposal returned by \" +\n \"evolve_ontology. Pass one of the raw proposal objects through unchanged \" +\n \"as `proposal`.\",\n inputSchema: {\n proposal: z\n .object({\n kind: z.enum([\"attribute\", \"relationship\"]),\n subject_type: z.string(),\n name: z.string(),\n datatype_or_target: z.string(),\n action: z.enum([\"reuse\", \"extend\", \"create\"]),\n confidence: z.number(),\n reason: z.string(),\n })\n .describe(\n \"A ResolvedChange proposal object exactly as returned by \" +\n \"evolve_ontology.\",\n ),\n },\n },\n async ({ proposal }) => {\n try {\n const result = await client().ontologyApply(proposal as ResolvedChange);\n const lines = [result.summary];\n lines.push(\"\", `Operations applied: ${result.operations}`);\n lines.push(describeChange(result.applied));\n return textResult(lines.join(\"\\n\"));\n } catch (err) {\n return errorResult(err);\n }\n },\n);\n\n/**\n * Render a kind-tagged agent result (the shape returned by `/agent`) as readable\n * text plus the raw JSON, so an MCP client can both read a summary and act on the\n * machine-readable fields (e.g. carry a `plan_id` back into a confirm call).\n */\nfunction describeAgentResult(r: AgentResult): string {\n const lines: string[] = [];\n switch (r.kind) {\n case \"answer\": {\n const answer = (r.answer as string | undefined) ?? \"(no answer)\";\n lines.push(`Answer: ${answer}`);\n if (r.narrative) lines.push(`\\n${String(r.narrative)}`);\n if (r.sparql) lines.push(`\\nSPARQL:\\n${String(r.sparql)}`);\n break;\n }\n case \"clarify\":\n lines.push(\n `Clarification needed: ${String(r.question ?? \"Could you clarify?\")}`,\n );\n break;\n case \"plan\": {\n const steps = Array.isArray(r.steps) ? r.steps : [];\n lines.push(\n `Proposed plan (${steps.length} step${steps.length === 1 ? \"\" : \"s\"}) — ` +\n `NOT yet executed. Review, then confirm by calling agent again with ` +\n `confirm_plan_id=\"${String(r.plan_id ?? \"\")}\".`,\n );\n for (const s of steps as Array<Record<string, unknown>>) {\n const cap = String(s.capability ?? \"?\");\n const action = String(s.action ?? \"?\");\n const rationale = s.rationale ? ` — ${String(s.rationale)}` : \"\";\n lines.push(` • [${cap}] ${action}${rationale}`);\n const cost = s.cost as Record<string, unknown> | undefined;\n if (cost?.note) lines.push(` cost: ${String(cost.note)}`);\n }\n break;\n }\n case \"result\": {\n const steps = Array.isArray(r.steps) ? r.steps : [];\n lines.push(`Executed plan ${String(r.plan_id ?? \"\")}:`);\n for (const s of steps as Array<Record<string, unknown>>) {\n const status = String(s.status ?? \"?\");\n const msg = s.message ? ` — ${String(s.message)}` : \"\";\n lines.push(` • [${String(s.capability ?? \"?\")}] ${status}${msg}`);\n }\n break;\n }\n case \"error\":\n lines.push(`Agent error: ${String(r.error ?? \"unknown error\")}`);\n break;\n default:\n lines.push(`Agent returned: ${String(r.kind)}`);\n }\n // Always append the raw JSON so the caller can read structured fields\n // (plan_id, steps, rows, …) it needs to drive the next turn.\n lines.push(\"\", \"Raw result:\", JSON.stringify(r, null, 2));\n return lines.join(\"\\n\");\n}\n\nserver.registerTool(\n \"agent\",\n {\n description:\n \"Talk to the Cograph Ask-AI agent — the single conversational front door \" +\n \"to a knowledge graph. Send a natural-language message and the agent \" +\n \"classifies your intent and either ANSWERS a question directly, asks a \" +\n \"CLARIFYing question, or proposes a PLAN of actions (enrich attributes, \" +\n \"clean/normalize values, merge duplicates, inspect/extend the ontology). \" +\n \"A plan is NOT executed until you confirm it: call this tool again with \" +\n \"the returned plan_id as `confirm_plan_id`. Planning is free; any paid \" +\n \"step a plan contains (e.g. web enrichment) is authorized server-side at \" +\n \"execute time, so confirming honors your tenant's entitlements. Prefer \" +\n \"this over the lower-level tools for conversational, multi-step work.\",\n inputSchema: {\n message: z\n .string()\n .optional()\n .describe(\n \"Your natural-language message to the agent (e.g. 'how many mentors \" +\n \"speak Persian?' or 'enrich the company for managers'). Optional \" +\n \"when confirm_plan_id is set (a confirm turn carries no new message).\",\n ),\n kg_name: z\n .string()\n .optional()\n .describe(\n \"Knowledge graph to operate within. Use list_knowledge_graphs to see \" +\n \"available KGs.\",\n ),\n type_name: z\n .string()\n .optional()\n .describe(\n \"Optional active type to scope the turn to (needed for enrich / clean \" +\n \"/ dedup planning, e.g. 'Mentor').\",\n ),\n session_id: z\n .string()\n .optional()\n .describe(\n \"Optional conversation id to keep multi-turn context across calls.\",\n ),\n confirm_plan_id: z\n .string()\n .optional()\n .describe(\n \"When set, CONFIRM and EXECUTE the previously-proposed plan with this \" +\n \"id (the only mutating path) instead of sending a new message. Use \" +\n \"the plan_id from a prior 'plan' result.\",\n ),\n },\n },\n async ({ message, kg_name, type_name, session_id, confirm_plan_id }) => {\n try {\n const result = await client().agent({\n message,\n kgName: kg_name,\n typeName: type_name,\n sessionId: session_id,\n confirmPlanId: confirm_plan_id,\n });\n return textResult(describeAgentResult(result));\n } catch (err) {\n return errorResult(err);\n }\n },\n);\n\nasync function main(): Promise<void> {\n const transport = new StdioServerTransport();\n await server.connect(transport);\n}\n\nmain().catch((err) => {\n process.stderr.write(\n `cograph-mcp failed to start: ${err instanceof Error ? err.message : String(err)}\\n`,\n );\n process.exit(1);\n});\n"],"mappings":";;;AAAA,SAAS,iBAAiB;AAC1B,SAAS,4BAA4B;AACrC,SAAS,QAAQ,oBAAoB;AAErC,SAAS,SAAS;AAElB,IAAM,UAAU;AAEhB,IAAM,SAAS,IAAI;AAAA,EACjB;AAAA,IACE,MAAM;AAAA,IACN,SAAS;AAAA,EACX;AAAA,EACA;AAAA,IACE,cACE;AAAA,EAEJ;AACF;AAEA,SAAS,SAAiB;AACxB,SAAO,IAAI,OAAO;AACpB;AAEA,SAAS,WAAW,MAAc;AAChC,SAAO;AAAA,IACL,SAAS,CAAC,EAAE,MAAM,QAAiB,KAAK,CAAC;AAAA,EAC3C;AACF;AAEA,SAAS,YAAY,KAAc;AACjC,QAAM,MACJ,eAAe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AACpB,UAAQ,OAAO;AAAA,IACb,gCAAgC,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,CAAC;AAAA;AAAA,EAClF;AACA,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cograph-mcp",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "Cograph MCP server — expose knowledge graph tools to AI agents",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -29,11 +29,11 @@
29
29
  "homepage": "https://cograph.cloud",
30
30
  "repository": {
31
31
  "type": "git",
32
- "url": "git+https://github.com/git-moeen/cograph-oss.git",
32
+ "url": "git+https://github.com/git-moeen/onta-oss.git",
33
33
  "directory": "packages/cograph-mcp"
34
34
  },
35
35
  "bugs": {
36
- "url": "https://github.com/git-moeen/cograph-oss/issues"
36
+ "url": "https://github.com/git-moeen/onta-oss/issues"
37
37
  },
38
38
  "dependencies": {
39
39
  "cograph": "^0.1.0",