@aibuildinfra/proofgraph 1.0.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.
Files changed (76) hide show
  1. package/LICENSE +21 -0
  2. package/PRIVACY.md +8 -0
  3. package/README.md +193 -0
  4. package/SECURITY.md +27 -0
  5. package/dist/cli/index.d.ts +6 -0
  6. package/dist/cli/index.js +273 -0
  7. package/dist/cli/index.js.map +1 -0
  8. package/dist/dashboard/server.d.ts +5 -0
  9. package/dist/dashboard/server.js +271 -0
  10. package/dist/dashboard/server.js.map +1 -0
  11. package/dist/data/seed.d.ts +6 -0
  12. package/dist/data/seed.js +325 -0
  13. package/dist/data/seed.js.map +1 -0
  14. package/dist/engine/aiDiscoverability.d.ts +11 -0
  15. package/dist/engine/aiDiscoverability.js +135 -0
  16. package/dist/engine/aiDiscoverability.js.map +1 -0
  17. package/dist/engine/claimVerifier.d.ts +26 -0
  18. package/dist/engine/claimVerifier.js +130 -0
  19. package/dist/engine/claimVerifier.js.map +1 -0
  20. package/dist/engine/consistencyAudit.d.ts +11 -0
  21. package/dist/engine/consistencyAudit.js +172 -0
  22. package/dist/engine/consistencyAudit.js.map +1 -0
  23. package/dist/engine/exporter.d.ts +17 -0
  24. package/dist/engine/exporter.js +83 -0
  25. package/dist/engine/exporter.js.map +1 -0
  26. package/dist/engine/graphTraversal.d.ts +25 -0
  27. package/dist/engine/graphTraversal.js +74 -0
  28. package/dist/engine/graphTraversal.js.map +1 -0
  29. package/dist/engine/resolver.d.ts +20 -0
  30. package/dist/engine/resolver.js +168 -0
  31. package/dist/engine/resolver.js.map +1 -0
  32. package/dist/engine/schemaOrg.d.ts +12 -0
  33. package/dist/engine/schemaOrg.js +105 -0
  34. package/dist/engine/schemaOrg.js.map +1 -0
  35. package/dist/engine/tokenOptimizer.d.ts +25 -0
  36. package/dist/engine/tokenOptimizer.js +166 -0
  37. package/dist/engine/tokenOptimizer.js.map +1 -0
  38. package/dist/engine/webPresence.d.ts +32 -0
  39. package/dist/engine/webPresence.js +63 -0
  40. package/dist/engine/webPresence.js.map +1 -0
  41. package/dist/index.d.ts +20 -0
  42. package/dist/index.js +35 -0
  43. package/dist/index.js.map +1 -0
  44. package/dist/mcp/prompts.d.ts +25 -0
  45. package/dist/mcp/prompts.js +136 -0
  46. package/dist/mcp/prompts.js.map +1 -0
  47. package/dist/mcp/resources.d.ts +27 -0
  48. package/dist/mcp/resources.js +118 -0
  49. package/dist/mcp/resources.js.map +1 -0
  50. package/dist/mcp/server.d.ts +15 -0
  51. package/dist/mcp/server.js +88 -0
  52. package/dist/mcp/server.js.map +1 -0
  53. package/dist/mcp/tools.d.ts +256 -0
  54. package/dist/mcp/tools.js +391 -0
  55. package/dist/mcp/tools.js.map +1 -0
  56. package/dist/security/robots.d.ts +15 -0
  57. package/dist/security/robots.js +78 -0
  58. package/dist/security/robots.js.map +1 -0
  59. package/dist/security/safeFetch.d.ts +23 -0
  60. package/dist/security/safeFetch.js +122 -0
  61. package/dist/security/safeFetch.js.map +1 -0
  62. package/dist/storage/graphStore.d.ts +70 -0
  63. package/dist/storage/graphStore.js +275 -0
  64. package/dist/storage/graphStore.js.map +1 -0
  65. package/dist/storage/sqliteAdapter.d.ts +14 -0
  66. package/dist/storage/sqliteAdapter.js +137 -0
  67. package/dist/storage/sqliteAdapter.js.map +1 -0
  68. package/dist/tests/proofgraph.test.d.ts +5 -0
  69. package/dist/tests/proofgraph.test.js +249 -0
  70. package/dist/tests/proofgraph.test.js.map +1 -0
  71. package/dist/types/index.d.ts +206 -0
  72. package/dist/types/index.js +6 -0
  73. package/dist/types/index.js.map +1 -0
  74. package/package.json +65 -0
  75. package/server.json +24 -0
  76. package/smithery.yaml +6 -0
