chain-insights 0.2.16
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/README.md +165 -0
- package/bin/cli.js +10 -0
- package/bin/install.cjs +252 -0
- package/bin/mcp-proxy.cjs +10 -0
- package/dist/active-BSrxLKwn.mjs +50 -0
- package/dist/active-BSrxLKwn.mjs.map +1 -0
- package/dist/active-Dv7Tu-O4.cjs +68 -0
- package/dist/app-BjjuQM0B.mjs +155 -0
- package/dist/app-BjjuQM0B.mjs.map +1 -0
- package/dist/app-Dq1TdB6p.cjs +161 -0
- package/dist/artifact-server-DoxJ7fCx.cjs +47 -0
- package/dist/artifact-server-Dxz5YbuQ.mjs +48 -0
- package/dist/artifact-server-Dxz5YbuQ.mjs.map +1 -0
- package/dist/assets/bg-pattern.png +0 -0
- package/dist/assets/logo.png +0 -0
- package/dist/call-args-DQA2QcRA.cjs +27 -0
- package/dist/call-args-Lk_wOJxd.mjs +29 -0
- package/dist/call-args-Lk_wOJxd.mjs.map +1 -0
- package/dist/capabilities-CB97WMA5.cjs +83 -0
- package/dist/capabilities-DliMBim-.mjs +84 -0
- package/dist/capabilities-DliMBim-.mjs.map +1 -0
- package/dist/cases-By7INiOa.mjs +6 -0
- package/dist/cases-CDcNU91B.cjs +9 -0
- package/dist/chunk-CZWwpsFl.cjs +43 -0
- package/dist/cli.cjs +752 -0
- package/dist/cli.d.cts +1 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.mjs +753 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/client-D4Bq0rp9.mjs +111 -0
- package/dist/client-D4Bq0rp9.mjs.map +1 -0
- package/dist/client-D4fZgIaO.cjs +132 -0
- package/dist/config-Bmdl5hdk.cjs +67 -0
- package/dist/config-BwrBYmiC.mjs +44 -0
- package/dist/config-BwrBYmiC.mjs.map +1 -0
- package/dist/data-extractor-BNGj7ECT.cjs +347 -0
- package/dist/data-extractor-DFzsa5CS.mjs +336 -0
- package/dist/data-extractor-DFzsa5CS.mjs.map +1 -0
- package/dist/dossier-BsroDgD3.mjs +76 -0
- package/dist/dossier-BsroDgD3.mjs.map +1 -0
- package/dist/dossier-DtxREpPm.cjs +76 -0
- package/dist/evidence-BGcdKxuV.cjs +200 -0
- package/dist/evidence-BhvFW-y_.mjs +195 -0
- package/dist/evidence-BhvFW-y_.mjs.map +1 -0
- package/dist/format-Ce1RObVl.mjs +22 -0
- package/dist/format-Ce1RObVl.mjs.map +1 -0
- package/dist/format-DOrPvXEr.cjs +20 -0
- package/dist/frontmatter-D8wWCeOa.mjs +26 -0
- package/dist/frontmatter-D8wWCeOa.mjs.map +1 -0
- package/dist/frontmatter-DgAuai7E.cjs +35 -0
- package/dist/graph-normalizer-Cv9yK9Pg.mjs +130 -0
- package/dist/graph-normalizer-Cv9yK9Pg.mjs.map +1 -0
- package/dist/graph-normalizer-DeIj6Ses.cjs +133 -0
- package/dist/graph-reports-C4TBjCkM.mjs +63 -0
- package/dist/graph-reports-C4TBjCkM.mjs.map +1 -0
- package/dist/graph-reports-DU05YCei.cjs +64 -0
- package/dist/html-generator-CAv81IWH.cjs +85 -0
- package/dist/html-generator-V6Bp0uRb.mjs +68 -0
- package/dist/html-generator-V6Bp0uRb.mjs.map +1 -0
- package/dist/index.cjs +31 -0
- package/dist/index.d.cts +187 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +187 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +9 -0
- package/dist/init-BjuFt54X.cjs +232 -0
- package/dist/init-CaOsHTIo.mjs +232 -0
- package/dist/init-CaOsHTIo.mjs.map +1 -0
- package/dist/mcp-proxy.cjs +1257 -0
- package/dist/mcp-proxy.d.cts +12 -0
- package/dist/mcp-proxy.d.cts.map +1 -0
- package/dist/mcp-proxy.d.mts +12 -0
- package/dist/mcp-proxy.d.mts.map +1 -0
- package/dist/mcp-proxy.mjs +1255 -0
- package/dist/mcp-proxy.mjs.map +1 -0
- package/dist/output-root-CFYms3ad.cjs +43 -0
- package/dist/output-root-CmWM7aV2.mjs +33 -0
- package/dist/output-root-CmWM7aV2.mjs.map +1 -0
- package/dist/parser-BUIWW1OH.cjs +182 -0
- package/dist/parser-DO0_SssG.mjs +182 -0
- package/dist/parser-DO0_SssG.mjs.map +1 -0
- package/dist/public-tools-D4UI-Zb0.mjs +2554 -0
- package/dist/public-tools-D4UI-Zb0.mjs.map +1 -0
- package/dist/public-tools-XSpkz2ky.cjs +2556 -0
- package/dist/resolver-C2ZS7oC8.mjs +201 -0
- package/dist/resolver-C2ZS7oC8.mjs.map +1 -0
- package/dist/resolver-zYbu4wDV.cjs +203 -0
- package/dist/rolldown-runtime-wcPFST8Q.mjs +13 -0
- package/dist/runner-1Eq55OYb.cjs +148 -0
- package/dist/runner-BhUHbiHG.mjs +149 -0
- package/dist/runner-BhUHbiHG.mjs.map +1 -0
- package/dist/schema-4XpzDFQM.cjs +55 -0
- package/dist/schema-8d0rVIdZ.mjs +37 -0
- package/dist/schema-8d0rVIdZ.mjs.map +1 -0
- package/dist/schema-cache-9CksD7tX.mjs +34 -0
- package/dist/schema-cache-9CksD7tX.mjs.map +1 -0
- package/dist/schema-cache-CgWRCN2N.cjs +36 -0
- package/dist/selector-CkFcTXzz.cjs +10 -0
- package/dist/selector-xjm6NTHI.mjs +12 -0
- package/dist/selector-xjm6NTHI.mjs.map +1 -0
- package/dist/server-BkM5xrXb.mjs +45 -0
- package/dist/server-BkM5xrXb.mjs.map +1 -0
- package/dist/server-DXowbpfi.cjs +54 -0
- package/dist/session-BpNylyuJ.cjs +115 -0
- package/dist/session-CcTgYxsj.mjs +115 -0
- package/dist/session-CcTgYxsj.mjs.map +1 -0
- package/dist/setup-DOpKPrlx.cjs +81 -0
- package/dist/setup-DyrWHuwQ.mjs +80 -0
- package/dist/setup-DyrWHuwQ.mjs.map +1 -0
- package/dist/store-BiUhQOIf.cjs +230 -0
- package/dist/store-BoWE-Gtl.mjs +225 -0
- package/dist/store-BoWE-Gtl.mjs.map +1 -0
- package/dist/templates/graph.html +1406 -0
- package/dist/tool-visibility-3Z_KvO9Q.mjs +28 -0
- package/dist/tool-visibility-3Z_KvO9Q.mjs.map +1 -0
- package/dist/tool-visibility-CwgY205r.cjs +36 -0
- package/dist/tools-Cp2jAAAb.mjs +100 -0
- package/dist/tools-Cp2jAAAb.mjs.map +1 -0
- package/dist/tools-f_vJUZAF.cjs +139 -0
- package/dist/topup-server-BZuQifvh.cjs +940 -0
- package/dist/topup-server-DUjyFftI.mjs +919 -0
- package/dist/topup-server-DUjyFftI.mjs.map +1 -0
- package/dist/version-1gP19Lhi.mjs +8 -0
- package/dist/version-1gP19Lhi.mjs.map +1 -0
- package/dist/version-BNGtdpmH.cjs +18 -0
- package/dist/viz-BlCJe6Tk.mjs +35 -0
- package/dist/viz-BlCJe6Tk.mjs.map +1 -0
- package/dist/viz-ClezVXrJ.cjs +44 -0
- package/dist/wallet-BMelXBYP.mjs +104 -0
- package/dist/wallet-BMelXBYP.mjs.map +1 -0
- package/dist/wallet-RnvvSpV2.cjs +146 -0
- package/docs/architecture.md +145 -0
- package/docs/contributing.md +68 -0
- package/docs/debugging.md +68 -0
- package/docs/development.md +44 -0
- package/docs/graph-tools.md +251 -0
- package/docs/images/graph-mcp-iframe.png +0 -0
- package/docs/images/graph-visualization.png +0 -0
- package/docs/images/topup-page.png +0 -0
- package/docs/investigation-workspaces.md +151 -0
- package/docs/mcp-proxy.md +180 -0
- package/package.json +59 -0
- package/skills/chain-insights-developer-experience/SKILL.md +101 -0
- package/skills/chain-insights-investigation/SKILL.md +285 -0
- package/skills/chain-insights-investigation/agents/openai.yaml +4 -0
- package/skills/chain-insights-investigation/scripts/run-target-uat.sh +197 -0
- package/skills/chain-insights-trace-funds/SKILL.md +249 -0
- package/skills/ci-case/SKILL.md +43 -0
- package/skills/ci-status/SKILL.md +45 -0
- package/skills/test-chain-insights-graphrag-mcp/SKILL.md +75 -0
- package/skills/test-chain-insights-graphrag-mcp/agents/openai.yaml +4 -0
- package/skills/test-chain-insights-graphrag-mcp/scripts/run-uat.sh +414 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# Investigation Workspaces
|
|
2
|
+
|
|
3
|
+
An investigation workspace is a normal directory that contains Chain Insights
|
|
4
|
+
case state, evidence, reports, graph payloads, imports, templates, and runtime
|
|
5
|
+
schema notes. Agents and humans should be able to inspect it with a normal
|
|
6
|
+
editor.
|
|
7
|
+
|
|
8
|
+
## Initialize
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
mkdir -p ~/work/chain-insights-investigations
|
|
12
|
+
cd ~/work/chain-insights-investigations
|
|
13
|
+
cia init .
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Do not run `cia init` inside an existing workspace unless replacing scaffolded
|
|
17
|
+
files with `--force`. Without `--force`, init refuses to overwrite known
|
|
18
|
+
workspace files before it creates directories or writes any files.
|
|
19
|
+
|
|
20
|
+
## Layout
|
|
21
|
+
|
|
22
|
+
```text
|
|
23
|
+
.chain-insights/ Workspace metadata
|
|
24
|
+
.chain-insights/schema/ Runtime graph schema captures
|
|
25
|
+
.chain-insights/runtime/ Workspace-local runtime state and debug logs
|
|
26
|
+
.chain-insights/runtime-skill/ Workspace-specific agent schema notes
|
|
27
|
+
cases/ Case exports and notes
|
|
28
|
+
imports/ External investigation inputs
|
|
29
|
+
reports/ Final or interim analyst reports
|
|
30
|
+
reports/graphs/ Canonical graph JSON for visualization
|
|
31
|
+
reports/tables/ Compact tabular extracts
|
|
32
|
+
templates/ Reusable case and report templates
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
No investigation output belongs under `~/.chain-insights`. That directory is
|
|
36
|
+
for local Chain Insights config, wallet, and schema cache state.
|
|
37
|
+
|
|
38
|
+
## Imports
|
|
39
|
+
|
|
40
|
+
`imports/` is for user-provided or third-party inputs before they become case
|
|
41
|
+
evidence.
|
|
42
|
+
|
|
43
|
+
Examples:
|
|
44
|
+
|
|
45
|
+
- Exchange support exports
|
|
46
|
+
- CSV extracts
|
|
47
|
+
- Screenshots
|
|
48
|
+
- Raw notes
|
|
49
|
+
- Partner reports
|
|
50
|
+
|
|
51
|
+
Imported files are not automatically evidence. When an import supports a claim,
|
|
52
|
+
summarize it into the case evidence manifest and reference the original path.
|
|
53
|
+
|
|
54
|
+
## Templates
|
|
55
|
+
|
|
56
|
+
`templates/` is for reusable workspace-local case, report, prompt, and evidence
|
|
57
|
+
templates. Templates are optional helpers. They are not case state until copied
|
|
58
|
+
into a case, evidence file, dossier, or report.
|
|
59
|
+
|
|
60
|
+
Fresh workspaces include a `case-brief.md` starter template.
|
|
61
|
+
|
|
62
|
+
## Cases
|
|
63
|
+
|
|
64
|
+
Open and manage cases:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
cia case open "Exchange deposit clustering" \
|
|
68
|
+
--tags aml,bittensor \
|
|
69
|
+
--description "Trace high-risk source funds into exchange entities"
|
|
70
|
+
|
|
71
|
+
cia case list
|
|
72
|
+
cia case activate <case-id>
|
|
73
|
+
cia case suspend <case-id>
|
|
74
|
+
cia case close <case-id>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Use `cia case show <case-id>` to show saved case context, evidence count,
|
|
78
|
+
dossier summaries, and recent session notes.
|
|
79
|
+
|
|
80
|
+
## Evidence
|
|
81
|
+
|
|
82
|
+
Append evidence:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
cia case evidence add <case-id> \
|
|
86
|
+
--source graph_query_batch \
|
|
87
|
+
--query-params "network=bittensor" \
|
|
88
|
+
--content "$(cat compact-result.json)"
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Evidence Markdown is a provenance record, not a raw-data dump. Small JSON is
|
|
92
|
+
pretty-printed inline with null fields removed. Large JSON is written under
|
|
93
|
+
`reports/tables/` and the evidence file stores a summary plus a pointer.
|
|
94
|
+
|
|
95
|
+
Verify evidence integrity:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
cia case evidence verify <case-id>
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Graph-backed tools can write `chain-insights.evidence_pointer.v1` entries that
|
|
102
|
+
point to report files. The evidence file should keep the claim, source tool,
|
|
103
|
+
original query parameters, compact facts, and workspace-local file pointers.
|
|
104
|
+
|
|
105
|
+
## Dossiers
|
|
106
|
+
|
|
107
|
+
Maintain an entity dossier:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
cia case dossier update <case-id> 5... \
|
|
111
|
+
--type unknown \
|
|
112
|
+
--finding "Appears in the graph address sample; continue risk screening."
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Dossiers are durable analyst notes about addresses or entities. Tools do not
|
|
116
|
+
auto-populate dossiers unless they explicitly call the dossier workflow.
|
|
117
|
+
|
|
118
|
+
## Sessions
|
|
119
|
+
|
|
120
|
+
Start and end investigation sessions:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
cia case session start <case-id>
|
|
124
|
+
cia case session end <case-id> \
|
|
125
|
+
--findings "Initial topology query returned exchange deposit candidates." \
|
|
126
|
+
--next-steps "Run focused graph_query_batch probes."
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Use sessions to record what changed during a work period and what the next
|
|
130
|
+
agent should do. Session notes complement evidence; they do not replace it.
|
|
131
|
+
|
|
132
|
+
## Reports And Visualization
|
|
133
|
+
|
|
134
|
+
Generate an ad hoc visualization from JSON:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
cia viz --data ./sample-transactions.json
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Generate a visualization for a case:
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
cia viz <case-id>
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Graph-backed tools store canonical graph JSON under `reports/graphs/`.
|
|
147
|
+
Self-contained HTML graph reports and Markdown summaries live under `reports/`.
|
|
148
|
+
Compact JSON and CSV outputs live under `reports/tables/`.
|
|
149
|
+
|
|
150
|
+
The local graph report server starts automatically when a graph report URL is
|
|
151
|
+
returned. Graph report URLs use `/graph-reports/<filename>.graph.json`.
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# MCP Proxy
|
|
2
|
+
|
|
3
|
+
The Chain Insights stdio proxy lets AI agents consume Chain Insights tools as
|
|
4
|
+
an MCP server. It connects to the configured GraphRAG MCP endpoint and adds
|
|
5
|
+
local wallet, case, evidence, and graph-report behavior.
|
|
6
|
+
|
|
7
|
+
## Basic Configuration
|
|
8
|
+
|
|
9
|
+
Use this MCP server configuration:
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"mcpServers": {
|
|
14
|
+
"chain-insights": {
|
|
15
|
+
"command": "chain-insights-mcp-proxy"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The proxy reads the same local Chain Insights config as the CLI.
|
|
22
|
+
|
|
23
|
+
## Behavior
|
|
24
|
+
|
|
25
|
+
The proxy:
|
|
26
|
+
|
|
27
|
+
- Connects to `graphMcpEndpoint`.
|
|
28
|
+
- Uses debug bearer auth, test access key auth, or x402 payment auth according
|
|
29
|
+
to local config.
|
|
30
|
+
- Caches remote tool schemas per endpoint for 24 hours.
|
|
31
|
+
- Exposes graph tools returned by the endpoint.
|
|
32
|
+
- Adds local `balance`, `help`, and case workflow tools.
|
|
33
|
+
- Starts the local graph report server when graph report URLs are returned.
|
|
34
|
+
- Publishes instructions with required argument rules, workflow guidance, graph
|
|
35
|
+
report behavior, and schema hints.
|
|
36
|
+
|
|
37
|
+
## Local Tools
|
|
38
|
+
|
|
39
|
+
| Tool | Purpose |
|
|
40
|
+
| --- | --- |
|
|
41
|
+
| `balance` | Show the local Base USDC payment wallet balance |
|
|
42
|
+
| `help` | Show Chain Insights tool and workflow guidance |
|
|
43
|
+
| `case_open` | Create a local investigation case |
|
|
44
|
+
| `case_list` | List local investigation cases |
|
|
45
|
+
| `case_resume` | Load case context, evidence count, dossiers, and latest session |
|
|
46
|
+
| `case_add_evidence` | Append a report or note to the evidence manifest |
|
|
47
|
+
| `case_verify_evidence` | Verify saved evidence integrity |
|
|
48
|
+
| `case_update_dossier` | Add a durable finding to an address/entity dossier |
|
|
49
|
+
| `case_start_session` | Start an investigation session |
|
|
50
|
+
| `case_end_session` | End a session with findings and next steps |
|
|
51
|
+
|
|
52
|
+
Remote graph tools are discovered from the configured GraphRAG MCP endpoint. The
|
|
53
|
+
expected primitive graph tools are `graph_query` and `graph_query_batch`.
|
|
54
|
+
|
|
55
|
+
## Auth Modes
|
|
56
|
+
|
|
57
|
+
Local debug mode:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
chain-insights debug on --token chain-insights-dev-debug --endpoint http://localhost:8012/mcp
|
|
61
|
+
chain-insights mcp tools --refresh
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Invited tester access key mode:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
chain-insights access-key set ci_test_REDACTED --endpoint https://staging-mcp.chain-insights.ai/mcp
|
|
68
|
+
chain-insights access-key status
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Paid x402 mode:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
chain-insights config set graphMcpEndpoint https://staging-mcp.chain-insights.ai/mcp
|
|
75
|
+
chain-insights debug off
|
|
76
|
+
chain-insights config set walletPrivateKey 0xYOUR_EVM_PRIVATE_KEY
|
|
77
|
+
chain-insights wallet balance
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
If `graphMcpAuthToken` is set, Chain Insights sends both
|
|
81
|
+
`X-MCP-Debug-Token` and `Authorization: Bearer <token>`. If it is empty,
|
|
82
|
+
Chain Insights uses the encrypted wallet private key with x402 payment
|
|
83
|
+
handling.
|
|
84
|
+
|
|
85
|
+
## Agent Installers
|
|
86
|
+
|
|
87
|
+
Install skills and MCP registration:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
chain-insights --claude
|
|
91
|
+
chain-insights --codex
|
|
92
|
+
chain-insights --hermes
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
The Hermes installer writes Chain Insights skills under the Hermes skills
|
|
96
|
+
directory and registers the stdio MCP proxy in the Hermes config.
|
|
97
|
+
|
|
98
|
+
After installing, open an initialized investigation workspace in the agent and
|
|
99
|
+
operate over the workspace files.
|
|
100
|
+
|
|
101
|
+
## Claude Desktop
|
|
102
|
+
|
|
103
|
+
Claude Desktop is supported for basic MCP calls. It is not the primary
|
|
104
|
+
framework UI.
|
|
105
|
+
|
|
106
|
+
Configure it:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
chain-insights setup claude-desktop --dry-run
|
|
110
|
+
chain-insights setup claude-desktop
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Validate without opening Claude:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
npx @modelcontextprotocol/inspector \
|
|
117
|
+
--cli \
|
|
118
|
+
--config ~/.config/Claude/claude_desktop_config.json \
|
|
119
|
+
--server chain-insights \
|
|
120
|
+
--method tools/list
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Claude Desktop does not hot-reload its MCP config. Fully quit and reopen it
|
|
124
|
+
after setup.
|
|
125
|
+
|
|
126
|
+
Useful MCP prompts:
|
|
127
|
+
|
|
128
|
+
```text
|
|
129
|
+
Use Chain Insights to show my payment wallet balance.
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
```text
|
|
133
|
+
Use Chain Insights graph_query on network bittensor with:
|
|
134
|
+
USE live_topology MATCH (n) WHERE n.address IS NOT NULL RETURN n.labels AS labels, n.address AS address LIMIT 10
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
```text
|
|
138
|
+
Use Chain Insights graph_query_batch on network bittensor with these read-only Cypher queries:
|
|
139
|
+
1. USE live_topology MATCH (n) RETURN count(n) AS count LIMIT 1
|
|
140
|
+
2. USE live_topology MATCH (n) WHERE n.address IS NOT NULL RETURN n.labels AS labels, n.address AS address LIMIT 3
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
```text
|
|
144
|
+
Use Chain Insights to open an investigation case named "Exchange deposit clustering" with tags aml,bittensor.
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
```text
|
|
148
|
+
Use Chain Insights to save the last graph_query_batch result as evidence in case <case-id>.
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Inspector Validation
|
|
152
|
+
|
|
153
|
+
Inspect a local Graph MCP endpoint directly:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
npx @modelcontextprotocol/inspector \
|
|
157
|
+
--cli http://localhost:8012/mcp \
|
|
158
|
+
--transport http \
|
|
159
|
+
--method tools/list \
|
|
160
|
+
--header "X-MCP-Debug-Token: chain-insights-dev-debug"
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Inspect the local Chain Insights proxy:
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
npx @modelcontextprotocol/inspector \
|
|
167
|
+
--cli chain-insights-mcp-proxy \
|
|
168
|
+
--method tools/list
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## Graph Reports
|
|
172
|
+
|
|
173
|
+
Graph-backed tools may return raw graph data in
|
|
174
|
+
`_meta.chainInsights.graph.data`. Chain Insights stores that graph data under
|
|
175
|
+
`reports/graphs/*.graph.json` in the active workspace and returns
|
|
176
|
+
`_meta.chainInsights.graph.url` pointing to
|
|
177
|
+
`/graph-reports/<filename>.graph.json`.
|
|
178
|
+
|
|
179
|
+
The local graph report server binds to localhost. Chain Insights does not
|
|
180
|
+
create duplicated `artifacts/` graph payloads; `reports/graphs/` is canonical.
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "chain-insights",
|
|
3
|
+
"version": "0.2.16",
|
|
4
|
+
"description": "AML investigation toolkit for blockchain analysis",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": ">=22.0.0"
|
|
8
|
+
},
|
|
9
|
+
"bin": {
|
|
10
|
+
"chain-insights": "./bin/cli.js",
|
|
11
|
+
"cia": "./bin/cli.js",
|
|
12
|
+
"chain-insights-mcp-proxy": "./bin/mcp-proxy.cjs"
|
|
13
|
+
},
|
|
14
|
+
"main": "./dist/index.cjs",
|
|
15
|
+
"module": "./dist/index.mjs",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"import": "./dist/index.mjs",
|
|
19
|
+
"require": "./dist/index.cjs"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"bin",
|
|
24
|
+
"dist",
|
|
25
|
+
"skills",
|
|
26
|
+
"docs/*.md",
|
|
27
|
+
"docs/images"
|
|
28
|
+
],
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "tsdown && cp -r src/viz/templates dist/templates && mkdir -p dist/assets && cp -r src/wallet/mcp-proxy/assets/* dist/assets/",
|
|
31
|
+
"dev": "tsx src/cli.ts",
|
|
32
|
+
"release:check": "node scripts/check-release-gate.mjs",
|
|
33
|
+
"test": "vitest run",
|
|
34
|
+
"test:watch": "vitest",
|
|
35
|
+
"typecheck": "tsc --noEmit"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@hono/node-server": "^2.0.2",
|
|
39
|
+
"@modelcontextprotocol/ext-apps": "^1.7.1",
|
|
40
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
41
|
+
"@x402/evm": "^2.12.0",
|
|
42
|
+
"@x402/fetch": "^2.12.0",
|
|
43
|
+
"commander": "^14.0.3",
|
|
44
|
+
"hono": "^4.12.18",
|
|
45
|
+
"open": "^11.0.0",
|
|
46
|
+
"viem": "^2.49.3",
|
|
47
|
+
"zod": "^4.4.3"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@types/node": "^22.0.0",
|
|
51
|
+
"tsdown": "^0.21.10",
|
|
52
|
+
"tsx": "^4.21.0",
|
|
53
|
+
"typescript": "^6.0.3",
|
|
54
|
+
"vitest": "^4.1.5"
|
|
55
|
+
},
|
|
56
|
+
"overrides": {
|
|
57
|
+
"ws": "8.20.1"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: chain-insights-developer-experience
|
|
3
|
+
description: Use when changing Chain Insights README, docs, skills, CLI UX, AML tool contracts, or developer-facing workflows. Keeps Chain Insights product-first while preserving accurate GraphRAG MCP and investigation details.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Chain Insights Developer Experience
|
|
7
|
+
|
|
8
|
+
Use this skill when improving Chain Insights as a product or developer-facing
|
|
9
|
+
framework.
|
|
10
|
+
|
|
11
|
+
## Product Frame
|
|
12
|
+
|
|
13
|
+
Chain Insights is an AML tool framework layered on top of GraphRAG MCP.
|
|
14
|
+
GraphRAG MCP provides generic graph-language access. Chain Insights provides
|
|
15
|
+
investigation workflows, AML recipes, local cases, evidence, dossiers, reports,
|
|
16
|
+
and graph visualizations.
|
|
17
|
+
|
|
18
|
+
Use "GraphRAG MCP" in product-facing docs. Only use lower-level implementation
|
|
19
|
+
names in debugging or contributor docs when the detail is necessary.
|
|
20
|
+
|
|
21
|
+
## Current AML Tools
|
|
22
|
+
|
|
23
|
+
- `address_risk`: screen one address for risk, behavior, neighborhood context,
|
|
24
|
+
and exchange exposure.
|
|
25
|
+
- `track_funds`: trace victim/source funds through intermediaries to exchange
|
|
26
|
+
deposit candidates.
|
|
27
|
+
- `scam_topology`: expand known victim incident topology into reviewable scam
|
|
28
|
+
infrastructure and label candidates.
|
|
29
|
+
|
|
30
|
+
## GraphRAG MCP Layer
|
|
31
|
+
|
|
32
|
+
GraphRAG MCP exposes generic tools such as:
|
|
33
|
+
|
|
34
|
+
- `graph_query`
|
|
35
|
+
- `graph_query_batch`
|
|
36
|
+
|
|
37
|
+
Chain Insights tools should be implemented as local AML workflows over these
|
|
38
|
+
generic graph primitives unless there is a product reason to add a new
|
|
39
|
+
primitive.
|
|
40
|
+
|
|
41
|
+
## Topology Language
|
|
42
|
+
|
|
43
|
+
Use these names consistently:
|
|
44
|
+
|
|
45
|
+
- `live_topology`: fast, cheaper, recent/hot topology.
|
|
46
|
+
- `archive_topology`: wider historical topology; slower and potentially more
|
|
47
|
+
costly.
|
|
48
|
+
- `facts`: labels, features, risk scores, assets, and enrichment.
|
|
49
|
+
|
|
50
|
+
Tell users to discover current network capabilities before assuming data is
|
|
51
|
+
available:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
cia mcp networks
|
|
55
|
+
cia mcp tools --refresh
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## README Rules
|
|
59
|
+
|
|
60
|
+
README starts from the product experience:
|
|
61
|
+
|
|
62
|
+
1. What Chain Insights is.
|
|
63
|
+
2. What users can do today.
|
|
64
|
+
3. Fast setup and one working demo.
|
|
65
|
+
4. AML tools.
|
|
66
|
+
5. GraphRAG MCP and topology model.
|
|
67
|
+
6. Links to deeper docs.
|
|
68
|
+
|
|
69
|
+
Do not put debug-token setup, local bypasses, release gates, full test
|
|
70
|
+
matrices, or client-specific desktop setup in README. Link to focused docs.
|
|
71
|
+
|
|
72
|
+
## Adding AML Tools
|
|
73
|
+
|
|
74
|
+
Every new AML tool needs:
|
|
75
|
+
|
|
76
|
+
- User problem and intended analyst workflow.
|
|
77
|
+
- Required inputs and optional inputs.
|
|
78
|
+
- GraphRAG MCP primitives used.
|
|
79
|
+
- Topology/facts scope.
|
|
80
|
+
- Result contract.
|
|
81
|
+
- Case evidence behavior.
|
|
82
|
+
- Graph report behavior.
|
|
83
|
+
- Tests.
|
|
84
|
+
- Dogfood or UAT path.
|
|
85
|
+
|
|
86
|
+
## Dogfood from a clean workspace
|
|
87
|
+
|
|
88
|
+
Before claiming the developer experience is good, run from a clean directory
|
|
89
|
+
outside this repository:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
mkdir -p /home/aphex5/work/chain-insights-dx-dogfood
|
|
93
|
+
cd /home/aphex5/work/chain-insights-dx-dogfood
|
|
94
|
+
cia --version
|
|
95
|
+
cia init .
|
|
96
|
+
cia mcp networks
|
|
97
|
+
cia mcp tools --refresh
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Run at least one small investigation command, inspect generated files, and feed
|
|
101
|
+
the friction back into README, docs, CLI help, or follow-up issues.
|