openkrak-mcp 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +141 -36
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,11 +8,14 @@ OpenKrak pre-computes your repository's structure and delivers a structured inte
|
|
|
8
8
|
|
|
9
9
|
## The Problem
|
|
10
10
|
|
|
11
|
-
Every time you ask
|
|
11
|
+
Every time you ask your coding agent to modify code, the LLM starts blind — reading raw files, burning tokens, guessing dependencies.
|
|
12
12
|
|
|
13
|
-
**Without OpenKrak:** LLM reads 50,000 tokens of raw files. Slow. Expensive. Blind.
|
|
13
|
+
**Without OpenKrak:** LLM reads 50,000+ tokens of raw files. Slow. Expensive. Blind.
|
|
14
14
|
**With OpenKrak:** LLM reads a pre-computed Mahadata brief. Precise. Cheap. Aware.
|
|
15
15
|
|
|
16
|
+
For simple tasks, OpenKrak replaces 50+ file reads with a single tool call.
|
|
17
|
+
For complex refactors, it cuts token usage 20-30% and eliminates blind exploration — the LLM knows exactly which files matter before it reads a single line.
|
|
18
|
+
|
|
16
19
|
---
|
|
17
20
|
|
|
18
21
|
## How It Works
|
|
@@ -20,10 +23,39 @@ Every time you ask Claude Code, OpenCode, or Cursor to modify code, the LLM star
|
|
|
20
23
|
OpenKrak runs the **Dorchester engine** — a 6-step static analysis pipeline:
|
|
21
24
|
|
|
22
25
|
```
|
|
23
|
-
Repository
|
|
26
|
+
Repository
|
|
27
|
+
│
|
|
28
|
+
▼
|
|
29
|
+
DeepStrike — Full static analysis: every import, export, coupling resolved
|
|
30
|
+
│
|
|
31
|
+
▼
|
|
32
|
+
Hotspot Registry — Files ranked by complexity, change frequency, cognitive load
|
|
33
|
+
│
|
|
34
|
+
▼
|
|
35
|
+
Correlation Engine — Dependency chains traced across the entire codebase
|
|
36
|
+
│
|
|
37
|
+
▼
|
|
38
|
+
Blast Radius — Ripple effects of any change mapped before commit
|
|
39
|
+
│
|
|
40
|
+
▼
|
|
41
|
+
Execution Gate — Analysis validated and normalized
|
|
42
|
+
│
|
|
43
|
+
▼
|
|
44
|
+
Mahadata — Structured intelligence brief delivered to your coding agent
|
|
24
45
|
```
|
|
25
46
|
|
|
26
|
-
|
|
47
|
+
Your codebase never leaves your machine. All analysis runs locally.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Supported Agents
|
|
52
|
+
|
|
53
|
+
| Agent | Status |
|
|
54
|
+
|-------|--------|
|
|
55
|
+
| **OpenCode** | ✅ Supported |
|
|
56
|
+
| Claude Code | 🔜 Coming soon |
|
|
57
|
+
| Codex | 🔜 Coming soon |
|
|
58
|
+
| Cursor | 🔜 Coming soon |
|
|
27
59
|
|
|
28
60
|
---
|
|
29
61
|
|
|
@@ -33,73 +65,146 @@ The result is delivered as a structured brief to your coding agent via MCP befor
|
|
|
33
65
|
npm install -g openkrak-mcp
|
|
34
66
|
```
|
|
35
67
|
|
|
36
|
-
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Setup — OpenCode
|
|
37
71
|
|
|
38
|
-
###
|
|
39
|
-
|
|
40
|
-
|
|
72
|
+
### Step 1 — Edit config
|
|
73
|
+
|
|
74
|
+
Open `~/.config/opencode/opencode.jsonc` and add the `mcp` block:
|
|
75
|
+
|
|
76
|
+
```jsonc
|
|
41
77
|
{
|
|
42
78
|
"$schema": "https://opencode.ai/config.json",
|
|
43
79
|
"mcp": {
|
|
44
80
|
"openkrak": {
|
|
45
81
|
"type": "local",
|
|
46
82
|
"enabled": true,
|
|
47
|
-
"command": ["
|
|
83
|
+
"command": ["openkrak-mcp"]
|
|
48
84
|
}
|
|
49
85
|
}
|
|
50
86
|
}
|
|
51
87
|
```
|
|
52
88
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
89
|
+
> **Windows path:** `C:\Users\<username>\.config\opencode\opencode.jsonc`
|
|
90
|
+
> **Mac/Linux path:** `~/.config/opencode/opencode.jsonc`
|
|
91
|
+
|
|
92
|
+
### Step 2 — Restart OpenCode
|
|
93
|
+
|
|
94
|
+
Close and reopen OpenCode. You should see **openkrak Connected** in the top-right MCP panel.
|
|
95
|
+
|
|
96
|
+
### Step 3 — Use it
|
|
97
|
+
|
|
98
|
+
Just open a repo and ask your agent anything. OpenKrak automatically runs before the LLM touches your files.
|
|
99
|
+
|
|
100
|
+
Or call it explicitly:
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
Use analyze_repo on /path/to/your/repo with objective "refactor the auth module"
|
|
65
104
|
```
|
|
66
105
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Turning OpenKrak On / Off
|
|
109
|
+
|
|
110
|
+
Change `"enabled"` in your config:
|
|
111
|
+
|
|
112
|
+
```jsonc
|
|
113
|
+
// ON
|
|
114
|
+
"enabled": true
|
|
115
|
+
|
|
116
|
+
// OFF
|
|
117
|
+
"enabled": false
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Then restart OpenCode. That's it.
|
|
121
|
+
|
|
122
|
+
**Quick toggle scripts (optional):**
|
|
123
|
+
|
|
124
|
+
Save these two files anywhere on your machine.
|
|
125
|
+
|
|
126
|
+
`mcp-on.ps1` (Windows PowerShell):
|
|
127
|
+
```powershell
|
|
128
|
+
$config = Get-Content "$env:USERPROFILE\.config\opencode\opencode.jsonc" | ConvertFrom-Json -AsHashtable
|
|
129
|
+
$config.mcp.openkrak.enabled = $true
|
|
130
|
+
$config | ConvertTo-Json -Depth 10 | Set-Content "$env:USERPROFILE\.config\opencode\opencode.jsonc"
|
|
131
|
+
Write-Host "OpenKrak: ON"
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
`mcp-off.ps1` (Windows PowerShell):
|
|
135
|
+
```powershell
|
|
136
|
+
$config = Get-Content "$env:USERPROFILE\.config\opencode\opencode.jsonc" | ConvertFrom-Json -AsHashtable
|
|
137
|
+
$config.mcp.openkrak.enabled = $false
|
|
138
|
+
$config | ConvertTo-Json -Depth 10 | Set-Content "$env:USERPROFILE\.config\opencode\opencode.jsonc"
|
|
139
|
+
Write-Host "OpenKrak: OFF"
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Run with:
|
|
143
|
+
```powershell
|
|
144
|
+
powershell -File mcp-on.ps1
|
|
145
|
+
powershell -File mcp-off.ps1
|
|
70
146
|
```
|
|
71
147
|
|
|
72
148
|
---
|
|
73
149
|
|
|
74
150
|
## Tools
|
|
75
151
|
|
|
76
|
-
|
|
152
|
+
Once connected, your coding agent has access to 4 tools:
|
|
153
|
+
|
|
154
|
+
| Tool | When to use |
|
|
77
155
|
|------|-------------|
|
|
78
|
-
| `analyze_repo` |
|
|
79
|
-
| `get_mahadata` |
|
|
80
|
-
| `get_hotspots` |
|
|
81
|
-
| `blast_radius` | Ripple effect
|
|
156
|
+
| `analyze_repo` | Before any coding task — runs full Dorchester pipeline, returns dependency graph, hotspots, blast radius, threat matrix |
|
|
157
|
+
| `get_mahadata` | Quick 500-token intelligence brief — repo structure, entry points, constraints, risk score |
|
|
158
|
+
| `get_hotspots` | Which files are most dangerous to touch — ranked by complexity, coupling, change frequency |
|
|
159
|
+
| `blast_radius` | Ripple effect of modifying a specific file — which files, modules, APIs will be affected |
|
|
82
160
|
|
|
83
161
|
---
|
|
84
162
|
|
|
85
|
-
##
|
|
163
|
+
## Pro License (optional)
|
|
164
|
+
|
|
165
|
+
Free tier gives you **15 calls per 24 hours** — no account needed.
|
|
166
|
+
|
|
167
|
+
For unlimited calls, get a Pro key at **[openkrak.dev](https://openkrak.dev)**:
|
|
168
|
+
|
|
169
|
+
```jsonc
|
|
170
|
+
{
|
|
171
|
+
"$schema": "https://opencode.ai/config.json",
|
|
172
|
+
"mcp": {
|
|
173
|
+
"openkrak": {
|
|
174
|
+
"type": "local",
|
|
175
|
+
"enabled": true,
|
|
176
|
+
"command": ["openkrak-mcp"],
|
|
177
|
+
"env": {
|
|
178
|
+
"OPENKRAK_KEY": "your-license-key"
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
```
|
|
86
184
|
|
|
87
185
|
| Plan | Price | Limit |
|
|
88
186
|
|------|-------|-------|
|
|
89
|
-
| Free | $0 | 15 calls / 24h |
|
|
187
|
+
| Free | $0 | 15 calls / 24h rolling |
|
|
90
188
|
| Pro Monthly | $8/month | Unlimited |
|
|
91
189
|
| Pro Annual | $67.20/year | Unlimited |
|
|
92
190
|
|
|
93
|
-
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## Privacy
|
|
194
|
+
|
|
195
|
+
- Your codebase **never leaves your machine**
|
|
196
|
+
- Analysis runs 100% locally via the Dorchester engine
|
|
197
|
+
- Only license validation calls hit the network (to verify your key)
|
|
198
|
+
- No telemetry, no file uploads
|
|
94
199
|
|
|
95
200
|
---
|
|
96
201
|
|
|
97
202
|
## Tech
|
|
98
203
|
|
|
99
|
-
- Protocol
|
|
100
|
-
- Analysis
|
|
101
|
-
-
|
|
102
|
-
-
|
|
204
|
+
- **Protocol:** MCP (Model Context Protocol) — open standard by Anthropic
|
|
205
|
+
- **Analysis:** Static, deterministic — not AI/probabilistic
|
|
206
|
+
- **Runtime:** Node.js ≥ 18
|
|
207
|
+
- **License:** MIT
|
|
103
208
|
|
|
104
209
|
---
|
|
105
210
|
|