dexe-mcp 0.5.8 → 0.6.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 (82) hide show
  1. package/CHANGELOG.md +641 -536
  2. package/README.md +289 -270
  3. package/SECURITY.md +96 -46
  4. package/dist/config.d.ts +9 -0
  5. package/dist/config.d.ts.map +1 -1
  6. package/dist/config.js +60 -0
  7. package/dist/config.js.map +1 -1
  8. package/dist/governor/adapter.d.ts +90 -0
  9. package/dist/governor/adapter.d.ts.map +1 -0
  10. package/dist/governor/adapter.js +169 -0
  11. package/dist/governor/adapter.js.map +1 -0
  12. package/dist/governor/configs/compound.json +32 -0
  13. package/dist/governor/configs/optimism.json +28 -0
  14. package/dist/governor/configs/uniswap.json +32 -0
  15. package/dist/governor/encoder.d.ts +59 -0
  16. package/dist/governor/encoder.d.ts.map +1 -0
  17. package/dist/governor/encoder.js +290 -0
  18. package/dist/governor/encoder.js.map +1 -0
  19. package/dist/governor/index.d.ts +11 -0
  20. package/dist/governor/index.d.ts.map +1 -0
  21. package/dist/governor/index.js +20 -0
  22. package/dist/governor/index.js.map +1 -0
  23. package/dist/governor/loader.d.ts +42 -0
  24. package/dist/governor/loader.d.ts.map +1 -0
  25. package/dist/governor/loader.js +103 -0
  26. package/dist/governor/loader.js.map +1 -0
  27. package/dist/governor/tally.d.ts +48 -0
  28. package/dist/governor/tally.d.ts.map +1 -0
  29. package/dist/governor/tally.js +103 -0
  30. package/dist/governor/tally.js.map +1 -0
  31. package/dist/governor/tools/build.d.ts +3 -0
  32. package/dist/governor/tools/build.d.ts.map +1 -0
  33. package/dist/governor/tools/build.js +137 -0
  34. package/dist/governor/tools/build.js.map +1 -0
  35. package/dist/governor/tools/extras.d.ts +4 -0
  36. package/dist/governor/tools/extras.d.ts.map +1 -0
  37. package/dist/governor/tools/extras.js +197 -0
  38. package/dist/governor/tools/extras.js.map +1 -0
  39. package/dist/governor/tools/read.d.ts +4 -0
  40. package/dist/governor/tools/read.d.ts.map +1 -0
  41. package/dist/governor/tools/read.js +174 -0
  42. package/dist/governor/tools/read.js.map +1 -0
  43. package/dist/governor/tools/simulate.d.ts +6 -0
  44. package/dist/governor/tools/simulate.d.ts.map +1 -0
  45. package/dist/governor/tools/simulate.js +191 -0
  46. package/dist/governor/tools/simulate.js.map +1 -0
  47. package/dist/lib/broadcastGuards.d.ts +41 -0
  48. package/dist/lib/broadcastGuards.d.ts.map +1 -0
  49. package/dist/lib/broadcastGuards.js +85 -0
  50. package/dist/lib/broadcastGuards.js.map +1 -0
  51. package/dist/lib/ethersProvider.d.ts +96 -0
  52. package/dist/lib/ethersProvider.d.ts.map +1 -0
  53. package/dist/lib/ethersProvider.js +170 -0
  54. package/dist/lib/ethersProvider.js.map +1 -0
  55. package/dist/lib/signer.d.ts +2 -0
  56. package/dist/lib/signer.d.ts.map +1 -1
  57. package/dist/lib/signer.js +4 -0
  58. package/dist/lib/signer.js.map +1 -1
  59. package/dist/tools/flow.d.ts.map +1 -1
  60. package/dist/tools/flow.js +13 -0
  61. package/dist/tools/flow.js.map +1 -1
  62. package/dist/tools/getConfig.d.ts.map +1 -1
  63. package/dist/tools/getConfig.js +17 -0
  64. package/dist/tools/getConfig.js.map +1 -1
  65. package/dist/tools/inbox.js +8 -8
  66. package/dist/tools/index.d.ts.map +1 -1
  67. package/dist/tools/index.js +6 -0
  68. package/dist/tools/index.js.map +1 -1
  69. package/dist/tools/predict.js +17 -17
  70. package/dist/tools/safe.d.ts +5 -0
  71. package/dist/tools/safe.d.ts.map +1 -0
  72. package/dist/tools/safe.js +264 -0
  73. package/dist/tools/safe.js.map +1 -0
  74. package/dist/tools/simulate.d.ts +7 -0
  75. package/dist/tools/simulate.d.ts.map +1 -1
  76. package/dist/tools/simulate.js +8 -0
  77. package/dist/tools/simulate.js.map +1 -1
  78. package/dist/tools/subgraph.js +162 -162
  79. package/dist/tools/txSend.d.ts.map +1 -1
  80. package/dist/tools/txSend.js +25 -0
  81. package/dist/tools/txSend.js.map +1 -1
  82. package/package.json +95 -92
