Crucible

AI-powered browser IDE that develops and previews dApps from a single natural language prompt

Open Agents 2026

🎓 ETHGlobal

📌 Remote

🚀 14 days Hackathon Project

What it is

Crucible is a browser-based development environment for Web3 apps (dApps, which are web frontends backed by smart contracts). You describe an app in plain language. An AI agent writes the Solidity contracts and the frontend, compiles and deploys them to a local blockchain, and shows a live preview. The chat is the main interface. The editor, terminal and transaction inspector let you watch and override each step.

The problem

A dApp workflow spans several separate tools: an editor, a terminal running a local node, a browser, a wallet extension and a block explorer. The developer wires them together by hand, for example by adding a local RPC URL to the wallet and resetting nonces after each chain restart. A general AI assistant sees only the source files. It cannot see chain state, balances or past deployments.

Crucible puts these tools behind one agent, so the agent reads the same chain, files and logs that the developer sees.

How it works

The repository is a Bun and Turborepo monorepo. A control plane in packages/backend (Hono, better-auth, Postgres through Prisma) manages workspaces. It starts one Docker container per workspace, using the crucible-runtime image. Each container hosts that workspace's tool servers. The agent calls these servers through MCP (Model Context Protocol, a standard for exposing tools to a model).

PackageRole
packages/agentAgent loop built on AI SDK v6 streamText, with one MCP client per tool server
packages/mcp-chainPer-workspace Hardhat node: snapshot, revert, mine, fork
packages/mcp-compilerSolidity compilation and artifact store
packages/mcp-deployerLocal, 0G Galileo and Sepolia deploys, plus transaction traces
packages/mcp-walletDev accounts, signing and contract calls
packages/mcp-memoryRevert-fix memory on 0G Storage, with a local file fallback
packages/mcp-meshRuns a Gensyn AXL peer-to-peer node and exchanges help requests
packages/mcp-terminal, packages/mcp-devtoolsAgent shell access and tool-call events
packages/frontendSvelteKit app with CodeMirror editor, xterm.js terminal and preview pane
packages/typesShared types for agent events, API and tool inputs

The data flow for one prompt:

  1. The browser posts the prompt to the control plane. The agent streams events back over server-sent events.
  2. The agent writes files into the workspace directory on the host. That directory is mounted into the container.
  3. The compiler reads contracts from that directory. The deployer records results in .crucible/state.json.
  4. The control plane runs a Vite dev server for the workspace frontend and shows it in an iframe.
  5. The preview page gets a small script that provides window.ethereum. The script forwards allowed requests to the parent page by postMessage. The parent sends them to the backend RPC endpoint, which forwards them to Hardhat. Private keys stay out of the iframe.

The self-healing loop in packages/agent/src/loop.ts starts when a deploy or contract call reverts. It forces a fixed sequence of phases: snapshot the chain, trace the transaction, recall known fixes, write a patch, recompile, restore the snapshot and redeploy. If the redeploy succeeds, the agent resumes the original task. After three failed attempts, the turn ends with a repair_failed event. The recall step checks memory for fixes seen before. When memory has no hit, the system prompt tells the agent to ask peer instances over the mesh.

After a deploy, the agent connects to KeeperHub's hosted MCP server when KEEPERHUB_API_KEY is set. It then uses KeeperHub's workflow tools to set up scheduled or conditional on-chain actions.

What I built

I built the tool servers the agent calls (the MCP servers in the table above). I also built the KeeperHub integration, the 0G integration and the wiring of both into the agent loop. I hosted the live demo on DigitalOcean droplets.

Design decisions

A real backend runtime instead of WebContainers. docs/ARCHITECTURE.md rejects browser-hosted runtimes because Hardhat tracing, long-lived chain state, the AXL node and shared shell sessions need real processes. The browser renders the interface. The backend owns the runtime. The cost is that Crucible cannot be a static site and needs a stateful server.

One container per workspace. Each workspace gets its own chain, tool servers and AXL node. A tool call on one workspace cannot reach another. The runner has no auth of its own, so its host ports must stay bound to loopback, and the control plane checks the session and workspace owner.

A raw socket for the terminal. The docs say Bun's process model cannot hold an interactive bash session and dockerode's hijack mode hangs under Bun. The backend instead upgrades a socket to the Docker engine by hand, in a few dozen lines. The agent uses a separate shell (mcp-terminal), so agent commands and user typing do not mix output.

Forced phases for repair. The loop restricts the available tools and the forced tool choice in each repair phase. This keeps a weaker model on the sequence, and it prevents skipped steps. The trade-off is that the repair path is rigid. A fix that needs a different order of steps is not possible.

Visible fallback for inference. The agent uses 0G Compute by default. An OpenAI-compatible endpoint is a degraded-mode fallback. The docs require the UI to show the active provider, so a fallback is never presented as a 0G response.

Memory split from the working tree. Source files live on backend disk for speed. Only verified fixes go to 0G Storage.

Run it locally

You need Bun 1.3 or later, Docker and a Postgres database. The repository also ships a VS Code devcontainer with Postgres.

  1. Clone the repository: git clone https://github.com/WhyAsh5114/Crucible.git
  2. Install dependencies: cd Crucible && bun install
  3. Copy the backend config: cp packages/backend/.env.example packages/backend/.env
  4. Set DATABASE_URL and BETTER_AUTH_SECRET in that file. Add KEEPERHUB_API_KEY and the 0G credentials to enable those features.
  5. Build the workspace runtime image: docker build -t crucible-runtime:latest -f packages/backend/runtime/Dockerfile .
  6. Start the backend and frontend: bun run dev

For hosted deployment, see docs/DEPLOYMENT.md in the repository.

Reference

LayerChoiceUsed for
Runtime and buildBun, TypeScript, TurborepoExecution, types and task graph
BackendHono, better-auth (SIWE and Google), Prisma, PostgresAPI, sessions and workspace metadata
FrontendSvelteKit 2, CodeMirror 6, xterm.jsApp shell, editor and terminal
AgentAI SDK v6, @ai-sdk/mcpTool calling and MCP clients
Chain toolingHardhat, solc-js, viemLocal chain, compile and RPC types
0GCompute, Storage (KV and log)Inference with receipts and persistent memory
MeshGensyn AXLPeer-to-peer help requests between instances
AutomationKeeperHub hosted MCPPost-deploy workflows
Tests and CIVitest, bun test, GitHub ActionsFormat, lint, type check, build and tests

Outcome

Three people built Crucible for Open Agents 2026, an ETHGlobal event that ran asynchronously for 14 days from 24 April 2026. The hackathon page records no placement. It notes a shout-out from KeeperHub for the integration.

The repository has about 650 commits from 25 April to 3 May 2026 across three contributors, and an MIT LICENSE file. todo.md marks the local build, self-repair, 0G and KeeperHub work as done. It lists as unchecked the dedicated mesh panel, the same-machine and two-laptop AXL proofs, and the live KeeperHub demo run.

Liked Crucible? Here's my background.

Full-stack TypeScript, shipped to real users.