cograph-mcp 0.1.5 → 0.1.6

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
@@ -33,6 +33,8 @@ npx -y cograph-mcp
33
33
  - `ask` — ask a natural language question; returns the answer
34
34
  - `ingest_csv` — ingest a CSV file by absolute path into a named KG
35
35
  - `view_ontology` — show types, attributes, relationships across KGs
36
+ - `evolve_ontology` — resolve a fuzzy natural-language ontology-evolution ask (no exact names needed); auto-applies high-confidence changes and returns a summary plus any proposals to confirm
37
+ - `apply_ontology_change` — confirm and commit a single proposal returned by `evolve_ontology`
36
38
 
37
39
  ## Environment
38
40
 
package/dist/index.js CHANGED
@@ -137,6 +137,83 @@ server.registerTool(
137
137
  }
138
138
  }
139
139
  );
140
+ function describeChange(c) {
141
+ const verb = c.kind === "relationship" ? `relationship "${c.name}" from ${c.subject_type} -> ${c.datatype_or_target}` : `attribute "${c.name}" (${c.datatype_or_target}) on ${c.subject_type}`;
142
+ return `[${c.action}] ${verb} \u2014 confidence ${c.confidence.toFixed(2)}: ${c.reason}`;
143
+ }
144
+ server.registerTool(
145
+ "evolve_ontology",
146
+ {
147
+ description: 'Evolve the knowledge-graph ontology from a plain-language description of the change you want. You do NOT need to know exact type, attribute, or relationship names \u2014 just describe the change in natural language (e.g. "track which company a person works for" or "people should have a birth date") and the server resolves it against the existing ontology. High-confidence changes are applied automatically; lower-confidence ones are returned as proposals for you to confirm by passing them to apply_ontology_change.',
148
+ inputSchema: {
149
+ ask: z.string().describe(
150
+ 'A plain-language description of the ontology change to make (e.g. "track which company a person works for"). No exact schema names required.'
151
+ ),
152
+ knowledge_graph: z.string().optional().describe(
153
+ "Optional name of the knowledge graph to scope the change to. Use list_knowledge_graphs to see available KGs."
154
+ )
155
+ }
156
+ },
157
+ async ({ ask, knowledge_graph }) => {
158
+ try {
159
+ const result = await client().ontologyResolve(ask, { knowledge_graph });
160
+ const lines = [result.summary];
161
+ if (result.applied.length) {
162
+ lines.push("", "Auto-applied:");
163
+ for (const c of result.applied) lines.push(` ${describeChange(c)}`);
164
+ } else {
165
+ lines.push("", "Auto-applied: none");
166
+ }
167
+ if (result.proposals.length) {
168
+ lines.push(
169
+ "",
170
+ "Proposals needing confirmation (pass one straight to apply_ontology_change):"
171
+ );
172
+ for (const c of result.proposals) lines.push(` ${describeChange(c)}`);
173
+ lines.push(
174
+ "",
175
+ "Raw proposal objects:",
176
+ JSON.stringify(result.proposals, null, 2)
177
+ );
178
+ } else {
179
+ lines.push("", "Proposals needing confirmation: none");
180
+ }
181
+ return textResult(lines.join("\n"));
182
+ } catch (err) {
183
+ return errorResult(err);
184
+ }
185
+ }
186
+ );
187
+ server.registerTool(
188
+ "apply_ontology_change",
189
+ {
190
+ description: "Confirm and apply a single ontology change proposal returned by evolve_ontology. Pass one of the raw proposal objects through unchanged as `proposal`.",
191
+ inputSchema: {
192
+ proposal: z.object({
193
+ kind: z.enum(["attribute", "relationship"]),
194
+ subject_type: z.string(),
195
+ name: z.string(),
196
+ datatype_or_target: z.string(),
197
+ action: z.enum(["reuse", "extend", "create"]),
198
+ confidence: z.number(),
199
+ reason: z.string()
200
+ }).describe(
201
+ "A ResolvedChange proposal object exactly as returned by evolve_ontology."
202
+ )
203
+ }
204
+ },
205
+ async ({ proposal }) => {
206
+ try {
207
+ const result = await client().ontologyApply(proposal);
208
+ const lines = [result.summary];
209
+ lines.push("", `Operations applied: ${result.operations}`);
210
+ lines.push(describeChange(result.applied));
211
+ return textResult(lines.join("\n"));
212
+ } catch (err) {
213
+ return errorResult(err);
214
+ }
215
+ }
216
+ );
140
217
  async function main() {
141
218
  const transport = new StdioServerTransport();
142
219
  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 { 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\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;AACrC,SAAS,SAAS;AAElB,IAAM,UAAU;AAEhB,IAAM,SAAS,IAAI;AAAA,EACjB;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AM,QAAS,EAAE,cAAc,CAAC;AAChC,YAAI,MAAM,QAAQ;AAChB,gBAAM;AAAA,YACJ,iBAAiB,MAAM,IAAI,CAAC,MAAM,OAAO,EAAE,QAAQ,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC;AAAA,UACrE;AAAA,QACF;AACA,cAAM,OAAQ,EAAE,iBAAiB,CAAC;AAClC,YAAI,KAAK,QAAQ;AACf,gBAAM;AAAA,YACJ,oBAAoB,KACjB;AAAA,cACC,CAAC,MACC,GAAG,OAAO,EAAE,aAAa,GAAG,CAAC,OAAO,OAAO,EAAE,eAAe,GAAG,CAAC;AAAA,YACpE,EACC,KAAK,IAAI,CAAC;AAAA,UACf;AAAA,QACF;AAAA,MACF;AACA,aAAO,WAAW,MAAM,KAAK,IAAI,CAAC;AAAA,IACpC,SAAS,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 { 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,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,eACX,kBAAkB,IAAI,OAAO,KAC7B,eAAe,QACb,IAAI,UACJ,OAAO,GAAG;AAClB,SAAO;AAAA,IACL,SAAS,CAAC,EAAE,MAAM,QAAiB,MAAM,IAAI,CAAC;AAAA,IAC9C,SAAS;AAAA,EACX;AACF;AAEA,OAAO;AAAA,EACL;AAAA,EACA;AAAA,IACE,aACE;AAAA,IACF,aAAa,CAAC;AAAA,EAChB;AAAA,EACA,YAAY;AACV,QAAI;AACF,YAAM,MAAM,MAAM,OAAO,EAAE,QAAQ;AACnC,UAAI,CAAC,IAAI,OAAQ,QAAO,WAAW,4BAA4B;AAC/D,YAAM,QAAQ,IAAI,IAAI,CAAC,OAAO;AAC5B,cAAM,OAAO,OAAO,GAAG,QAAQ,GAAG;AAClC,cAAM,OAAO,GAAG,cAAc,KAAK,GAAG,WAAW,KAAK;AACtD,eAAO,KAAK,IAAI,GAAG,IAAI;AAAA,MACzB,CAAC;AACD,aAAO,WAAW,MAAM,KAAK,IAAI,CAAC;AAAA,IACpC,SAAS,KAAK;AACZ,aAAO,YAAY,GAAG;AAAA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AAA,QACrB,QAAQ,EAAE,OAAO;AAAA,MACnB,CAAC,EACA;AAAA,QACC;AAAA,MAEF;AAAA,IACJ;AAAA,EACF;AAAA,EACA,OAAO,EAAE,SAAS,MAAM;AACtB,QAAI;AACF,YAAM,SAAS,MAAM,OAAO,EAAE,cAAc,QAA0B;AACtE,YAAM,QAAQ,CAAC,OAAO,OAAO;AAC7B,YAAM,KAAK,IAAI,uBAAuB,OAAO,UAAU,EAAE;AACzD,YAAM,KAAK,eAAe,OAAO,OAAO,CAAC;AACzC,aAAO,WAAW,MAAM,KAAK,IAAI,CAAC;AAAA,IACpC,SAAS,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":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cograph-mcp",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Cograph MCP server — expose knowledge graph tools to AI agents",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",