dexe-mcp 0.5.7 → 0.5.8
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/CHANGELOG.md +39 -0
- package/README.md +270 -200
- package/SECURITY.md +46 -0
- package/dist/lib/ipfs.d.ts +7 -0
- package/dist/lib/ipfs.d.ts.map +1 -1
- package/dist/lib/ipfs.js +32 -1
- package/dist/lib/ipfs.js.map +1 -1
- package/dist/tools/ipfs.d.ts.map +1 -1
- package/dist/tools/ipfs.js +437 -16
- package/dist/tools/ipfs.js.map +1 -1
- package/package.json +10 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,44 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.8
|
|
4
|
+
|
|
5
|
+
DAO avatar pipeline — root-cause fix + three new composites.
|
|
6
|
+
|
|
7
|
+
### Avatar bug fixes (frontend rendering)
|
|
8
|
+
|
|
9
|
+
- **`dexe_ipfs_upload_file` now returns a CID v1 base32 string** (`bafy…`) as the primary `cid` field, with the original Pinata response preserved as `cidV0`. The DeXe frontend stores avatar URLs as `https://<cid>.ipfs.4everland.io/<file>`, and that subdomain gateway only resolves v1 — so the pre-0.5.8 server produced dead links every time an agent uploaded an avatar.
|
|
10
|
+
- **Image filenames are normalized to `.jpeg` for any `image/*` content type** (configurable via `normalizeImageExt: false`). Matches what `useCreateDAO` does in the frontend and what `parseAvatarFromIpfsResponse` expects when reading the profile back.
|
|
11
|
+
- **`dexe_ipfs_upload_dao_metadata` auto-converts any incoming `avatarCID` to v1 base32** before composing `avatarUrl`. Callers that previously passed in a v0 `Qm…` (which silently produced a dead link) now get a working URL.
|
|
12
|
+
|
|
13
|
+
### New tools (+3, total 126 → 129)
|
|
14
|
+
|
|
15
|
+
- **`dexe_ipfs_upload_avatar`** — one-shot composite. Takes base64 image bytes, normalizes the filename to `.jpeg`, pins, converts the CID to v1, and returns the exact `{avatarCID, avatarFileName, avatarUrl}` triple that `dexe_ipfs_upload_dao_metadata` and `dexe_ipfs_update_dao_metadata` accept. Removes a three-step manual chain.
|
|
16
|
+
- **`dexe_dao_generate_avatar`** — generates a deterministic placeholder. Initials of the DAO name over a hash-coloured gradient, emitted as plain SVG (no `<foreignObject>`, no JS) and pinned through Pinata. Same input always produces the same colours, so re-deploys keep the brand. No external image-generation provider involved.
|
|
17
|
+
- **`dexe_ipfs_update_dao_metadata`** — smart "modify DAO profile" helper. Fetches the current DAO descriptionURL JSON, applies only the fields you pass in `overrides` (avatar / name / website / description / socialLinks / documents), re-pins the merged result, and returns the new CID ready to feed into `dexe_proposal_build_modify_dao_profile.newDescriptionURL`. Eliminates the previous footgun where re-uploading metadata meant manually re-specifying every unchanged field — any forgotten field silently disappeared from the profile.
|
|
18
|
+
|
|
19
|
+
### Recommended modify-profile flow
|
|
20
|
+
|
|
21
|
+
```text
|
|
22
|
+
1. dexe_ipfs_upload_avatar → {avatarCID, avatarFileName, avatarUrl}
|
|
23
|
+
(or dexe_dao_generate_avatar)
|
|
24
|
+
2. dexe_ipfs_update_dao_metadata → newDescriptionURL
|
|
25
|
+
3. dexe_proposal_build_modify_dao_profile → TxPayload
|
|
26
|
+
4. dexe_proposal_create → broadcast
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Supply-chain hygiene
|
|
30
|
+
|
|
31
|
+
- **Closes 4 transitive `npm audit` findings** under `@modelcontextprotocol/sdk@1.29.0`:
|
|
32
|
+
- `fast-uri` <=3.1.0 (high) — path-traversal + host-confusion (GHSA-q3j6-qgpj-74h6, GHSA-v39h-62p7-jpjc)
|
|
33
|
+
- `hono` <4.12.18 (moderate) — six advisories, incl. JSX HTML/CSS injection, JWT validation, cache-key leakage
|
|
34
|
+
- `ip-address` <=10.1.0 (moderate) — XSS in `Address6` HTML-emitting methods (GHSA-v2v4-37r5-5v8g)
|
|
35
|
+
- `express-rate-limit` (moderate)
|
|
36
|
+
- Resolved via `package.json` `overrides`. `@modelcontextprotocol/sdk` pin bumped from `^1.0.0` → `^1.29.0`. No public-API change.
|
|
37
|
+
- **`SECURITY.md`** added — vuln-disclosure policy, scoped threat model, contact email. Now ships in the tarball alongside `LICENSE`.
|
|
38
|
+
- **`.github/FUNDING.yml`** added (GitHub sponsors link).
|
|
39
|
+
|
|
40
|
+
`npm audit --omit=dev` now reports **0 vulnerabilities**.
|
|
41
|
+
|
|
3
42
|
## 0.5.7
|
|
4
43
|
|
|
5
44
|
Last broadcast sweep: **57 / 57 green** on Polaris (BSC testnet 97), 2026-05-12.
|
package/README.md
CHANGED
|
@@ -1,200 +1,270 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://www.npmjs.com/package/dexe-mcp">
|
|
3
|
+
<img src="./assets/hero.svg" alt="dexe-mcp — the runtime for autonomous DAOs" width="100%"/>
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://www.npmjs.com/package/dexe-mcp"><img alt="npm" src="https://img.shields.io/npm/v/dexe-mcp.svg?style=flat-square&labelColor=0b0f1e&color=9BB4FF"></a>
|
|
9
|
+
<a href="https://nodejs.org"><img alt="node" src="https://img.shields.io/node/v/dexe-mcp.svg?style=flat-square&labelColor=0b0f1e&color=E07AFF"></a>
|
|
10
|
+
<a href="https://github.com/edward-arinin-web-dev/dexe-mcp/blob/main/LICENSE"><img alt="license" src="https://img.shields.io/npm/l/dexe-mcp.svg?style=flat-square&labelColor=0b0f1e&color=FFC878"></a>
|
|
11
|
+
<a href="https://modelcontextprotocol.io"><img alt="MCP-compatible" src="https://img.shields.io/badge/MCP-compatible-9BB4FF?style=flat-square&labelColor=0b0f1e"></a>
|
|
12
|
+
<a href="https://github.com/edward-arinin-web-dev/dexe-mcp"><img alt="tools" src="https://img.shields.io/badge/tools-129-7CF2D1?style=flat-square&labelColor=0b0f1e"></a>
|
|
13
|
+
<a href="https://github.com/edward-arinin-web-dev/dexe-mcp"><img alt="proposal types" src="https://img.shields.io/badge/proposal--types-33-E07AFF?style=flat-square&labelColor=0b0f1e"></a>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<h2 align="center">Governance, as a function call.</h2>
|
|
17
|
+
|
|
18
|
+
<p align="center">
|
|
19
|
+
<code>dexe-mcp</code> turns the entire DeXe Protocol — every DAO, every proposal type, every read, every write — into <b>one Model Context Protocol server</b>.<br/>
|
|
20
|
+
Plug it into Claude, Cursor, ChatGPT, or any tool-using LLM and watch your agent <b>deploy DAOs, draft proposals, vote, delegate, execute, claim</b> — straight from natural language.<br/>
|
|
21
|
+
<sub>Calldata-first by default: keys stay in your wallet. Broadcast mode? One env var.</sub>
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
<p align="center">
|
|
25
|
+
<a href="#quickstart"><b>Quickstart</b></a> ·
|
|
26
|
+
<a href="#what-you-can-build">What you can build</a> ·
|
|
27
|
+
<a href="#built-for-whats-next">Built for what's next</a> ·
|
|
28
|
+
<a href="#tool-catalog">Tool catalog</a> ·
|
|
29
|
+
<a href="#swarm-test-harness">Swarm tests</a> ·
|
|
30
|
+
<a href="https://github.com/edward-arinin-web-dev/dexe-mcp/tree/main/docs">Docs</a>
|
|
31
|
+
</p>
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## The shift
|
|
36
|
+
|
|
37
|
+
For a decade, DAOs lived behind dashboards. Every action was a click. Every read was a tab. Every coordination loop needed a human at the keyboard.
|
|
38
|
+
|
|
39
|
+
That era is ending.
|
|
40
|
+
|
|
41
|
+
LLMs can now reason about voting power, weigh proposals against a mandate, draft calldata, simulate execution, and ask your wallet to sign — **continuously, across every DAO you care about, all at once.** What was a UI is becoming a conversation. What was a treasurer's spreadsheet is becoming an always-on agent.
|
|
42
|
+
|
|
43
|
+
**`dexe-mcp` is the substrate that makes it real for the DeXe stack.** One MCP server. 129 typed tools. Every flow the official frontend exposes — and a few it doesn't.
|
|
44
|
+
|
|
45
|
+
| | What you get |
|
|
46
|
+
|-----|------|
|
|
47
|
+
| **Total protocol coverage** | All **33 proposal types**. Validator chamber. Expert delegation. OTC multi-tier sales with merkle whitelists. Internal config. Off-chain backend. Nothing hand-rolled. Nothing missing. |
|
|
48
|
+
| **Key-safe by default** | Every write returns `TxPayload = { to, data, value, chainId }`. Your wallet — MetaMask, Safe, Ledger, anything — signs. **No keys touch the MCP unless you explicitly set `DEXE_PRIVATE_KEY`.** |
|
|
49
|
+
| **Battle-tested on-chain** | **57 swarm-test scenarios** running on BSC testnet against real fixture DAOs. Every builder validated end-to-end — draft → IPFS → propose → vote → execute. Latest pass: 2026-05-12. |
|
|
50
|
+
| **AI-native, model-agnostic** | Tool names, argument schemas, and return shapes are tuned for LLM chaining. Works with Claude, GPT, Gemini, Mistral, Llama — anything that can call MCP tools. |
|
|
51
|
+
| **Open source, no middleman** | MIT. Your RPC. Your wallet. Your keys. Your rules. No telemetry. No SaaS gatekeeper. No rate limits. Run it on your laptop or behind your agent fleet. |
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## What you can build
|
|
56
|
+
|
|
57
|
+
> **One MCP server. Dozens of products that didn't exist a year ago.**
|
|
58
|
+
|
|
59
|
+
- **Governance copilots in chat** — *"Show every proposal I haven't voted on across all my DAOs, ranked by deadline."* The agent fans out `dexe_user_inbox`, ranks results, drafts your votes. You hit sign.
|
|
60
|
+
- **Intent-driven proposal drafting** — *"Stream 50,000 USDT from treasury to the dev fund, vesting linearly over six months."* The agent picks the right builder (`_token_distribution`), assembles nested calldata, pins metadata to IPFS, returns one signable payload. What used to be a 14-field form is now a sentence.
|
|
61
|
+
- **AI delegates that reason** — agents that read every proposal, weigh it against a written mandate, vote, and publish their reasoning on-chain. Real accountability for delegated power.
|
|
62
|
+
- **24/7 autonomous treasury bots** — policy expressed as code, executed as proposals. Market triggers, runway thresholds, vesting schedules — all enforced without a human in the loop, every action a signed on-chain decision.
|
|
63
|
+
- **Multi-DAO coalition orchestration** — one agent coordinating votes across allied protocols, tracking quorums, building coalitions, executing in lockstep.
|
|
64
|
+
- **Conversational DAO frontends** — apps where there *is* no UI. The MCP server is the backend. The chat is the dashboard. The wallet is the only button.
|
|
65
|
+
- **Adversarial governance simulators** — spin up swarms of AI proposers, voters, and validators to red-team a parameter change *before* it hits mainnet. The swarm harness ships with this already (see [Swarm tests](#swarm-test-harness)).
|
|
66
|
+
- **OTC sale autopilots** — open multi-tier sales with merkle whitelists, manage buyer flows, fulfill vested payouts — all without a sale-management UI.
|
|
67
|
+
- **Forensics and compliance** — `dexe_decode_proposal` + `_decode_calldata` make any historic on-chain proposal human-readable. Agents narrate every governance decision for audits, postmortems, and research.
|
|
68
|
+
|
|
69
|
+
If you can describe a DeXe governance operation in a sentence, `dexe-mcp` has the tool.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Built for what's next
|
|
74
|
+
|
|
75
|
+
The next generation of DAOs will be **operated by language, not by clicks.**
|
|
76
|
+
|
|
77
|
+
- **AI delegates will outvote human ones.** They read every proposal. They show their reasoning. They never miss a deadline.
|
|
78
|
+
- **Treasuries will defend themselves.** Policy bots react to market moves, rebalance, claim, redelegate — all through governance, never around it.
|
|
79
|
+
- **Cross-DAO coordination will be ambient.** Coalitions form in seconds via agent-to-agent negotiation, ratified by on-chain votes.
|
|
80
|
+
- **Governance frontends will collapse into chat.** The dashboard moves into the conversation. The UI is the prompt.
|
|
81
|
+
- **Every proposal will be simulated first.** Adversarial AI swarms stress-test changes before they reach mainnet.
|
|
82
|
+
- **Audit will run continuously.** Compliance agents decode and narrate every historical decision in real time.
|
|
83
|
+
|
|
84
|
+
`dexe-mcp` is the connective tissue. Bring your model. Bring your wallet. Bring your DAO.
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Quickstart
|
|
89
|
+
|
|
90
|
+
**1.** Install:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
npm install -g dexe-mcp
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**2.** Register with your MCP client (`.mcp.json`, `claude_desktop_config.json`, Cursor settings, etc.):
|
|
97
|
+
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"mcpServers": {
|
|
101
|
+
"dexe": {
|
|
102
|
+
"command": "dexe-mcp",
|
|
103
|
+
"env": {
|
|
104
|
+
"DEXE_RPC_URL": "https://bsc-dataseed.binance.org",
|
|
105
|
+
"DEXE_CHAIN_ID": "56"
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
> **Windows note:** if your MCP client can't resolve the `dexe-mcp` shim on PATH, point it at the installed script directly:
|
|
113
|
+
> ```json
|
|
114
|
+
> { "command": "node", "args": ["<npm root -g>/dexe-mcp/dist/index.js"] }
|
|
115
|
+
> ```
|
|
116
|
+
> (Run `npm root -g` to get the absolute path.)
|
|
117
|
+
|
|
118
|
+
**3.** Ask your agent something governance-shaped:
|
|
119
|
+
|
|
120
|
+
```jsonc
|
|
121
|
+
// Discover every proposal type your DAO can run
|
|
122
|
+
dexe_proposal_catalog({ category: "all", implementedOnly: true })
|
|
123
|
+
|
|
124
|
+
// Snapshot a DAO — treasury, voters, settings, validators, everything
|
|
125
|
+
dexe_dao_info({ govPool: "0x..." })
|
|
126
|
+
|
|
127
|
+
// Draft a token-transfer proposal (returns ready-to-sign calldata)
|
|
128
|
+
dexe_proposal_build_token_transfer({
|
|
129
|
+
govPool: "0x...",
|
|
130
|
+
token: "0x...",
|
|
131
|
+
recipient: "0x...",
|
|
132
|
+
amount: "1000000000000000000"
|
|
133
|
+
})
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
The agent gets back a `TxPayload`. Pass it to your wallet. Sign. Submit. Done.
|
|
137
|
+
|
|
138
|
+
**Want the MCP to broadcast too?** Set `DEXE_PRIVATE_KEY` and unlock the composite signing flow (`dexe_proposal_create`, `dexe_proposal_vote_and_execute`, `dexe_tx_send`, `dexe_tx_status`). Strictly opt-in — default stays calldata-only.
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## Prerequisites
|
|
143
|
+
|
|
144
|
+
- **Node.js ≥ 20** with a working `npm` (`node --version` and `npm --version` must both succeed).
|
|
145
|
+
- **Git** — needed the first time a build tool (`dexe_compile` / `dexe_test` / `dexe_lint`) runs, to shallow-clone DeXe-Protocol. Skippable if you set `DEXE_PROTOCOL_PATH` to an existing checkout.
|
|
146
|
+
|
|
147
|
+
## First run
|
|
148
|
+
|
|
149
|
+
The MCP server starts instantly. On the first build-tool call, dexe-mcp shallow-clones DeXe-Protocol into a platform cache directory and runs `npm install` there once. Most tools never need that checkout — reads, proposal builders, vote tools, and deploy only need an RPC URL.
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## Environment variables
|
|
154
|
+
|
|
155
|
+
All optional. Tools that need a missing variable fail with a clear, actionable message pointing at exactly what to set. Full matrix → [`docs/ENVIRONMENT.md`](https://github.com/edward-arinin-web-dev/dexe-mcp/blob/main/docs/ENVIRONMENT.md).
|
|
156
|
+
|
|
157
|
+
| Variable | Required for | Purpose |
|
|
158
|
+
|----------|--------------|---------|
|
|
159
|
+
| `DEXE_PROTOCOL_PATH` | dev tooling (optional) | Use an existing DeXe-Protocol checkout; disables auto clone/install |
|
|
160
|
+
| `DEXE_RPC_URL` | reads / predict / deploy | JSON-RPC endpoint (BSC or any EVM chain where DeXe is deployed) |
|
|
161
|
+
| `DEXE_CHAIN_ID` | reads | Defaults to `56` (BSC mainnet). Override for other chains |
|
|
162
|
+
| `DEXE_CONTRACTS_REGISTRY` | reads (optional) | Override the ContractsRegistry root; defaults to the known per-chain address |
|
|
163
|
+
| `DEXE_PINATA_JWT` | IPFS uploads | Pinata JWT for pinning proposal/DAO metadata |
|
|
164
|
+
| `DEXE_IPFS_GATEWAY` | IPFS fetch | **Dedicated** gateway URL (Pinata, Filebase, Quicknode, self-hosted). Public gateways are unreliable and NOT defaulted |
|
|
165
|
+
| `DEXE_IPFS_GATEWAYS_FALLBACK` | IPFS fetch (optional) | Comma-separated public gateways tried sequentially after the primary |
|
|
166
|
+
| `DEXE_SUBGRAPH_POOLS_URL` | `dexe_read_dao_list`, `_dao_members`, `_delegation_map`, `_dao_experts`, `_user_inbox`, `_proposal_voters`, `_dao_predict_addresses` | The Graph endpoint for the DeXe pools subgraph |
|
|
167
|
+
| `DEXE_SUBGRAPH_VALIDATORS_URL` | `dexe_read_validator_list` | The Graph endpoint for the DeXe validators subgraph |
|
|
168
|
+
| `DEXE_SUBGRAPH_INTERACTIONS_URL` | `dexe_read_user_activity` | The Graph endpoint for the DeXe interactions subgraph |
|
|
169
|
+
| `DEXE_GRAPH_API_KEY` | subgraph reads (optional) | Bearer token for `gateway.thegraph.com`. Required only when the URL doesn't embed the key. Auto-extracted from `/api/<key>/...` URLs |
|
|
170
|
+
| `DEXE_BACKEND_API_URL` | off-chain proposals | DeXe backend (e.g. `https://api.dexe.io`) |
|
|
171
|
+
| `DEXE_PRIVATE_KEY` | broadcast mode (opt-in) | Enables `_tx_send`, `_tx_status`, and the broadcast branch of composite flows. Default stays calldata-only |
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## Documentation
|
|
176
|
+
|
|
177
|
+
Full docs in [`docs/`](https://github.com/edward-arinin-web-dev/dexe-mcp/tree/main/docs):
|
|
178
|
+
|
|
179
|
+
- [**`docs/TOOLS.md`**](https://github.com/edward-arinin-web-dev/dexe-mcp/blob/main/docs/TOOLS.md) — complete catalog of all 129 tools, grouped, with one-line descriptions and required envs.
|
|
180
|
+
- [**`docs/USAGE.md`**](https://github.com/edward-arinin-web-dev/dexe-mcp/blob/main/docs/USAGE.md) — 10 worked examples (deploy DAO, create/vote/execute proposals, delegate, validator chamber, decode calldata, off-chain proposals, multicall batching). Copy-pasteable JSON.
|
|
181
|
+
- [**`docs/ENVIRONMENT.md`**](https://github.com/edward-arinin-web-dev/dexe-mcp/blob/main/docs/ENVIRONMENT.md) — env-var reference: minimum block to get started, per-category requirements, calldata vs signer mode, chain config, IPFS gateway rationale, subgraph migration, swarm-harness envs, common pitfalls.
|
|
182
|
+
- [**`docs/OTC.md`**](https://github.com/edward-arinin-web-dev/dexe-mcp/blob/main/docs/OTC.md) — multi-tier OTC sale flows (project-owner and buyer paths).
|
|
183
|
+
- [**`docs/SIMULATOR.md`**](https://github.com/edward-arinin-web-dev/dexe-mcp/blob/main/docs/SIMULATOR.md) — `eth_call`-based preflight with revert-reason decoding.
|
|
184
|
+
- [**`docs/INBOX.md`**](https://github.com/edward-arinin-web-dev/dexe-mcp/blob/main/docs/INBOX.md) — cross-DAO inbox and proposal forecast.
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## Tool catalog
|
|
189
|
+
|
|
190
|
+
**129 tools, 14 groups.** Run `dexe_proposal_catalog` at runtime for the live proposal-type map. Full per-tool reference → [`docs/TOOLS.md`](https://github.com/edward-arinin-web-dev/dexe-mcp/blob/main/docs/TOOLS.md).
|
|
191
|
+
|
|
192
|
+
| Group | # | What it gives you |
|
|
193
|
+
|-------|---|------|
|
|
194
|
+
| **Dev tooling** | 4 | One-command Hardhat lifecycle for the DeXe-Protocol monorepo — `dexe_compile`, `_test`, `_coverage`, `_lint`. Auto-clones the repo on first call. |
|
|
195
|
+
| **Contract introspection** | 10 | Ask the protocol about itself — list contracts, fetch ABIs, look up selectors, read NatSpec, view source, decode arbitrary calldata or full proposal payloads. The agent's reverse-engineer toolkit. |
|
|
196
|
+
| **DAO reads** | 25 | Everything you'd see on a DAO dashboard, returned as JSON — `dao_info`, predicted helper addresses, proposal state/list/voters, voting power, treasury, settings, validators, staking, distributions, privacy policy, user activity. |
|
|
197
|
+
| **IPFS** | 9 | Pinata uploads for files / avatars / DAO + proposal metadata, smart metadata updates, deterministic identicon generation, gateway-fallback fetch, CID computation without uploading. |
|
|
198
|
+
| **DAO deploy** | 1 | `dexe_dao_build_deploy` — encodes the full nested `PoolFactory.deployGovPool` struct with predicted helper addresses pre-wired. From idea to a live DAO in one signed tx. |
|
|
199
|
+
| **Proposal catalog + primitives** | 5 | `dexe_proposal_catalog` enumerates **all 33** proposal types with metadata + gating. Primitives `_build_external`, `_build_internal`, `_build_custom_abi`, `_build_offchain` cover anything not in a named wrapper. |
|
|
200
|
+
| **External proposal wrappers** | 20 | Named builders for every common action: token transfer / distribution / sale (single + multi-tier), treasury withdraw, validators, experts, staking tier, math model, blacklist, reward multiplier, apply to DAO, modify profile, change voting settings, new proposal type, whitelist, and more. |
|
|
201
|
+
| **Internal validator wrappers** | 4 | Validator-chamber proposals: `_change_validator_balances`, `_change_validator_settings`, `_monthly_withdraw`, `_offchain_internal_proposal`. |
|
|
202
|
+
| **Off-chain backend** | 8 | Full DeXe-backend integration — nonce + SIWE login, off-chain proposal creation (single-option / multi-option / for-against / settings), off-chain vote + cancel. |
|
|
203
|
+
| **Vote / stake / delegate / execute / claim** | 16 | Every direct EOA write on `GovPool` and `Validators` — deposit, vote, delegate, undelegate, execute, claim rewards, micropool rewards, staking flows, NFT multiplier lock/unlock, privacy policy signing. |
|
|
204
|
+
| **Composite signing flows** | 5 | High-level flows for power users: `_proposal_create`, `_proposal_vote_and_execute`, `_tx_send`, `_tx_status`, `_get_config`. Signing tools opt-in via `DEXE_PRIVATE_KEY`. |
|
|
205
|
+
| **Subgraph reads** | 7 | The Graph queries: DAO list, members, experts, user activity, delegation map, distribution status, OTC sale tiers. Decentralized-network endpoints + RPC fallback. |
|
|
206
|
+
| **Merkle utility** | 2 | `dexe_merkle_build`, `dexe_merkle_proof` — OZ `StandardMerkleTree`-compatible. For whitelisted sales and airdrops. |
|
|
207
|
+
| **OTC composites** | 4 | Full project-owner + buyer flows over `TokenSaleProposal`: open multi-tier sale, check buyer status, buy native or with merkle proof, claim vested payouts. See [`docs/OTC.md`](https://github.com/edward-arinin-web-dev/dexe-mcp/blob/main/docs/OTC.md). |
|
|
208
|
+
| **Simulator** | 3 | `eth_call`-based preflight with decoded revert reasons — `_sim_calldata`, `_sim_proposal`, `_sim_buy`. Catch reverts before you pay gas. See [`docs/SIMULATOR.md`](https://github.com/edward-arinin-web-dev/dexe-mcp/blob/main/docs/SIMULATOR.md). |
|
|
209
|
+
| **Multi-DAO inbox + forecast** | 2 | `dexe_user_inbox` aggregates pending items (unvoted proposals, claimable rewards, locked deposits) across N DAOs. `_proposal_forecast` predicts pass rate with quorum projection + risk flags. See [`docs/INBOX.md`](https://github.com/edward-arinin-web-dev/dexe-mcp/blob/main/docs/INBOX.md). |
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## Swarm test harness
|
|
214
|
+
|
|
215
|
+
[`tests/swarm/`](https://github.com/edward-arinin-web-dev/dexe-mcp/tree/main/tests/swarm) is a multi-agent DAO testing harness that runs every `dexe-mcp` tool against real BSC-testnet DAOs. Scenarios are JSON specs; the orchestrator resolves agent wallets and runs each step through either an inline ethers dispatcher or the dexe-mcp stdio bridge.
|
|
216
|
+
|
|
217
|
+
It's also a reference implementation of one of the futures we described above — **adversarial AI agents stress-testing a DAO before it ships.**
|
|
218
|
+
|
|
219
|
+
**57 scenarios shipped.** Coverage:
|
|
220
|
+
|
|
221
|
+
- **Reset + delegation chains** — S00, S01, S06, S14
|
|
222
|
+
- **Validator chamber** — pass / veto / full lifecycle (S02, S03, S07)
|
|
223
|
+
- **Read-only snapshots** — expert state, participation, validators, cross-DAO, catalog, multi-proposal state, user activity (S04, S05, S09–S15)
|
|
224
|
+
- **Cancel-vote + decode-and-introspect** — S08, S12
|
|
225
|
+
- **Build-only sanity for every proposal type** in `dexe_proposal_catalog` — token transfer, blacklist, withdraw treasury, apply to DAO, token distribution, token sale + recover, manage validators, change validator balances/settings, monthly withdraw, add/remove expert (local + global), delegate/revoke from expert, reward multiplier (4 modes), change voting settings, new proposal type, change math model, custom ABI, manual calldata, create staking tier, off-chain validator + for/against + settings (S16–S40)
|
|
226
|
+
- **OTC multi-tier sale flows** — open sale, buyer buy native + merkle (S41–S46)
|
|
227
|
+
- **Simulator + inbox + per-DAO reads** — S47, S48, S50, S51
|
|
228
|
+
- **Broadcast lifecycle (v0.5.6 builder rewrites)** — `withdraw_treasury`, `apply_to_dao`, `reward_multiplier mint` (S52–S54)
|
|
229
|
+
- **Broadcast lifecycle (most-used proposal types)** — `token_transfer`, `blacklist`, `add_expert` (S55–S57)
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
# 1) generate 9 wallets (8 agents + funder), fund the funder from your wallet
|
|
233
|
+
# 2) deploy fixture DAOs via dexe_dao_build_deploy (one 50% quorum + one with validators)
|
|
234
|
+
# 3) configure SWARM_DAOS_TESTNET / SWARM_TOKENS_TESTNET / SWARM_RPC_URL_TESTNET
|
|
235
|
+
|
|
236
|
+
npm run swarm:preflight # red/green table per wallet
|
|
237
|
+
npm run swarm:fund -- --confirm # broadcast top-ups from funder
|
|
238
|
+
npm run swarm:run # full sweep, all scenarios
|
|
239
|
+
npm run swarm:run -- --scenarios=S00-reset,S01-delegation-chain-3hop --dry-run
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
- Setup runbook → [`tests/swarm/README.md`](https://github.com/edward-arinin-web-dev/dexe-mcp/blob/main/tests/swarm/README.md)
|
|
243
|
+
- Scenario schema → [`tests/swarm/scenarios/_schema.md`](https://github.com/edward-arinin-web-dev/dexe-mcp/blob/main/tests/swarm/scenarios/_schema.md)
|
|
244
|
+
- Per-role agent prompts → [`tests/swarm/prompts/`](https://github.com/edward-arinin-web-dev/dexe-mcp/tree/main/tests/swarm/prompts)
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
## Contributing
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
git clone https://github.com/edward-arinin-web-dev/dexe-mcp.git
|
|
252
|
+
cd dexe-mcp
|
|
253
|
+
npm install
|
|
254
|
+
npm run build
|
|
255
|
+
npm run typecheck
|
|
256
|
+
npm run dev # watch mode
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
Issues, PRs, and proposal-type requests welcome → [GitHub issues](https://github.com/edward-arinin-web-dev/dexe-mcp/issues).
|
|
260
|
+
|
|
261
|
+
## License
|
|
262
|
+
|
|
263
|
+
MIT. See [LICENSE](https://github.com/edward-arinin-web-dev/dexe-mcp/blob/main/LICENSE).
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
<p align="center">
|
|
268
|
+
<b>The runtime for autonomous DAOs.</b><br/>
|
|
269
|
+
<sub>Built for the DeXe Protocol governance stack on BNB Chain. Not affiliated with DeXe Network — independent open-source integration.</sub>
|
|
270
|
+
</p>
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Supported Versions
|
|
4
|
+
|
|
5
|
+
Only the latest published version on npm receives security updates. Pin to the latest minor (`^0.5`) in your MCP client config.
|
|
6
|
+
|
|
7
|
+
## Reporting a Vulnerability
|
|
8
|
+
|
|
9
|
+
If you find a vulnerability in `dexe-mcp` — whether in the calldata builders, the optional signer (`DEXE_PRIVATE_KEY`), IPFS upload paths, or the Hardhat bridge — please **do not** open a public GitHub issue.
|
|
10
|
+
|
|
11
|
+
Email: **edward.arinin@gmail.com**
|
|
12
|
+
|
|
13
|
+
Include:
|
|
14
|
+
|
|
15
|
+
- A description of the issue and its impact (what an attacker can do, under what conditions).
|
|
16
|
+
- A minimal reproduction: the tool call, env vars (redacted), and the resulting behavior.
|
|
17
|
+
- Affected version (`dexe-mcp --version` or check `package.json`).
|
|
18
|
+
- Suggested mitigation, if you have one.
|
|
19
|
+
|
|
20
|
+
You should expect an acknowledgement within 72 hours. A coordinated-disclosure timeline will be agreed before any public advisory is filed.
|
|
21
|
+
|
|
22
|
+
## Scope
|
|
23
|
+
|
|
24
|
+
In scope:
|
|
25
|
+
|
|
26
|
+
- Calldata-builder tools (`dexe_proposal_build_*`, `dexe_vote_build_*`, `dexe_dao_build_deploy`) that produce calldata that does not match the intended action.
|
|
27
|
+
- Signer mode (`dexe_tx_send`, auto-broadcast in `dexe_proposal_create` / `dexe_proposal_vote_and_execute`) leaking or misusing the configured private key.
|
|
28
|
+
- IPFS upload paths that exfiltrate non-public data or accept unsafe input.
|
|
29
|
+
- Hardhat bridge (`dexe_compile`, `dexe_test`, etc.) executing unintended shell commands.
|
|
30
|
+
- Dependency vulnerabilities reachable through `dexe-mcp`'s exposed tool surface.
|
|
31
|
+
|
|
32
|
+
Out of scope:
|
|
33
|
+
|
|
34
|
+
- Vulnerabilities in the on-chain DeXe Protocol contracts (report at <https://github.com/dexe-network>).
|
|
35
|
+
- Issues that require the operator to set obviously unsafe env values (e.g. `DEXE_PRIVATE_KEY=<a key the attacker already controls>`).
|
|
36
|
+
- General npm-registry / npm-cli / Node.js issues unrelated to this package.
|
|
37
|
+
|
|
38
|
+
## Threat Model
|
|
39
|
+
|
|
40
|
+
`dexe-mcp` runs **locally** alongside an MCP client (Claude Desktop, Claude Code, etc.). It does not bind a network port and does not expose itself to the public internet. The interesting attack surfaces are:
|
|
41
|
+
|
|
42
|
+
1. The operator's private key in signer mode — never logged, never sent off-host, only used by `ethers.Wallet` to sign payloads the operator has already approved at the agent level.
|
|
43
|
+
2. Calldata correctness — every `_build_*` tool emits a `TxPayload` the operator can decode (`dexe_decode_calldata`, `dexe_decode_proposal`) and sign-verify before broadcasting.
|
|
44
|
+
3. IPFS pinning credentials — keep `PINATA_JWT` scoped to a project-specific key.
|
|
45
|
+
|
|
46
|
+
If you believe any of the above is broken, please report per the process above.
|
package/dist/lib/ipfs.d.ts
CHANGED
|
@@ -33,6 +33,12 @@ export interface CidInfo {
|
|
|
33
33
|
}
|
|
34
34
|
export declare function parseCid(input: string): CidInfo;
|
|
35
35
|
export declare function stripIpfsPrefix(s: string): string;
|
|
36
|
+
/**
|
|
37
|
+
* Convert a CID string to its v1 base32 form (idempotent for v1 inputs).
|
|
38
|
+
* Frontend uses subdomain gateway (`<cid>.ipfs.4everland.io`), which only
|
|
39
|
+
* resolves CID v1 base32. Passing a v0 (Qm...) here produces a dead link.
|
|
40
|
+
*/
|
|
41
|
+
export declare function toCidV1(input: string): string;
|
|
36
42
|
/** Compute the CIDv1 for arbitrary JSON locally — no network. */
|
|
37
43
|
export declare function cidForJson(value: unknown): Promise<string>;
|
|
38
44
|
/** Compute the CIDv1 (raw codec) for arbitrary bytes locally. */
|
|
@@ -55,6 +61,7 @@ export declare class PinataClient {
|
|
|
55
61
|
fileName?: string;
|
|
56
62
|
contentType?: string;
|
|
57
63
|
name?: string;
|
|
64
|
+
wrapWithDirectory?: boolean;
|
|
58
65
|
}): Promise<PinataPinResult>;
|
|
59
66
|
}
|
|
60
67
|
//# sourceMappingURL=ipfs.d.ts.map
|