AI Integration

Connect an AI assistant to your Groundwire ship via MCP. Read files, poke agents, run threads, and manage desks — all from natural language.

The %mcp desk is pre-installed in the Groundwire pill. It provides a Model Context Protocol server that works with Claude Code, OpenCode, Codex, and other MCP-compatible agents.

Prerequisites

Authenticate with your ship and save the session cookie:

curl -i http://localhost:8080/~/login \ -X POST -d "password=$(your +code here)"

Find the set-cookie header in the response. It looks like:

urbauth-~your-ship=0v3.j2062.1prp1.qne4e.goq3h.ksudm

Save this value — you’ll need it below.

Step 2 — Register the MCP server

Claude Code

claude mcp add --transport http urbit \ http://localhost:8080/mcp \ --header "Cookie: urbauth-~your-ship=0v3..." \ --scope user

Replace ~your-ship and the cookie value with your actual values. The --scope user flag makes it available across all projects.

OpenCode

Add to your OpenCode MCP config (typically ~/.config/opencode/config.json):

{ "mcpServers": { "urbit": { "type": "http", "url": "http://localhost:8080/mcp", "headers": { "Cookie": "urbauth-~your-ship=0v3..." } } } }

Codex

Codex requires the mcp-proxy bridge. Install it with uvx mcp-proxy, then add to ~/.codex/config.toml:

[mcp_servers.urbit] command = "uvx" args = [ "mcp-proxy", "--transport", "streamablehttp", "--headers", "Cookie", "urbauth-~your-ship=0v3...", "http://localhost:8080/mcp" ]

Available tools

Once connected, your AI assistant can interact with your ship. The default tools include:

ToolDescription
get-fileRead a file from Clay
insert-fileWrite a file to Clay
list-filesList files in a desk
commit-deskCommit changes to a desk
build-fileCompile a Hoon file
scryScry into any agent or vane
poke-our-agentPoke an agent
run-testsRun tests
new-desk / mount-deskCreate and mount desks
install-app / nuke-agent / revive-agentManage agents
add-mcp-toolAsk your AI to create new tools

Example usage

In Claude Code or OpenCode, just ask naturally:

Prompts & Resources

MCP prompts are available as slash commands in Claude Code:

/mcp__urbit__commit-desk mcp

Reference ship resources with @ mentions:

@urbit:beam:///base/sys/hoon/hoon @urbit:https://docs.urbit.org/llms.txt

Adding custom tools

You can ask your AI assistant to create new MCP tools. Just describe what you want and it will write a Hoon thread and register it. Tools are threads with the signature:

$-((map @t argument:tool:mcp) shed:khan)

Notes