blockchain-pattern-mcp

Blockchain system design via the blockchain-pattern MCP server: analyses requirements and domain, selects from 109 patterns (zk-rollup, optimistic-rollup, constant-product-amm, erc4337, erc4626-vault and 104 more), generates full designs (components, relationships, API contracts, data models, event contracts), and evaluates quality across security, cost efficiency, scalability, decentralization, composability, liquidity, simplicity and privacy. Use when designing a new on-chain/off-chain system, comparing blockchain styles, evaluating an existing design, or exploring the pattern catalog. Triggers on bridge/DEX/lending-market/wallet design requests, style comparisons, and design evaluations. Do NOT use for single-contract implementation, DevOps/IaC, or code refactoring. Requires the blockchain-pattern MCP server connected.

O que é blockchain-pattern-mcp?

blockchain-pattern-mcp is a Claude Code agent skill that blockchain system design via the blockchain-pattern MCP server: analyses requirements and domain, selects from 109 patterns (zk-rollup, optimistic-rollup, constant-product-amm, erc4337, erc4626-vault and 104 more), generates full designs (components, relationships, API contracts, data models, event contracts), and evaluates quality across security, cost efficiency, scalability, decentralization, composability, liquidity, simplicity and privacy. Use when designing a new on-chain/off-chain system, comparing blockchain styles, evaluating an existing design, or exploring the pattern catalog. Triggers on bridge/DEX/lending-market/wallet design requests, style comparisons, and design evaluations. Do NOT use for single-contract implementation, DevOps/IaC, or code refactoring. Requires the blockchain-pattern MCP server connected.

Funciona com✓Claude Code~Codex CLI✓Cursor
npx skills add https://github.com/olk/blockchain-pattern-mcp/tree/HEAD/skills/blockchain-pattern-mcp

Installed? Explore more Programação e Desenvolvimento skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

Perguntar na sua IA favorita

Abre um novo chat com esta habilidade de agente já pré-carregada.

Documentação

blockchain-pattern MCP

Blockchain design pipeline exposed by the blockchain-pattern MCP server on this host:

  1. Analyse requirements + domain → recommended style, top-k patterns with requirements-weighted scores, the selected patterns' aggregate quality profile, matched domain slugs
  2. Generate the design: overview, components, relationships, quality attributes, API contracts, shared data models, event contracts
  3. Evaluate against quality attributes → per-metric scores, findings, recommendations keyed by area
  4. Refine — regenerates while the best score stays below 50, up to retrieval.max_tries attempts (config default 3)

