Open source · MITLocal-first — keys never leave your browserMCP server built in

Runnable notebooks for
smart contract handoff

Compose reads, writes and raw RPC calls into notebooks that run like Jupyter cells — chained with {{variables}}, simulated before anything is sent, and shared with your team as a single source of truth. Every block generates the exact wagmi/viem code your app can ship — and every instance is an MCP server your coding agent can drive.

Chainstitch capscreen of the seeded Uniswap V3 and Chainlink example notebook, with chained variables and generated code

Capscreen from the same seeded example notebook (no wallet needed): deriving the Uniswap V3 USDC/WETH pool from its factory, reading pool state and the Chainlink ETH/USD price — chained with {{usdc}} / {{pool}} against Ethereum mainnet.

Everything that touches a contract, in one document

Chained like Jupyter cells

Run blocks top to bottom; save any output as a {{variable}} and feed it into the next call. Multi-step DeFi flows stay readable — approve → deposit → check balance.

Simulate as anyone

Dry-run entire notebooks as any address on an ephemeral anvil fork — writes impersonate so multi-step state accumulates, then the fork is discarded. Revert reasons and decoded traces surface before anything hits a real chain.

Codegen for the handoff

Every block emits its wagmi, viem, web3.py, alloy or Solidity snippet. The notebook is the integration spec — and it can't drift, because you just ran it.

AI import from Foundry tests

Paste a .t.sol file and it converts into runnable blocks — pranks become sender groups, cheatcodes become RPC cells, asserts become checks. Bring your own free Gemini key.

Recipes & live state

Save any flow as a reusable recipe and rerun it as one cell in any notebook. Pin view functions to a live per-contract dashboard, refreshed in one multicall.

Team-ready sharing

Sign-In with Ethereum, invite by wallet address, viewer/editor/owner roles, per-project guests, and “anyone with the link” URLs — no email server to run.

Two modes, one env var apart

The same codebase and the same database serve a private single-user tool and an invite-only team instance.

Local (default)

  • No login, no accounts — clone it and run it
  • Everything in one SQLite file on your machine; no telemetry, nothing phones home
  • npm install && npm run dev is the whole setup

Team (APP_MODE=team)

  • Sign-In with Ethereum — identity is the wallet, no email server
  • Invite-only: wallets get viewer / editor / owner roles, workspace-wide or per project
  • Google-Docs-style Share on every project, plus “anyone with the link” URLs

Switching modes keeps all your data — how to self-host.

The notebook is the integration doc

Prove the flow works by running it, then flip the code toggle and copy the exact wagmi hooks or viem calls — ABIs and addresses included from the project's address book. The handoff document stops drifting because it is the same artifact you just executed.

  • Per-block or whole-notebook source, in five flavors
  • Export any notebook as a JSON call manifest
  • Recipes turn multi-step flows into one reusable cell
A read block with its source toggle open, showing the generated wagmi useReadContract hook
// .cursor/mcp.json — local mode
{
  "mcpServers": {
    "chainstitch": { "url": "http://localhost:3000/api/mcp" }
  }
}

// team mode — Settings → Agent tokens
{
  "mcpServers": {
    "chainstitch": {
      "url": "https://your-instance/api/mcp",
      "headers": { "Authorization": "Bearer cst_…" }
    }
  }
}

> "Make a notebook that checks the vault's allowance
>  and deposits 100 USDC if it's approved."

⏺ create_notebook … ✓ 6 blocks
  http://localhost:3000/p/…/n/…   ← open, hit Run all

Tools include create_notebook, get_notebook_code, add_contract — verified ABIs fetched by address.

Your coding agent speaks Chainstitch

Every instance is an MCP server — connect Cursor, Claude Code or any MCP-capable agent to /api/mcp and prompts become notebooks: the agent reads the repo it already sits in, assembles the blocks, adds missing ABIs, and hands back a URL to run. Ask for the reverse and any tested notebook comes out as wagmi, viem, Python or Rust source. Local mode needs no credentials; team mode uses a personal API token from Settings.

  • No extra process — local needs no key; team mode uses a revocable Bearer token
  • Agents write definitions; execution stays in your browser, writes stay signed by your wallet
  • Notebooks travel as files too: versioned JSON import/export for PR review

Coming soon

Chainstitch is young and moving fast — this is what's on the bench next.

MCP flow-authoring pack

Templates and stronger agent instructions so deposit/withdraw/… notebooks consistently include expect-event and handoff-friendly variables.

MCP execution tools

Agents can simulate or fork-run a notebook and get receipts back over MCP before sharing with the team.

Deploy blocks

Deploy from a Foundry/Hardhat artifact; the new address becomes a variable and an address-book entry.

Safe Transaction Builder export

Export any flow as a Safe batch — an executable multisig runbook for ops.

Own everything

One SQLite file on your machine. No accounts, no telemetry, nothing phones home. Private keys never touch the server — writes are signed in your browser wallet, reads run straight against your RPC.

npm install && npm run dev   # that's it — SQLite bootstraps itself

Step-by-step Docker and team-mode guides live in the docs and the README on GitHub.