package/README.md CHANGED
@@ -1,270 +1,289 @@
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> &nbsp;·&nbsp;
26
- <a href="#what-you-can-build">What you can build</a> &nbsp;·&nbsp;
27
- <a href="#built-for-whats-next">Built for what's next</a> &nbsp;·&nbsp;
28
- <a href="#tool-catalog">Tool catalog</a> &nbsp;·&nbsp;
29
- <a href="#swarm-test-harness">Swarm tests</a> &nbsp;·&nbsp;
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 (S41S46)
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` (S52S54)
229
- - **Broadcast lifecycle (most-used proposal types)** — `token_transfer`, `blacklist`, `add_expert` (S55S57)
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>
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-149-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> &nbsp;·&nbsp;
26
+ <a href="#what-you-can-build">What you can build</a> &nbsp;·&nbsp;
27
+ <a href="#built-for-whats-next">Built for what's next</a> &nbsp;·&nbsp;
28
+ <a href="#tool-catalog">Tool catalog</a> &nbsp;·&nbsp;
29
+ <a href="#swarm-test-harness">Swarm tests</a> &nbsp;·&nbsp;
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 — and now for external OpenZeppelin Governor DAOs as well.** One MCP server. 149 typed tools across 18 groups. Every flow the DeXe frontend exposes — plus a generic `dexe_gov_*` surface targeting Uniswap, Compound, and Optimism.
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 149 tools, grouped, with one-line descriptions and required envs.
180
+ - [**`docs/GOVERNOR.md`**](https://github.com/edward-arinin-web-dev/dexe-mcp/blob/main/docs/GOVERNOR.md) — external OpenZeppelin / Bravo Governor surface (Uniswap, Compound, Optimism). Family branching, fixture map, paste-able JSON examples, Tally parity harness.
181
+ - [**`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.
182
+ - [**`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.
183
+ - [**`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).
184
+ - [**`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.
185
+ - [**`docs/INBOX.md`**](https://github.com/edward-arinin-web-dev/dexe-mcp/blob/main/docs/INBOX.md) — cross-DAO inbox and proposal forecast.
186
+
187
+ ---
188
+
189
+ ## Tool catalog
190
+
191
+ **149 tools, 18 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).
192
+
193
+ | Group | # | What it gives you |
194
+ |-------|---|------|
195
+ | **Dev tooling** | 4 | One-command Hardhat lifecycle for the DeXe-Protocol monorepo `dexe_compile`, `_test`, `_coverage`, `_lint`. Auto-clones the repo on first call. |
196
+ | **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. |
197
+ | **DAO reads** | 19 | 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. |
198
+ | **IPFS** | 9 | Pinata uploads for files / avatars / DAO + proposal metadata, smart metadata updates, deterministic identicon generation, gateway-fallback fetch, CID computation without uploading. |
199
+ | **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. |
200
+ | **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. |
201
+ | **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. |
202
+ | **Internal validator wrappers** | 4 | Validator-chamber proposals: `_change_validator_balances`, `_change_validator_settings`, `_monthly_withdraw`, `_offchain_internal_proposal`. |
203
+ | **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. |
204
+ | **Vote / stake / delegate / execute / claim** | 26 | Every direct EOA write on `GovPool` and `Validators` deposit, vote, delegate, undelegate, execute, claim rewards, micropool rewards, staking flows, token-sale buy/claim/vesting, distribution claim, NFT multiplier lock/unlock, privacy policy signing, multicall. |
205
+ | **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`. |
206
+ | **Subgraph reads** | 7 | The Graph queries: DAO list, members, experts, validator list, user activity, delegation map, OTC sale tiers. Decentralized-network endpoints + RPC fallback. |
207
+ | **Merkle utility** | 2 | `dexe_merkle_build`, `dexe_merkle_proof` OZ `StandardMerkleTree`-compatible. For whitelisted sales and airdrops. |
208
+ | **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). |
209
+ | **Safe multisig** | 2 | Queue a tx in the Safe Transaction Service for owners to co-sign instead of broadcasting — `dexe_safe_info` (on-chain nonce/threshold/owners + endpoint), `dexe_safe_propose_tx` (compute `safeTxHash`, sign as owner, POST to the queue; dry-run by default). See [`docs/SAFE.md`](https://github.com/edward-arinin-web-dev/dexe-mcp/blob/main/docs/SAFE.md). |
210
+ | **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). |
211
+ | **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). |
212
+ | **External Governor DAOs** | 18 | `dexe_gov_*` — read, build, simulate, and decode against OpenZeppelin Governor + Compound Bravo DAOs. Tier-1: Uniswap, Compound, Optimism. Config-only addition for new DAOs. Family-aware (OZ vs Bravo) propose / castVote / queue / execute / cancel / delegate. Eth-call dry-run + vote-impact projection. hasVoted + state + hashProposal + decode + descriptionHash utilities. Tally state-enum parity harness. See [`docs/GOVERNOR.md`](https://github.com/edward-arinin-web-dev/dexe-mcp/blob/main/docs/GOVERNOR.md). |
213
+
214
+ ---
215
+
216
+ ## Swarm test harness
217
+
218
+ [`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.
219
+
220
+ It's also a reference implementation of one of the futures we described above — **adversarial AI agents stress-testing a DAO before it ships.**
221
+
222
+ **57 scenarios shipped.** Coverage:
223
+
224
+ - **Reset + delegation chains** — S00, S01, S06, S14
225
+ - **Validator chamber** — pass / veto / full lifecycle (S02, S03, S07)
226
+ - **Read-only snapshots** — expert state, participation, validators, cross-DAO, catalog, multi-proposal state, user activity (S04, S05, S09S15)
227
+ - **Cancel-vote + decode-and-introspect** — S08, S12
228
+ - **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 (S16S40)
229
+ - **OTC multi-tier sale flows** — open sale, buyer buy native + merkle (S41S46)
230
+ - **Simulator + inbox + per-DAO reads** — S47, S48, S50, S51
231
+ - **Broadcast lifecycle (v0.5.6 builder rewrites)** — `withdraw_treasury`, `apply_to_dao`, `reward_multiplier mint` (S52–S54)
232
+ - **Broadcast lifecycle (most-used proposal types)** `token_transfer`, `blacklist`, `add_expert` (S55–S57)
233
+
234
+ ```bash
235
+ # 1) generate 9 wallets (8 agents + funder), fund the funder from your wallet
236
+ # 2) deploy fixture DAOs via dexe_dao_build_deploy (one 50% quorum + one with validators)
237
+ # 3) configure SWARM_DAOS_TESTNET / SWARM_TOKENS_TESTNET / SWARM_RPC_URL_TESTNET
238
+
239
+ npm run swarm:preflight # red/green table per wallet
240
+ npm run swarm:fund -- --confirm # broadcast top-ups from funder
241
+ npm run swarm:run # full sweep, all scenarios
242
+ npm run swarm:run -- --scenarios=S00-reset,S01-delegation-chain-3hop --dry-run
243
+ ```
244
+
245
+ - Setup runbook → [`tests/swarm/README.md`](https://github.com/edward-arinin-web-dev/dexe-mcp/blob/main/tests/swarm/README.md)
246
+ - Scenario schema → [`tests/swarm/scenarios/_schema.md`](https://github.com/edward-arinin-web-dev/dexe-mcp/blob/main/tests/swarm/scenarios/_schema.md)
247
+ - Per-role agent prompts → [`tests/swarm/prompts/`](https://github.com/edward-arinin-web-dev/dexe-mcp/tree/main/tests/swarm/prompts)
248
+
249
+ ---
250
+
251
+ ## Contributing
252
+
253
+ ```bash
254
+ git clone https://github.com/edward-arinin-web-dev/dexe-mcp.git
255
+ cd dexe-mcp
256
+ npm install
257
+ npm run build
258
+ npm run typecheck
259
+ npm run dev # watch mode
260
+ ```
261
+
262
+ Issues, PRs, and proposal-type requests welcome → [GitHub issues](https://github.com/edward-arinin-web-dev/dexe-mcp/issues).
263
+
264
+ ## Security
265
+
266
+ Supply-chain hardening is enforced in CI. See [SECURITY.md](SECURITY.md) for the full policy, threat model, and how to report a vulnerability. Highlights:
267
+
268
+ - **Signed release tags.** Every release tag is GPG-signed and `release.yml` runs `git verify-tag` before publishing — an unsigned or untrusted tag aborts the release. Verify any tag yourself after cloning:
269
+
270
+ ```bash
271
+ gpg --recv-keys <MAINTAINER_KEY_ID> # import maintainer key once
272
+ git verify-tag v0.5.9 # or the shorthand: git tag -v v0.5.9
273
+ ```
274
+
275
+ A `Good signature` line is the only acceptable result; `no signature found` or `No public key` means do not trust the tag.
276
+ - **npm provenance.** Releases publish with `npm publish --provenance`; verify with `npm audit signatures` against an installed copy.
277
+ - **Reproducible installs.** A `verify-lockfile` CI job installs strictly from the committed `package-lock.json` and fails on any drift.
278
+ - **Continuous scanning.** CodeQL (SAST) runs on every PR and weekly; OSSF Scorecard runs weekly and on push to `main`; Dependency Review runs on every PR.
279
+
280
+ ## License
281
+
282
+ MIT. See [LICENSE](https://github.com/edward-arinin-web-dev/dexe-mcp/blob/main/LICENSE).
283
+
284
+ ---
285
+
286
+ <p align="center">
287
+ <b>The runtime for autonomous DAOs.</b><br/>
288
+ <sub>Built for the DeXe Protocol governance stack on BNB Chain. Not affiliated with DeXe Network — independent open-source integration.</sub>
289
+ </p>