Promote rebuilt MCP to main — release 0.5.0 (testnet preview) - #12
Conversation
…s REST API Targets the rebuilt platform (sealed RFQ + negotiation + HTLC atomic settlement, BTC↔EVM/TRON), TESTNETS ONLY until the hardening gate. 14 tools over the real OTC flow (board → create/respond → negotiate → accept → track settlement). Autonomous-agent auth: HASHLOCK_EVM_KEY performs SIWE login locally (nonce → sign → JWT, auto re-login); HASHLOCK_TOKEN still works; read-only tools need no auth. Swap secrets are generated locally (0600 file) — only the sha256 hashlock is sent. Removes Sui + compute-capacity scope and the GraphQL client. Registry manifests (server.json/smithery/llms-install) and README rewritten honestly (no mainnet claims). pnpm pinned 9.15.0; tsup/tsc/vitest green (29 tests); smoke-tested live against dev (tools/list, list_assets, autonomous whoami). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…sted (H5) The preimage is the crown jewel; returning it into the agent/LLM transcript on demand (combined with untrusted counterparty text surfaced by deal_status) was a prompt-injection-driven premature-disclosure path. get_deal_secret now refuses unless BOTH legs are funded on-chain (status counterparty_funded or later) — i.e. only when claiming is actually safe — and deal_status flags message bodies as untrusted data, not instructions. Build + lint + 29 tests green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…m tools (rc.2)
Env/config: no hardcoded dev domain — HASHLOCK_APP_URL (share links), HASHLOCK_EVM_RPC, HASHLOCK_TRON_HOST,
all with testnet defaults; chain params (factory/shared-HTLC/esplora/chainId) come from GET /config.
Autonomous login on all three chains (the first configured key mints the session, each also signs its
chain's settlement): HASHLOCK_EVM_KEY (SIWE), HASHLOCK_TRON_KEY (signMessageV2), HASHLOCK_BTC_KEY
(BIP-322 via bip322-js). Live-verified TRON + BTC login against dev.
New settlement tools (src/chains/{evm,tron,btc}.ts + settlement.ts):
- fund_leg — funds the leg the agent gives: EVM approve + HTLCFactory.createSwap (viem), TRON
approve + SharedHTLC.fund (TronWeb), BTC pay the P2WSH from the agent's UTXOs (bitcoinjs-lib).
- claim_leg — claims the receive leg with the preimage, revealing the secret: EVM clone.claim, TRON
SharedHTLC.claim, BTC claim tx with witness [sig, preimage, 0x01, redeemScript] via Esplora; then
reports the claim to /swaps/:id/reveal.
Leg role logic (maker gives A / taker gives B), fee-on-payer, fail-closed on missing addresses.
16 tools. tsc + 33 tests (incl. EVM/TRON/BTC signer derivation + BIP-322 round-trip). Full agent e2e
(create→respond→accept→agreed→fund_leg dispatch) verified live. On-chain fund/claim needs funded
testnet keys to exercise end-to-end.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Publish the rebuilt MCP (was 1.0.0-rc.2 on develop, npm latest is the old 0.4.1) as 0.5.0 — 0.x testnet-preview, consistent with the SDKs and honest about pre-mainnet/pre-audit status (the README already carries the testnets-only + not-affiliated notices). 0.5.0 > 0.4.1 so npm 'latest' advances to the rebuilt server. Add a hardened OIDC release workflow (tag v* → build job without id-token, minimal SHA-pinned publish job, version/tag guard, provenance) mirroring the SDK repo. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe MCP server is rebuilt around a REST API client, autonomous per-chain authentication, local swap-secret storage, and HTLC settlement across EVM, TRON, and Bitcoin. MCP tools now cover RFQ negotiation, deal management, and settlement funding or claiming, with updated packaging and release configuration. ChangesHashlock Markets rebuild
Estimated code review effort: 5 (Critical) | ~120 minutes Sequence Diagram(s)sequenceDiagram
participant Agent
participant MCPServer
participant HashlockClient
participant SecretStore
participant Chain
Agent->>MCPServer: invoke RFQ, negotiation, fund_leg, or claim_leg
MCPServer->>HashlockClient: fetch REST state and authenticate
MCPServer->>SecretStore: generate or retrieve local preimage
MCPServer->>Chain: submit HTLC funding or claim transaction
Chain-->>MCPServer: return transaction id
MCPServer->>HashlockClient: reveal claim data
MCPServer-->>Agent: return deal state and transaction result
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
CI failed: pnpm/action-setup pinned `version: 9` conflicts with packageManager pnpm@9.15.0 (the action rejects specifying both). Drop the `version` input — the action reads it from packageManager. The repo uses pnpm (pnpm-lock.yaml), so the release build job now uses pnpm too (frozen-lockfile + pnpm build/test/pack, SHA-pinned action) instead of npm; the OIDC publish job still `npm publish`es the prebuilt tarball (npm CLI is the reference for OIDC trusted publishing + provenance). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@coderabbitai review |
✅ Action performedReview finished.
|
Promote the ground-up MCP rebuild (against the current Hashlock Markets REST API) from
developtomain(ready-to-publish), and cut 0.5.0.What's here
/api(autonomous SIWE/TRON/BTC login → JWT; on-chain fund/claim signed by the agent's own keys). Verified live against dev (whoami/login, list_assets, list_open_rfqs) — API contract current.> 0.4.1so npmlatestadvances to the rebuilt server. README already carries the testnets-only + not-affiliated-with-Hashlock-Pty-Ltd notices.v*→ build job withoutid-token, minimal SHA-pinned publish job, version/tag guard, provenance), mirroring the SDK repo.Release steps (after merge)
@hashlock-tech/mcp(GitHub Actions →Hashlock-Tech/hashlock-mcp, workflowrelease.yml).git tag v0.5.0 && git push origin v0.5.0→ the workflow builds + publishes with provenance.Then update the awesome-mcp-servers PR #4553 description (BTC ↔ EVM/TRON + sealed RFQ/HTLC, not Sui/intents).
🤖 Generated with Claude Code
Summary by CodeRabbit