@causari/mcp-server 0.1.1
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/LICENSE +21 -0
- package/NOTICE +23 -0
- package/README.md +256 -0
- package/dist/chunk-7XWPOH6R.js +4552 -0
- package/dist/chunk-R5UFW6H7.js +61 -0
- package/dist/cli.js +18 -0
- package/dist/index.d.ts +209 -0
- package/dist/index.js +10 -0
- package/dist/smoke.js +143 -0
- package/package.json +38 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Causari
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
Causari MCP Server
|
|
2
|
+
Copyright (c) 2026 Causari
|
|
3
|
+
|
|
4
|
+
This package is dual-licensed. Different components carry different licenses.
|
|
5
|
+
|
|
6
|
+
1. SOURCE CODE
|
|
7
|
+
The server source code in this package (the program logic compiled into
|
|
8
|
+
dist/) is licensed under the MIT License. See the LICENSE file.
|
|
9
|
+
|
|
10
|
+
2. BUNDLED DATA
|
|
11
|
+
The Causal Knowledge Graph data bundled into this package — events, causal
|
|
12
|
+
links, and insight patterns compiled into dist/ — is part of the Causari
|
|
13
|
+
open dataset and is licensed under the Creative Commons
|
|
14
|
+
Attribution-ShareAlike 4.0 International License (CC-BY-SA-4.0):
|
|
15
|
+
|
|
16
|
+
https://creativecommons.org/licenses/by-sa/4.0/
|
|
17
|
+
|
|
18
|
+
Any reuse, redistribution, or adaptation of the data — including extracting
|
|
19
|
+
it from this package — requires attribution to Causari and must be shared
|
|
20
|
+
under the same CC-BY-SA-4.0 terms. The MIT license on the source code does
|
|
21
|
+
NOT grant rights to relicense or appropriate the bundled data.
|
|
22
|
+
|
|
23
|
+
Source dataset: https://github.com/causari/causari-data
|
package/README.md
ADDED
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
# @causari/mcp-server
|
|
2
|
+
|
|
3
|
+
> **Wikipedia for AI agents.** A Model Context Protocol server that gives Claude Code, Cursor, Windsurf — or any MCP-compatible AI agent — structured causal knowledge: **245 events, 457 causal links** with confidence scores, and 8 insight patterns across 9 verticals of technology history.
|
|
4
|
+
|
|
5
|
+
Ask **why** a technology, architecture, or decision emerged — Causari answers from a sourced graph of cause-and-effect across computing history, delivered straight into your agent's context. It's a knowledge base of the world's technology causality, not a logger of your agent's actions.
|
|
6
|
+
|
|
7
|
+
### Install in 60 seconds
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"mcpServers": {
|
|
12
|
+
"causari": { "command": "npx", "args": ["-y", "@causari/mcp-server"] }
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Add to `.mcp.json` (Claude Code) or `~/.cursor/mcp.json` (Cursor). Restart your IDE. Done.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 3 things you can do
|
|
22
|
+
|
|
23
|
+
**1. "Why does Kubernetes exist?"** → `causal_chain("kubernetes", depth: 3)` returns: Docker containers → Linux cgroups → Unix philosophy → and the pattern that open standards win infrastructure wars. Every link has evidence + confidence.
|
|
24
|
+
|
|
25
|
+
**2. "My startup competes with a closed platform using an open protocol"** → `historical_resonance(...)` matches TCP/IP vs OSI, Linux vs proprietary Unix, Web vs AOL. Returns predictive value scores and historical exemplars.
|
|
26
|
+
|
|
27
|
+
**3. "High-impact computing events 1990-2010"** → `query_events(yearFrom: 1990, yearTo: 2010, domains: ["technology"])` returns Linux, World Wide Web, Java, Google, iPhone, Bitcoin — structured, filterable, scored by impact.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Why this exists
|
|
32
|
+
|
|
33
|
+
Wikipedia is excellent for humans, but unstructured for AI parsing. When you ask Claude *"trace what led to the Transformer architecture"*, it stitches together prose memory — fluent but unsourced and uncalibrated.
|
|
34
|
+
|
|
35
|
+
This MCP server hands the agent a **structured causal graph** instead:
|
|
36
|
+
|
|
37
|
+
- **Nodes**: historical events with year, domain, impact score, sources
|
|
38
|
+
- **Edges**: causal links (`caused` / `enabled` / `accelerated` / `delayed` / `prevented`) with confidence + evidence text
|
|
39
|
+
- **Patterns**: recurring causal insights ("Information Democratization Cycle", "Substrate Substitution") that the agent can reuse for analogical reasoning
|
|
40
|
+
|
|
41
|
+
The agent reasons over real structure — and tells the user what it knows, where it's calibrated, and where it isn't.
|
|
42
|
+
|
|
43
|
+
| | Plain Claude / Wikipedia lookup | Causari MCP |
|
|
44
|
+
|---|---|---|
|
|
45
|
+
| Output shape | Prose paragraphs | Structured nodes + edges |
|
|
46
|
+
| Causal claims | Stitched from memory | Edges with confidence 0–1 + evidence text |
|
|
47
|
+
| Provenance | None inline | Source attributions per event |
|
|
48
|
+
| Pattern matching | Ad hoc | Named insight patterns reusable across queries |
|
|
49
|
+
| Token cost | High (verbose prose) | Low (compact JSON, no redundant fields) |
|
|
50
|
+
| Multi-hop reasoning | Implicit, opaque | Explicit BFS over the graph |
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Tools
|
|
55
|
+
|
|
56
|
+
| Tool | What it does | When to call it |
|
|
57
|
+
|---|---|---|
|
|
58
|
+
| `query_events` | Search events by time / domain / impact / free text | You need historical context for a topic, era, or domain |
|
|
59
|
+
| `causal_chain` | BFS up/down the causal graph from a root event | You need to understand **why** something happened, or **what it enabled** |
|
|
60
|
+
| `historical_resonance` | Find historical patterns parallel to a present-day situation | You're reasoning about a current trend and want analogies with predictive value |
|
|
61
|
+
| `org_knowledge` | *(Enterprise tier)* Query an organization's private CKG | Working inside an enterprise namespace with private events configured |
|
|
62
|
+
| `predict_scenarios` | Generate scenario branches from current conditions + historical patterns | Strategic planning, stress-testing assumptions, risk assessment |
|
|
63
|
+
|
|
64
|
+
In Claude Code these surface as `mcp__causari__causal_chain` (and similar), depending on the IDE's prefixing convention.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Quick start
|
|
69
|
+
|
|
70
|
+
### Option 1 — npm (recommended)
|
|
71
|
+
|
|
72
|
+
```json
|
|
73
|
+
{
|
|
74
|
+
"mcpServers": {
|
|
75
|
+
"causari": { "command": "npx", "args": ["-y", "@causari/mcp-server"] }
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Add to `.mcp.json` (Claude Code project or `~/.claude/mcp.json` global) or `~/.cursor/mcp.json` (Cursor).
|
|
81
|
+
|
|
82
|
+
### Option 2 — Hosted endpoint (no install)
|
|
83
|
+
|
|
84
|
+
Point directly to the hosted Cloudflare Worker — nothing to install or run locally:
|
|
85
|
+
|
|
86
|
+
```json
|
|
87
|
+
{
|
|
88
|
+
"mcpServers": {
|
|
89
|
+
"causari": {
|
|
90
|
+
"url": "https://causari-mcp.huydv.workers.dev/mcp"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Works with any MCP client that supports HTTP transport (Claude Desktop, Cursor, Windsurf, etc.).
|
|
97
|
+
|
|
98
|
+
### Option 3 — From source
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
git clone https://github.com/causari/mcp-server
|
|
102
|
+
cd mcp-server
|
|
103
|
+
pnpm install && pnpm build
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
```json
|
|
107
|
+
{
|
|
108
|
+
"mcpServers": {
|
|
109
|
+
"causari": {
|
|
110
|
+
"command": "node",
|
|
111
|
+
"args": ["/path/to/mcp-server/dist/cli.js"]
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Verify it works
|
|
118
|
+
|
|
119
|
+
In Claude Code:
|
|
120
|
+
|
|
121
|
+
> Use the causari `causal_chain` tool to trace what led to the Transformer architecture, depth 3.
|
|
122
|
+
|
|
123
|
+
You should see a structured response with nodes, confidence scores, and an evidence chain — not just prose.
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Sample outputs
|
|
128
|
+
|
|
129
|
+
### `causal_chain` — root: "transformer", direction: "causes", depth: 2
|
|
130
|
+
|
|
131
|
+
```json
|
|
132
|
+
{
|
|
133
|
+
"root": { "id": "transformer", "title": "Transformer Architecture", "year": "2017" },
|
|
134
|
+
"causes": [
|
|
135
|
+
{
|
|
136
|
+
"id": "turing_m", "title": "Turing Machine", "year": "1950", "hop": 1,
|
|
137
|
+
"relationship": "enabled", "confidence": 0.8,
|
|
138
|
+
"evidence": "Computational substrate for all neural architectures traces to Turing-complete machines."
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"id": "mcculloch_pitts", "title": "McCulloch-Pitts Neuron", "year": "1943", "hop": 2,
|
|
142
|
+
"relationship": "enabled", "confidence": 0.9,
|
|
143
|
+
"evidence": "First formal model of artificial neurons; the foundational abstraction."
|
|
144
|
+
}
|
|
145
|
+
],
|
|
146
|
+
"relatedPatterns": [
|
|
147
|
+
{
|
|
148
|
+
"pattern": "Substrate Substitution",
|
|
149
|
+
"description": "A capability historically running on substrate A migrates to substrate B once B becomes cheaper or more flexible.",
|
|
150
|
+
"predictiveValue": 0.78
|
|
151
|
+
}
|
|
152
|
+
]
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### `historical_resonance` — situation: "rapid democratization of knowledge through new technology"
|
|
157
|
+
|
|
158
|
+
Matches **Information Democratization Cycle** (predictive value 0.85), with exemplars spanning Language → Writing → Printing Press → Internet → Transformers — giving the agent a calibrated historical scaffold to reason from.
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## Status & roadmap
|
|
163
|
+
|
|
164
|
+
This is honest reporting, not marketing copy.
|
|
165
|
+
|
|
166
|
+
**Current data depth (as of 2026-05-18):**
|
|
167
|
+
|
|
168
|
+
- **245 events** across 9 verticals: AI history, computing, web ecosystem, cloud/devops, databases, AI/ML tooling, security, mobile, and civilizational foundations
|
|
169
|
+
- **457 causal links** with evidence text + confidence scores calibrated per-link
|
|
170
|
+
- **8 insight patterns** (Abstraction Layer Migration, Standardization Cycle, Open vs Proprietary, Information Democratization Cycle, and more)
|
|
171
|
+
|
|
172
|
+
**Strong coverage:** Queries like `causal_chain("docker")`, `causal_chain("reactjs")`, `causal_chain("jwt")`, or `historical_resonance("microservices vs monolith")` return dense causal chains with evidence. Dev-term hit rate validated at 10/10.
|
|
173
|
+
|
|
174
|
+
**Honest limitations:**
|
|
175
|
+
|
|
176
|
+
- Confidence scores are curator estimates, not statistical posteriors.
|
|
177
|
+
- `predict_scenarios` is pattern-matching over the historical record, not probabilistic forecasting. Treat output as structured hypotheses, not predictions.
|
|
178
|
+
- Coverage outside the 9 current verticals is thinner. See [causari/causari-data](https://github.com/causari/causari-data) to request or contribute new verticals.
|
|
179
|
+
|
|
180
|
+
**Roadmap:**
|
|
181
|
+
|
|
182
|
+
- ✅ Hosted HTTP endpoint (`causari-mcp.huydv.workers.dev`) — Cloudflare Worker, stateless
|
|
183
|
+
- 🔜 API key + rate limiting — Pro tier
|
|
184
|
+
- 🔜 Embedding-based resonance — replace lexical match with semantic similarity
|
|
185
|
+
- 🔜 Org/Personal scope — user-curated private CKG via enterprise tier
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## Smoke test
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
npm run build
|
|
193
|
+
node dist/smoke.js
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
Expected: `PASS: 10/10` with a sample causal chain printed. The smoke covers tool registration, query correctness on known events, and edge cases (missing event, depth cap).
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## Architecture
|
|
201
|
+
|
|
202
|
+
```
|
|
203
|
+
┌───────────────────────────────────────────┐
|
|
204
|
+
│ AI Agent (Claude Code, Cursor, Windsurf) │
|
|
205
|
+
└──────┬──────────────────┬─────────────────┘
|
|
206
|
+
│ stdio (local) │ HTTP/SSE (hosted)
|
|
207
|
+
▼ ▼
|
|
208
|
+
┌──────────────┐ ┌─────────────────────────┐
|
|
209
|
+
│ cli.ts │ │ worker.ts │
|
|
210
|
+
│ (npx local) │ │ (Cloudflare Worker) │
|
|
211
|
+
└──────┬───────┘ └────────────┬────────────┘
|
|
212
|
+
│ │
|
|
213
|
+
└──────────┬────────────┘
|
|
214
|
+
▼
|
|
215
|
+
┌──────────────────────────────┐
|
|
216
|
+
│ server.ts / tools.ts │
|
|
217
|
+
│ - 5 tool definitions │ ← output shaping, token-efficiency
|
|
218
|
+
│ - MCP request handlers │
|
|
219
|
+
└──────────────┬───────────────┘
|
|
220
|
+
│ imports
|
|
221
|
+
▼
|
|
222
|
+
┌──────────────────────────────┐
|
|
223
|
+
│ @causari/ckg │
|
|
224
|
+
│ - types │ ← schema (Event, CausalLink, Insight)
|
|
225
|
+
│ - store │ ← in-memory + adjacency indexes
|
|
226
|
+
│ - query │ ← BFS, search, resonance, scenarios
|
|
227
|
+
│ - seed (9 verticals) │ ← 245 events, 457 links, 8 patterns
|
|
228
|
+
└──────────────────────────────┘
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
Token-efficiency note: tool outputs drop redundant fields and inline `relationship` + `evidence` so the LLM doesn't have to re-query for context. Confidence + provenance is surfaced so the model can communicate uncertainty honestly to the user.
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## Contributing
|
|
236
|
+
|
|
237
|
+
The seed dataset is open under CC-BY-SA 4.0 in the [`causari/causari-data`](https://github.com/causari/causari-data) repo. See its [CONTRIBUTING.md](https://github.com/causari/causari-data/blob/main/CONTRIBUTING.md) for event/link submission guidelines.
|
|
238
|
+
|
|
239
|
+
For server code contributions, file issues or PRs here.
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
## License
|
|
244
|
+
|
|
245
|
+
This package is **dual-licensed** (see `NOTICE`):
|
|
246
|
+
|
|
247
|
+
- **Server code** — MIT (see `LICENSE`).
|
|
248
|
+
- **Bundled Causal Knowledge Graph data** (events, causal links, insight patterns compiled into `dist/`) — **CC-BY-SA 4.0**. Reuse of the data — including extracting it from this package — requires attribution and share-alike, even though it ships inside this MIT-licensed package. The MIT code license does not relicense the data. Source dataset: [`causari/causari-data`](https://github.com/causari/causari-data).
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
## Related
|
|
253
|
+
|
|
254
|
+
- [Causari Powflow Canvas](https://causari-demo.pages.dev) — the same CKG, visualized for humans
|
|
255
|
+
- Architecture decisions are documented internally in the Causari monorepo
|
|
256
|
+
- [Model Context Protocol](https://modelcontextprotocol.io) — the open standard this server implements
|