Skip to content

Connect Claude Code

Claude Code’s tool calls go through the Gate: a policy decides each one, and each is sealed as a deed.

Before you start

  • A running Deedglass server: the Quickstart gives you one on 127.0.0.1:8080 (or the port you passed to --listen).
  • An agent key. init saved one to .deedglass/quickstart.key.

This is the line the README and deedglass init print:

Terminal window
claude mcp add --scope user deedglass -- npx -y deedglass mcp serve

No key goes into Claude Code’s config. deedglass mcp serve finds the key init wrote: in .deedglass/ of the project Claude Code runs in, or a parent folder, and otherwise through ~/.deedglass/current.json, which init points at its stack whatever its port. So the same entry works in your own project, not only in the Quickstart folder. Use --scope project instead to write the server into this repo’s .mcp.json for your team.

To connect your own Postgres, deedglass connect prints a second line for it, with DEEDGLASS_API_KEY_FILE pointing at its agent’s key file.

Prefer HTTP, with no local process? deedglass mcp snippet --transport http --client claude-code prints this form; replace dg_test_REPLACE_ME with your key:

Terminal
claude mcp add --transport http --header 'Authorization: Bearer dg_test_REPLACE_ME' deedglass http://127.0.0.1:8080/mcp/native

deedglass mcp wrap sits in front of any stdio MCP server. Claude Code starts the wrapper; the wrapper starts the server and sends every tools/call to the Gate first. This is the generated line for the demo’s filesystem server:

Terminal
claude mcp add --env DEEDGLASS_API_KEY=dg_test_REPLACE_ME --env DEEDGLASS_SERVER=http://127.0.0.1:8080 --env PATH=/usr/local/bin:/opt/homebrew/bin:/usr/bin:/bin --transport stdio scratch -- /Users/you/txv/product/bin/deedglass mcp wrap --connector scratch -- /usr/local/bin/npx -y @modelcontextprotocol/server-filesystem@2026.8.31 /tmp/deedglass-demo

Make one for your own server with deedglass mcp snippet --client claude-code --connector <name> -- <command> [args…].

Ask Claude Code to drop a table in the demo database. The tool result says the call was blocked, names the rule, and gives the deed id. Then list what happened:

Terminal
$ deedglass actions list --limit 5
…
  • It doesn’t change what Claude Code decides to do. It decides what Claude Code’s tool calls may do.
  • Tools Claude Code runs on its own (its shell, file edits) don’t pass through MCP, so the Gate never sees them. Use Claude Code’s permission settings for those, and watch the session to see what its shell commands committed to Postgres.
  • The key in the config is an agent key. It can’t change policies or approve anything.