@@ -0,0 +1,63 @@
1
+ /**
2
+ * ProofGraph Web Presence & Digital Footprint Analyzer
3
+ */
4
+ export class WebPresenceAnalyzer {
5
+ store;
6
+ constructor(store) {
7
+ this.store = store;
8
+ }
9
+ analyze(entityIdOrName, domainHint) {
10
+ let entity = this.store.getEntity(entityIdOrName);
11
+ if (!entity) {
12
+ const candidates = this.store.searchEntitiesByName(entityIdOrName, 1);
13
+ if (candidates.length > 0)
14
+ entity = candidates[0];
15
+ }
16
+ const entityName = entity?.name || entityIdOrName;
17
+ const entityId = entity?.id || `entity:organization:${entityIdOrName.toLowerCase().replace(/\s+/g, '-')}`;
18
+ const domain = domainHint || (entity?.canonical_url ? new URL(entity.canonical_url).hostname : undefined);
19
+ const allSources = this.store.getAllSources();
20
+ const relevantSources = [];
21
+ for (const src of allSources) {
22
+ const matchesDomain = domain && (src.domain === domain || src.url.includes(domain));
23
+ const matchesName = src.title.toLowerCase().includes(entityName.toLowerCase()) || src.publisher.toLowerCase().includes(entityName.toLowerCase());
24
+ if (matchesDomain || matchesName) {
25
+ relevantSources.push(src);
26
+ }
27
+ }
28
+ const breakdown = {
29
+ official_references: relevantSources.filter(s => s.trust_class === 'official_source'),
30
+ third_party_references: relevantSources.filter(s => s.trust_class === 'established_publication' || s.trust_class === 'industry_directory' || s.trust_class === 'academic_source'),
31
+ github_references: relevantSources.filter(s => s.trust_class === 'github_repository' || s.url.includes('github.com')),
32
+ package_references: relevantSources.filter(s => s.trust_class === 'package_registry' || s.url.includes('npmjs.com') || s.url.includes('pypi.org')),
33
+ registry_references: relevantSources.filter(s => s.trust_class === 'official_registry' || s.trust_class === 'standards_body'),
34
+ documentation_references: relevantSources.filter(s => s.url.includes('/docs') || s.title.toLowerCase().includes('documentation')),
35
+ social_references: relevantSources.filter(s => s.trust_class === 'social_media'),
36
+ case_studies: relevantSources.filter(s => s.title.toLowerCase().includes('case study') || s.url.includes('/case-studies/')),
37
+ };
38
+ // Detect anomalies
39
+ const anomalies = [];
40
+ if (breakdown.official_references.length === 0 && relevantSources.length > 0) {
41
+ anomalies.push('Missing direct canonical official website reference among discovered citations.');
42
+ }
43
+ if (breakdown.third_party_references.length === 0 && relevantSources.length > 0) {
44
+ anomalies.push('Low third-party corroboration footprint; entity is predominantly self-attested.');
45
+ }
46
+ const categoriesWithPresence = Object.values(breakdown).filter(arr => arr.length > 0).length;
47
+ const diversity = Number((categoriesWithPresence / 8).toFixed(2));
48
+ return {
49
+ entity_id: entityId,
50
+ entity_name: entityName,
51
+ domain,
52
+ breakdown,
53
+ detected_anomalies: anomalies,
54
+ summary: {
55
+ total_sources: relevantSources.length,
56
+ official_count: breakdown.official_references.length,
57
+ third_party_count: breakdown.third_party_references.length,
58
+ footprint_diversity: diversity,
59
+ },
60
+ };
61
+ }
62
+ }
63
+ //# sourceMappingURL=webPresence.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webPresence.js","sourceRoot":"","sources":["../../src/engine/webPresence.ts"],"names":[],"mappings":"AAAA;;GAEG;AA4BH,MAAM,OAAO,mBAAmB;IACV;IAApB,YAAoB,KAAiB;QAAjB,UAAK,GAAL,KAAK,CAAY;IAAG,CAAC;IAElC,OAAO,CAAC,cAAsB,EAAE,UAAmB;QACxD,IAAI,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;QAClD,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;YACtE,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC;gBAAE,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;QACpD,CAAC;QAED,MAAM,UAAU,GAAG,MAAM,EAAE,IAAI,IAAI,cAAc,CAAC;QAClD,MAAM,QAAQ,GAAG,MAAM,EAAE,EAAE,IAAI,uBAAuB,cAAc,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;QAC1G,MAAM,MAAM,GAAG,UAAU,IAAI,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,QAAQ,CAAC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CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC;QAC7F,MAAM,SAAS,GAAG,MAAM,CAAC,CAAC,sBAAsB,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QAElE,OAAO;YACL,SAAS,EAAE,QAAQ;YACnB,WAAW,EAAE,UAAU;YACvB,MAAM;YACN,SAAS;YACT,kBAAkB,EAAE,SAAS;YAC7B,OAAO,EAAE;gBACP,aAAa,EAAE,eAAe,CAAC,MAAM;gBACrC,cAAc,EAAE,SAAS,CAAC,mBAAmB,CAAC,MAAM;gBACpD,iBAAiB,EAAE,SAAS,CAAC,sBAAsB,CAAC,MAAM;gBAC1D,mBAAmB,EAAE,SAAS;aAC/B;SACF,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * ProofGraph - Main Entry Point
4
+ * Evidence-First Knowledge & Entity Graph MCP Server
5
+ * Developed by AI Build Infra
6
+ */
7
+ export * from './types/index.js';
8
+ export * from './storage/graphStore.js';
9
+ export * from './engine/resolver.js';
10
+ export * from './engine/tokenOptimizer.js';
11
+ export * from './engine/claimVerifier.js';
12
+ export * from './engine/graphTraversal.js';
13
+ export * from './engine/consistencyAudit.js';
14
+ export * from './engine/webPresence.js';
15
+ export * from './engine/aiDiscoverability.js';
16
+ export * from './engine/schemaOrg.js';
17
+ export * from './engine/exporter.js';
18
+ export * from './security/safeFetch.js';
19
+ export * from './security/robots.js';
20
+ export * from './data/seed.js';
package/dist/index.js ADDED
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * ProofGraph - Main Entry Point
4
+ * Evidence-First Knowledge & Entity Graph MCP Server
5
+ * Developed by AI Build Infra
6
+ */
7
+ import { ProofGraphMCPServer } from './mcp/server.js';
8
+ import { globalGraphStore } from './storage/graphStore.js';
9
+ // Export modules for library usage
10
+ export * from './types/index.js';
11
+ export * from './storage/graphStore.js';
12
+ export * from './engine/resolver.js';
13
+ export * from './engine/tokenOptimizer.js';
14
+ export * from './engine/claimVerifier.js';
15
+ export * from './engine/graphTraversal.js';
16
+ export * from './engine/consistencyAudit.js';
17
+ export * from './engine/webPresence.js';
18
+ export * from './engine/aiDiscoverability.js';
19
+ export * from './engine/schemaOrg.js';
20
+ export * from './engine/exporter.js';
21
+ export * from './security/safeFetch.js';
22
+ export * from './security/robots.js';
23
+ export * from './data/seed.js';
24
+ // If executed directly as CLI/MCP server
25
+ const isMain = process.argv[1] && (process.argv[1].endsWith('dist/index.js') ||
26
+ process.argv[1].endsWith('dist\\index.js') ||
27
+ process.argv[1].endsWith('proofgraph/dist/index.js'));
28
+ if (isMain || process.env.PROOFGRAPH_RUN_SERVER) {
29
+ const server = new ProofGraphMCPServer(globalGraphStore);
30
+ server.start().catch((err) => {
31
+ console.error('Fatal error starting ProofGraph MCP server:', err);
32
+ process.exit(1);
33
+ });
34
+ }
35
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,mCAAmC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAE/B,yCAAyC;AACzC,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAChC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC;IACzC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IAC1C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,0BAA0B,CAAC,CACrD,CAAC;AAEF,IAAI,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,CAAC;IAChD,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;IACzD,MAAM,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QAC3B,OAAO,CAAC,KAAK,CAAC,6CAA6C,EAAE,GAAG,CAAC,CAAC;QAClE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * ProofGraph MCP Prompts Implementation
3
+ * Provides structured prompts guiding AI agents to maintain evidence-first integrity
4
+ */
5
+ export declare const PROMPT_DEFINITIONS: {
6
+ name: string;
7
+ description: string;
8
+ arguments: {
9
+ name: string;
10
+ description: string;
11
+ required: boolean;
12
+ }[];
13
+ }[];
14
+ export declare class PromptHandler {
15
+ getPrompt(name: string, args: Record<string, string>): {
16
+ description: string;
17
+ messages: {
18
+ role: string;
19
+ content: {
20
+ type: string;
21
+ text: string;
22
+ };
23
+ }[];
24
+ };
25
+ }
@@ -0,0 +1,136 @@
1
+ /**
2
+ * ProofGraph MCP Prompts Implementation
3
+ * Provides structured prompts guiding AI agents to maintain evidence-first integrity
4
+ */
5
+ export const PROMPT_DEFINITIONS = [
6
+ {
7
+ name: 'verify-answer',
8
+ description: 'Instructs the AI agent to ground an answer strictly in verified ProofGraph evidence packets.',
9
+ arguments: [
10
+ { name: 'question', description: 'The question being answered', required: true },
11
+ { name: 'entity_id', description: 'Subject entity ID', required: false },
12
+ ],
13
+ },
14
+ {
15
+ name: 'research-entity',
16
+ description: 'Guides the AI agent to produce a structured entity profile backed by traceable provenance.',
17
+ arguments: [
18
+ { name: 'entity_name', description: 'Name or alias of the entity to research', required: true },
19
+ ],
20
+ },
21
+ {
22
+ name: 'trace-claim',
23
+ description: 'Instructions for generating an audit trail of why a claim is supported or refuted.',
24
+ arguments: [
25
+ { name: 'claim_statement', description: 'The claim to trace', required: true },
26
+ ],
27
+ },
28
+ {
29
+ name: 'build-evidence-summary',
30
+ description: 'Generates a concise citation-first summary respecting token budget constraints.',
31
+ arguments: [
32
+ { name: 'topic', description: 'Topic or entity to summarize', required: true },
33
+ { name: 'max_tokens', description: 'Maximum tokens (e.g. 1500)', required: false },
34
+ ],
35
+ },
36
+ {
37
+ name: 'detect-conflicts',
38
+ description: 'Instructions for analyzing contradictory claims and presenting impartial discrepancies.',
39
+ arguments: [
40
+ { name: 'claims', description: 'Comma-separated list of conflicting claims', required: true },
41
+ ],
42
+ },
43
+ ];
44
+ export class PromptHandler {
45
+ getPrompt(name, args) {
46
+ switch (name) {
47
+ case 'verify-answer':
48
+ return {
49
+ description: `Verification workflow for: "${args.question}"`,
50
+ messages: [
51
+ {
52
+ role: 'user',
53
+ content: {
54
+ type: 'text',
55
+ text: `You are answering the question: "${args.question}".
56
+ Follow the ProofGraph Evidence-First Protocol:
57
+ 1. Call get_evidence_packet(question: "${args.question}") to retrieve verified evidence.
58
+ 2. Only state claims marked as "supported" by high-trust sources.
59
+ 3. If an assertion lacks evidence, clearly state that no verifiable proof exists.
60
+ 4. Provide source attributions (Publisher, URL, Retrieval Date) for every key claim.
61
+ 5. Do not hallucinate or extrapolate beyond the compact evidence packet.`,
62
+ },
63
+ },
64
+ ],
65
+ };
66
+ case 'research-entity':
67
+ return {
68
+ description: `Entity research workflow for: "${args.entity_name}"`,
69
+ messages: [
70
+ {
71
+ role: 'user',
72
+ content: {
73
+ type: 'text',
74
+ text: `Perform an evidence-grounded investigation into entity: "${args.entity_name}".
75
+ 1. Call search_entities(query: "${args.entity_name}") to locate the canonical ID.
76
+ 2. Call explain_entity(entity_id: <canonical_id>) and find_relationships(entity_id: <canonical_id>).
77
+ 3. Synthesize:
78
+ - Canonical Identity & Aliases
79
+ - Core Products, Services, & Projects
80
+ - Verified Relationships & Dependencies
81
+ - Provenance chain and freshness of sources.`,
82
+ },
83
+ },
84
+ ],
85
+ };
86
+ case 'trace-claim':
87
+ return {
88
+ description: `Trace claim provenance for: "${args.claim_statement}"`,
89
+ messages: [
90
+ {
91
+ role: 'user',
92
+ content: {
93
+ type: 'text',
94
+ text: `Trace the complete cryptographic provenance for the claim: "${args.claim_statement}".
95
+ 1. Call trace_claim(claim: "${args.claim_statement}").
96
+ 2. Present the step-by-step chain: Claim -> Evidence Excerpt -> Source -> URL -> Timestamp -> Hash.`,
97
+ },
98
+ },
99
+ ],
100
+ };
101
+ case 'build-evidence-summary':
102
+ return {
103
+ description: `Evidence summary for: "${args.topic}"`,
104
+ messages: [
105
+ {
106
+ role: 'user',
107
+ content: {
108
+ type: 'text',
109
+ text: `Build a compact, citation-first evidence summary on: "${args.topic}" with max_tokens: ${args.max_tokens || 1500}.
110
+ 1. Call get_evidence_packet(question: "${args.topic}", max_tokens: ${args.max_tokens || 1500}).
111
+ 2. Format as a citation-first response where each paragraph links directly to verified source excerpts.`,
112
+ },
113
+ },
114
+ ],
115
+ };
116
+ case 'detect-conflicts':
117
+ return {
118
+ description: `Discrepancy detection for claims: "${args.claims}"`,
119
+ messages: [
120
+ {
121
+ role: 'user',
122
+ content: {
123
+ type: 'text',
124
+ text: `Analyze potential contradictions among the following claims: "${args.claims}".
125
+ 1. Split the claims and call compare_claims(claims: [...]).
126
+ 2. Objectively report discrepancies without manufacturing an artificial resolution unless high-trust primary evidence decisively resolves it.`,
127
+ },
128
+ },
129
+ ],
130
+ };
131
+ default:
132
+ throw new Error(`Unknown ProofGraph prompt: ${name}`);
133
+ }
134
+ }
135
+ }
136
+ //# sourceMappingURL=prompts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../src/mcp/prompts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC;QACE,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,8FAA8F;QAC3G,SAAS,EAAE;YACT,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,6BAA6B,EAAE,QAAQ,EAAE,IAAI,EAAE;YAChF,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,mBAAmB,EAAE,QAAQ,EAAE,KAAK,EAAE;SACzE;KACF;IACD;QACE,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE,4FAA4F;QACzG,SAAS,EAAE;YACT,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,yCAAyC,EAAE,QAAQ,EAAE,IAAI,EAAE;SAChG;KACF;IACD;QACE,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,oFAAoF;QACjG,SAAS,EAAE;YACT,EAAE,IAAI,EAAE,iBAAiB,EAAE,WAAW,EAAE,oBAAoB,EAAE,QAAQ,EAAE,IAAI,EAAE;SAC/E;KACF;IACD;QACE,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EAAE,iFAAiF;QAC9F,SAAS,EAAE;YACT,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,8BAA8B,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC9E,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,4BAA4B,EAAE,QAAQ,EAAE,KAAK,EAAE;SACnF;KACF;IACD;QACE,IAAI,EAAE,kBAAkB;QACxB,WAAW,EAAE,yFAAyF;QACtG,SAAS,EAAE;YACT,EAAE,IAAI,EAAE,QAAQ,EAAE,W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IAAI,EAAE,yDAAyD,IAAI,CAAC,KAAK,sBAAsB,IAAI,CAAC,UAAU,IAAI,IAAI;yCAC7F,IAAI,CAAC,KAAK,kBAAkB,IAAI,CAAC,UAAU,IAAI,IAAI;wGACY;6BACzF;yBACF;qBACF;iBACF,CAAC;YAEJ,KAAK,kBAAkB;gBACrB,OAAO;oBACL,WAAW,EAAE,sCAAsC,IAAI,CAAC,MAAM,GAAG;oBACjE,QAAQ,EAAE;wBACR;4BACE,IAAI,EAAE,MAAM;4BACZ,OAAO,EAAE;gCACP,IAAI,EAAE,MAAM;gCACZ,IAAI,EAAE,iEAAiE,IAAI,CAAC,MAAM;;8IAE4C;6BAC/H;yBACF;qBACF;iBACF,CAAC;YAEJ;gBACE,MAAM,IAAI,KAAK,CAAC,8BAA8B,IAAI,EAAE,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * ProofGraph MCP Resources Implementation
3
+ */
4
+ import { GraphStore } from '../storage/graphStore.js';
5
+ export declare const RESOURCE_TEMPLATES: {
6
+ uriTemplate: string;
7
+ name: string;
8
+ description: string;
9
+ mimeType: string;
10
+ }[];
11
+ export declare class ResourceHandler {
12
+ private store;
13
+ constructor(store: GraphStore);
14
+ getResourceList(): {
15
+ uri: string;
16
+ name: string;
17
+ description: string;
18
+ mimeType: string;
19
+ }[];
20
+ readResource(uri: string): {
21
+ contents: Array<{
22
+ uri: string;
23
+ mimeType: string;
24
+ text: string;
25
+ }>;
26
+ };
27
+ }
@@ -0,0 +1,118 @@
1
+ /**
2
+ * ProofGraph MCP Resources Implementation
3
+ */
4
+ export const RESOURCE_TEMPLATES = [
5
+ {
6
+ uriTemplate: 'proofgraph://entities/{id}',
7
+ name: 'ProofGraph Entity',
8
+ description: 'Canonical profile and relationships for a specific entity ID',
9
+ mimeType: 'application/json',
10
+ },
11
+ {
12
+ uriTemplate: 'proofgraph://claims/{id}',
13
+ name: 'ProofGraph Claim',
14
+ description: 'Status, confidence, and evidence pointers for a claim',
15
+ mimeType: 'application/json',
16
+ },
17
+ {
18
+ uriTemplate: 'proofgraph://sources/{id}',
19
+ name: 'ProofGraph Source',
20
+ description: 'Cryptographic hash, provenance, and trust classification for a source',
21
+ mimeType: 'application/json',
22
+ },
23
+ {
24
+ uriTemplate: 'proofgraph://relationships/{id}',
25
+ name: 'ProofGraph Relationship',
26
+ description: 'Direct and multi-hop relationships for an entity',
27
+ mimeType: 'application/json',
28
+ },
29
+ ];
30
+ export class ResourceHandler {
31
+ store;
32
+ constructor(store) {
33
+ this.store = store;
34
+ }
35
+ getResourceList() {
36
+ const resources = [];
37
+ for (const e of this.store.getAllEntities()) {
38
+ resources.push({
39
+ uri: `proofgraph://entities/${encodeURIComponent(e.id)}`,
40
+ name: `Entity: ${e.name}`,
41
+ description: e.description,
42
+ mimeType: 'application/json',
43
+ });
44
+ }
45
+ for (const c of this.store.getAllClaims()) {
46
+ resources.push({
47
+ uri: `proofgraph://claims/${encodeURIComponent(c.id)}`,
48
+ name: `Claim: ${c.statement}`,
49
+ description: `Status: ${c.status} (${c.confidence})`,
50
+ mimeType: 'application/json',
51
+ });
52
+ }
53
+ return resources;
54
+ }
55
+ readResource(uri) {
56
+ const parsed = new URL(uri);
57
+ const host = parsed.hostname || parsed.host;
58
+ const path = decodeURIComponent(parsed.pathname.replace(/^\//, ''));
59
+ if (host === 'entities') {
60
+ const entity = this.store.getEntity(path) || this.store.findEntityByAlias(path);
61
+ if (!entity)
62
+ throw new Error(`Entity resource not found: ${uri}`);
63
+ const rels = this.store.getRelationships(entity.id);
64
+ return {
65
+ contents: [
66
+ {
67
+ uri,
68
+ mimeType: 'application/json',
69
+ text: JSON.stringify({ entity, relationships: rels }, null, 2),
70
+ },
71
+ ],
72
+ };
73
+ }
74
+ if (host === 'claims') {
75
+ const claim = this.store.getClaim(path);
76
+ if (!claim)
77
+ throw new Error(`Claim resource not found: ${uri}`);
78
+ const evs = this.store.getEvidenceForClaim(claim.id);
79
+ return {
80
+ contents: [
81
+ {
82
+ uri,
83
+ mimeType: 'application/json',
84
+ text: JSON.stringify({ claim, evidence: evs }, null, 2),
85
+ },
86
+ ],
87
+ };
88
+ }
89
+ if (host === 'sources') {
90
+ const source = this.store.getSource(path);
91
+ if (!source)
92
+ throw new Error(`Source resource not found: ${uri}`);
93
+ return {
94
+ contents: [
95
+ {
96
+ uri,
97
+ mimeType: 'application/json',
98
+ text: JSON.stringify(source, null, 2),
99
+ },
100
+ ],
101
+ };
102
+ }
103
+ if (host === 'relationships') {
104
+ const rels = this.store.getRelationships(path);
105
+ return {
106
+ contents: [
107
+ {
108
+ uri,
109
+ mimeType: 'application/json',
110
+ text: JSON.stringify({ entity_id: path, relationships: rels }, null, 2),
111
+ },
112
+ ],
113
+ };
114
+ }
115
+ throw new Error(`Unsupported resource URI: ${uri}`);
116
+ }
117
+ }
118
+ //# sourceMappingURL=resources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources.js","sourceRoot":"","sources":["../../src/mcp/resources.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC;QACE,WAAW,EAAE,4BAA4B;QACzC,IAAI,EAAE,mBAAmB;QACzB,WAAW,EAAE,8DAA8D;QAC3E,QAAQ,EAAE,kBAAkB;KAC7B;IACD;QACE,WAAW,EAAE,0BAA0B;QACvC,IAAI,EAAE,kBAAkB;QACxB,WAAW,EAAE,uDAAuD;QACpE,QAAQ,EAAE,kBAAkB;KAC7B;IACD;QACE,WAAW,EAAE,2BAA2B;QACxC,IAAI,EAAE,mBAAmB;QACzB,WAAW,EAAE,uEAAuE;QACpF,QAAQ,EAAE,kBAAkB;KAC7B;IACD;QACE,WAAW,EAAE,iCAAiC;QAC9C,IAAI,EAAE,yBAAyB;QAC/B,WAAW,EAAE,kDAAkD;QAC/D,QAAQ,EAAE,kBAAkB;KAC7B;CACF,CAAC;AAEF,MAAM,OAAO,eAAe;IACN;IAApB,YAA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ACR;wBACE,GAAG;wBACH,QAAQ,EAAE,kBAAkB;wBAC5B,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;qBACtC;iBACF;aACF,CAAC;QACJ,CAAC;QAED,IAAI,IAAI,KAAK,eAAe,EAAE,CAAC;YAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;YAC/C,OAAO;gBACL,QAAQ,EAAE;oBACR;wBACE,GAAG;wBACH,QAAQ,EAAE,kBAAkB;wBAC5B,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;qBACxE;iBACF;aACF,CAAC;QACJ,CAAC;QAED,MAAM,IAAI,KAAK,CAAC,6BAA6B,GAAG,EAAE,CAAC,CAAC;IACtD,CAAC;CACF"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * ProofGraph MCP Server
3
+ * STDIO transport server adhering to Model Context Protocol specification
4
+ */
5
+ import { GraphStore } from '../storage/graphStore.js';
6
+ export declare class ProofGraphMCPServer {
7
+ private store;
8
+ private server;
9
+ private toolHandler;
10
+ private resourceHandler;
11
+ private promptHandler;
12
+ constructor(store?: GraphStore);
13
+ private setupHandlers;
14
+ start(): Promise<void>;
15
+ }
@@ -0,0 +1,88 @@
1
+ /**
2
+ * ProofGraph MCP Server
3
+ * STDIO transport server adhering to Model Context Protocol specification
4
+ */
5
+ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
6
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
7
+ import { CallToolRequestSchema, ListToolsRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema, ListPromptsRequestSchema, GetPromptRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
8
+ import { globalGraphStore } from '../storage/graphStore.js';
9
+ import { seedStandardGraph } from '../data/seed.js';
10
+ import { TOOL_DEFINITIONS, ToolHandler } from './tools.js';
11
+ import { ResourceHandler } from './resources.js';
12
+ import { PROMPT_DEFINITIONS, PromptHandler } from './prompts.js';
13
+ export class ProofGraphMCPServer {
14
+ store;
15
+ server;
16
+ toolHandler;
17
+ resourceHandler;
18
+ promptHandler;
19
+ constructor(store = globalGraphStore) {
20
+ this.store = store;
21
+ this.server = new Server({
22
+ name: 'io.github.AI-BuildInfra/proofgraph',
23
+ version: '1.0.0',
24
+ }, {
25
+ capabilities: {
26
+ tools: {},
27
+ resources: {},
28
+ prompts: {},
29
+ },
30
+ });
31
+ this.toolHandler = new ToolHandler(this.store);
32
+ this.resourceHandler = new ResourceHandler(this.store);
33
+ this.promptHandler = new PromptHandler();
34
+ this.setupHandlers();
35
+ }
36
+ setupHandlers() {
37
+ // 1. Tools Handlers
38
+ this.server.setRequestHandler(ListToolsRequestSchema, async () => {
39
+ return { tools: TOOL_DEFINITIONS };
40
+ });
41
+ this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
42
+ try {
43
+ const result = await this.toolHandler.handleTool(request.params.name, request.params.arguments || {});
44
+ return {
45
+ content: [
46
+ {
47
+ type: 'text',
48
+ text: typeof result === 'string' ? result : JSON.stringify(result, null, 2),
49
+ },
50
+ ],
51
+ };
52
+ }
53
+ catch (error) {
54
+ return {
55
+ content: [
56
+ {
57
+ type: 'text',
58
+ text: JSON.stringify({ error: error.message || String(error) }),
59
+ },
60
+ ],
61
+ isError: true,
62
+ };
63
+ }
64
+ });
65
+ // 2. Resources Handlers
66
+ this.server.setRequestHandler(ListResourcesRequestSchema, async () => {
67
+ return { resources: this.resourceHandler.getResourceList() };
68
+ });
69
+ this.server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
70
+ return this.resourceHandler.readResource(request.params.uri);
71
+ });
72
+ // 3. Prompts Handlers
73
+ this.server.setRequestHandler(ListPromptsRequestSchema, async () => {
74
+ return { prompts: PROMPT_DEFINITIONS };
75
+ });
76
+ this.server.setRequestHandler(GetPromptRequestSchema, async (request) => {
77
+ return this.promptHandler.getPrompt(request.params.name, request.params.arguments || {});
78
+ });
79
+ }
80
+ async start() {
81
+ seedStandardGraph(this.store);
82
+ const transport = new StdioServerTransport();
83
+ await this.server.connect(transport);
84
+ // Logging to stderr to keep stdout pure for JSON-RPC MCP
85
+ console.error('ProofGraph MCP Server active over stdio. Publisher: AI Build Infra.');
86
+ }
87
+ }
88
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,yBAAyB,EACzB,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAc,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAsB,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAEjE,MAAM,OAAO,mBAAmB;IAMV;IALZ,MAAM,CAAS;IACf,WAAW,CAAc;IACzB,eAAe,CAAkB;IACjC,aAAa,CAAgB;IAErC,YAAoB,QAAoB,gBAAgB;QAApC,UAAK,GAAL,KAAK,CAA+B;QACtD,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CACtB;YACE,IAAI,EAAE,oCAAoC;YAC1C,OAAO,EAAE,OAAO;SACjB,EACD;YACE,YAAY,EAAE;gBACZ,KAAK,EAAE,EAAE;gBACT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