109 built-in patterns (one JSON file each in the server's pattern directory), 24 BlockchainDomain slugs, 16 pattern categories, 4 workflow prompts, 11 tools.

OMP constraints (read first)

1. OMP is a short-timeout client → the async job trio is the default design entry point

OMP applies one MCP request deadline, resolved in this order: OMP_MCP_TIMEOUT_MS env → the server's timeout field (milliseconds) in ~/.omp/agent/mcp.json → 30 000 ms default. It is a single timer per request (src/mcp/timeout.ts, src/mcp/transports/http.ts); server progress notifications do not extend it, so the server's 30 s heartbeat buys nothing here.

If the blockchain-pattern entry in ~/.omp/agent/mcp.json sets no timeout, the 30 s deadline applies. Every LLM-backed tool exceeds it — the pipeline shape is the same one measured on the sibling pattern server from the other catalogue, where analyse took ~66 s, generate ~211 s, evaluate ~197 s, and the full design 5–10 minutes:

CallDeviceLatency
submit_blockchain_design_jobxd://mcp__blockchain_pattern_submit_blockchain_design_jobmilliseconds
get_blockchain_design_statusxd://mcp__blockchain_pattern_get_blockchain_design_statusmilliseconds
cancel_blockchain_designxd://mcp__blockchain_pattern_cancel_blockchain_designmilliseconds
list_blockchain_patterns / get_blockchain_patterncatalog devicesmilliseconds
analyze_blockchainxd://mcp__blockchain_pattern_analyze_blockchain~1 min → aborted at 30 s by OMP
generate_blockchainxd://mcp__blockchain_pattern_generate_blockchain~3.5 min → aborts
evaluate_blockchainxd://mcp__blockchain_pattern_evaluate_blockchain~3 min → aborts
design_blockchainxd://mcp__blockchain_pattern_design_blockchain5–10 min → aborts

Attempting the one-shot call under the default deadline yields, verbatim:

MCP failure
server: blockchain-pattern
tool: analyze_blockchain
transport: http
stage: receive
failure: timeout
retryable: no
message: Request timeout after 30000ms
next: Check server health or increase the MCP timeout; the request outcome is unknown.

The timeout does not stop the server: the aborted call keeps running and its result goes nowhere. The outcome is unknown — a background job submitted before the timeout keeps running and can still be polled. The server's own tool descriptions call design_blockchain the default for callers that want the design artifact and the job trio "only for clients with short request timeouts (Cursor, Claude Desktop)"; under OMP's 30 s deadline OMP is that client — use the job trio for designs, whose result survives in the server's job store. analyze_blockchain (the guidance-only path for coding agents that write their own code) has no async job: raise the deadline first, as described below.

To run the blocking one-shot pipeline instead, add the server (or raise the deadline on the existing entry) under mcpServers in ~/.omp/agent/mcp.json:

"mcpServers": {
  "blockchain-pattern": {
    "type": "http",
    "url": "http://localhost:8823/mcp",
    "timeout": 900000
  }
}

Port 8823 is the dev compose stack (README Path A, default); use 8813 for the persistent systemd stack (Path B) — match the stack you actually run (see README.md / INSTALL.md).

"timeout": 0 disables client-side MCP timeouts for the server. Then /mcp reload. A project .omp/mcp.json entry shadows the user entry; the user file's disabledServers/enabledServers win over both.

For non-OMP clients: the job trio works everywhere; the blocking tools need a request deadline of ≥ 10 minutes (or progress-heartbeat support, which this server emits every 30 s).

2. Tools are xd:// devices

write  xd://mcp__blockchain_pattern_<tool>   JSON args object → tool result
read   xd://mcp__blockchain_pattern_<tool>   device doc + current input schema

Device prefix = server name lowercased with - → _ (blockchain-pattern → mcp__blockchain_pattern). Invalid args echo the schema — fix the JSON and retry, do not switch tools.

3. domain and style are separate arguments — never embed them in requirements

  • requirements — free text of what the system must do (1–100 000 chars, printable; control/format characters are rejected)
  • domain — problem-space tag (1–200 chars, e.g. bridge, defi-trading, l2-scaling, wallet); drives BM25 + dense + cross-encoder pattern retrieval over 24 category/layer slugs. Results are {slug, fusion_score, rerank_score} in matched_domains. A pattern matches when the slug equals its category or its layer.
  • style / override_style — blockchain design decision (1–100 000 chars), one of the 109 BlockchainStyle names; the same vocabulary as pattern names, e.g. zk-rollup, optimistic-rollup, state-channel, constant-product-amm, erc4337. override_style (design/submit) and style (generate) win over the analyse-derived style.

An unknown style string is not rejected: guidance falls back to a generic default and the override flows into generation. If the top requirements-weighted analysis_score is below retrieval.style_score_threshold (default 50), recommended_style is substituted with state-channel and style_fallback: true is set (selected_patterns still holds the real scored candidates). is_fallback: true is the separate, rarer case where stage-1 recall found no real candidate at all — expected behaviour, not an error, in both cases.

4. Do not read patterns through mcp://pattern://… on this host

The server advertises pattern://, pattern://{name}, template://{name}, component://{type}, and OMP reads MCP resources with read mcp://<resource-uri>. But the other pattern servers connected on this host register the same three schemes, and OMP resolves a resource URI by server order (src/internal-urls/mcp-protocol.ts), not by which server owns the resource — the sibling wins and returns its own catalogue or a Pattern not found error even when this server serves the name. Use get_blockchain_pattern / list_blockchain_patterns — the tool route is authoritative and unambiguous.

5. Job ids are the only durable handle

submit_blockchain_design_job returns a job_id and the server persists jobs in SQLite (~/.config/blockchain-pattern-mcp/jobs.db, override BLOCKCHAIN_PATTERN_JOBS_DB) — there is no job-listing tool. A job_id survives a turn boundary, a client restart, or an OMP timeout, but only if you keep it: write it to a scratch file (e.g. .omp/blockchain-pattern-job.txt) when the poll loop may outlive the turn.

Entry-point decision guide

Existing design to score?
├── YES → evaluate_blockchain (device mcp__blockchain_pattern_evaluate_blockchain)
└── NO
    ├── Coding agent will write the implementation itself
    │   → analyze_blockchain: recommended style, pattern cards, pattern quality profile — no design artifact
    │     (one lightweight LLM call ~1 min; raise the server timeout first, there is no analyze-only job)
    ├── Explore the catalog first   → list_blockchain_patterns (category?/domain?) → get_blockchain_pattern(name)
    ├── Caller wants the design artifact → job trio: submit_blockchain_design_job → get_blockchain_design_status
    │                                  (use design_blockchain directly only when the server timeout in
    │                                   ~/.omp/agent/mcp.json is >= 600000 or 0)
    └── Known style + patterns      → generate_blockchain (skips the analyse leg)

Device quick reference

Device suffixPurposeLatencyNotes
design_blockchainFinished design artifact + evaluation, one call5–10 minfor callers that want the design; needs a raised MCP timeout
analyze_blockchainStyle + pattern cards for agents that write their own code; no design artifact~1 minguidance-only path; aborts under the 30 s deadline — raise the timeout first
generate_blockchainDesign from explicit style + selected_patterns~3.5 minaborts under the 30 s deadline
evaluate_blockchainScore an existing design dict~3 minaborts under the 30 s deadline
submit_blockchain_design_jobStart pipeline, returns job_idmsdefault design entry point
get_blockchain_design_statusPoll job; result when completedmsidempotent
cancel_blockchain_designBest-effort cancel at stage boundarymsnot idempotent
list_blockchain_patternsMinimal pattern view (name, description)msidempotent; unknown category returns []
get_blockchain_patternFull pattern JSON by exact namemsidempotent; unknown name raises Pattern not found: <name>
list_prompts, get_promptWorkflow prompt templatesfasttool route for prompt clients

Job trio recipe

  1. Submit — write xd://mcp__blockchain_pattern_submit_blockchain_design_job with {"requirements": "...", "domain": "...", "override_style": null} → {"job_id": "<uuid>", "status": "pending", "message": "Job <uuid> created. Poll get_blockchain_design_status('<uuid>') until status is 'completed', 'failed', or 'cancelled'."}
  2. Persist the job_id (see constraint 5) before polling.
  3. Poll — write xd://mcp__blockchain_pattern_get_blockchain_design_status with {"job_id": "..."} every 10–30 s (interleave other work or bash sleep 15); branch on status:
StatusmessageAction
pendingJob is queued, not yet started.poll again after 10–30 s
runningJob is actively running the design pipeline.poll again after 10–30 s
completedJob completed successfully.read result (same schema as design_blockchain)
failedJob failed — see the error field.report error
cancelledJob was cancelled by a cancel_blockchain_design call.report; offer to resubmit
  1. Cancel — write xd://mcp__blockchain_pattern_cancel_blockchain_design with {"job_id": "..."} → {"job_id": "...", "status": "cancelled", "cancelled": true, "task_was_running": true, "message": "..."}. Best-effort: the pipeline checks the flag at stage boundaries, so up to one LLM call may still land. Jobs already completed/failed/cancelled return cancelled: false; unknown ids raise ERR_404.

Interpreting results

  • final_quality_score (0–100): ≥ 75 strong, 50–74 workable with named tradeoffs, < 50 means the pipeline regenerated and still returned its best attempt
  • attempts (1–3 with the default max_tries): > 1 means the pipeline self-healed — read evaluation.recommendations to see what changed
  • evaluation.summary.overall_score (0–100), strengths, weaknesses, critical_findings; evaluation.metrics[] carries {name, score 0–100, description, findings, recommendations, reasoning} per attribute
  • The quality attributes are the eight keys attested in docs/pattern-schema.json: security, cost_efficiency, scalability, decentralization, composability, liquidity, simplicity, privacy
  • evaluation.recommendations is a map keyed by area ({"security": [...], "decentralization": [...]}); evaluate_blockchain flattens it to a list and scores 0–10
  • final_style + alternative_styles ({name, score} runner-ups, excluding the delivered style; empty on fallback) — present a genuine second option instead of an invented comparison
  • matched_domains: retrieval slugs with fusion_score/rerank_score; a low top analysis_score (→ style_fallback: true) or empty recall (is_fallback: true) explains the state-channel substitution
  • analyze_blockchain extras: requirement_weights (0.0–1.0 per attribute; drove the deterministic ranking) and style_fallback (true when recommended_style is the fallback); evaluate_blockchain adds integrity_findings (advisory DIV-N notes, never blocking)

Prompts (workflow templates)

Interactive OMP sessions expose each server prompt as a slash command named <server>:<prompt>, with key=value arguments:

/blockchain-pattern:design_blockchain_workflow requirements="..." domain="bridge" style="optimistic-rollup"
/blockchain-pattern:explore_pattern_catalog domain="defi-trading" category="mev"
/blockchain-pattern:evaluate_my_blockchain focus="security"
/blockchain-pattern:compare_blockchain_styles style_a="zk-rollup" style_b="optimistic-rollup" requirements="..."

/mcp prompts lists what is connected. Outside the interactive TUI, call the tool route instead: write xd://mcp__blockchain_pattern_get_prompt with {"name": "design_blockchain_workflow", "arguments": {"requirements": "...", "domain": "..."}} (arguments: requirements*, domain, style for the design workflow; style_a*, style_b*, requirements* for the comparison — that one costs two generate_blockchain calls).

Reference files

  • skill://blockchain-pattern-mcp/references/tools.md — per-tool schemas, exact output fields, error codes, the deadline-failure format, tool annotations, and the design-dict shape
  • skill://blockchain-pattern-mcp/references/workflows.md — recipes (job trio, raised-timeout one-shot, catalog → generate, evaluate, prompts), result interpretation, and OMP troubleshooting

skill://blockchain-pattern-mcp/... URIs resolve to files beside this SKILL.md; bare references/... paths resolve against the session cwd and will dangle.

Habilidades Relacionadas