Skip to content

Promote rebuilt MCP to main — release 0.5.0 (testnet preview) - #12

Merged
lexaisnotdead merged 5 commits into
mainfrom
develop
Jul 24, 2026
Merged

Promote rebuilt MCP to main — release 0.5.0 (testnet preview)#12
lexaisnotdead merged 5 commits into
mainfrom
develop

Conversation

@lexaisnotdead

@lexaisnotdead lexaisnotdead commented Jul 24, 2026

Copy link
Copy Markdown
Member

Promote the ground-up MCP rebuild (against the current Hashlock Markets REST API) from develop to main (ready-to-publish), and cut 0.5.0.

What's here

  • Rebuilt MCP server: 16 tools over the /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.5.0 (0.x testnet-preview, not 1.0) — consistent with the SDKs; honest about pre-mainnet/pre-audit. > 0.4.1 so npm latest advances to the rebuilt server. README already carries the testnets-only + not-affiliated-with-Hashlock-Pty-Ltd notices.
  • Hardened OIDC release workflow (tag v* → build job without id-token, minimal SHA-pinned publish job, version/tag guard, provenance), mirroring the SDK repo.
  • 33 tests pass; builds clean.

Release steps (after merge)

  1. Configure the npm trusted publisher for @hashlock-tech/mcp (GitHub Actions → Hashlock-Tech/hashlock-mcp, workflow release.yml).
  2. 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

  • New Features
    • Enabled non-custodial cross-chain OTC settlement across Bitcoin, Ethereum, and TRON testnets with autonomous per-chain login and on-chain funding/claiming.
    • Added local secret generation for hashlock-based atomic settlement plus expanded RFQ/deal/asset/settlement tool coverage with structured errors.
  • Documentation
    • Reworked installation and README for testnets-only operation, autonomous auth model, updated tools/protocol details, and amount/price formatting.
  • Bug Fixes
    • Standardized “not found” error classification and improved auth token refresh behavior.
  • Tests
    • Added focused coverage for chain/signers, client conversions/auth, errors, and secret storage; removed older swap and compute-capacity test suites.

lexaisnotdead and others added 4 commits July 6, 2026 18:50
…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>
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review Change Stack

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Free

Run ID: b0fb457d-1971-4bb3-a223-ee6f5282ba6b

📥 Commits

Reviewing files that changed from the base of the PR and between 5895b7d and 5b672d6.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • .github/workflows/release.yml
💤 Files with no reviewable changes (1)
  • .github/workflows/ci.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/release.yml

📝 Walkthrough

Walkthrough

The 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.

Changes

Hashlock Markets rebuild

Layer / File(s) Summary
Multi-chain signer implementations
src/chains/*, src/settlement.ts, src/__tests__/chains.test.ts
Adds EVM, TRON, and Bitcoin login signing plus HTLC funding and claiming implementations, with chain-family and signer identity coverage.
REST client and autonomous authentication
src/config.ts, src/client.ts, src/__tests__/client.test.ts
Adds environment-driven configuration, REST endpoint wrappers, asset resolution, exact amount conversion, SIWE login, JWT reuse, and one-time 401 re-login.
Local secrets and swap settlement
src/secrets.ts, src/settlement.ts, src/__tests__/secrets.test.ts
Persists thread-scoped secrets and hashlocks locally and adds maker/taker leg selection, chain-specific funding, claiming, and claim revelation.
MCP tools and server bootstrap
src/tools.ts, src/index.ts, src/lib/errors.ts, src/__tests__/errors.test.ts
Registers RFQ, negotiation, deal, secret, reveal, identity, funding, and claiming tools through the new bootstrap flow and updates error classification to NOT_FOUND.
Release metadata and installation surface
package.json, server.json, smithery.yaml, .github/workflows/*, README.md, llms-install.md, CHANGELOG.md
Updates dependencies, server configuration, documentation, CI, changelog entries, and tag-triggered npm publishing with provenance.

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
Loading

Note

🎁 Summarized by CodeRabbit Free

Your 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 @coderabbitai help to get the list of available commands.

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>
@lexaisnotdead

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@lexaisnotdead
lexaisnotdead merged commit 9596655 into main Jul 24, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant