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.
  • An agent key (dg_test_…). init saved one to .deedglass/quickstart.key.

The server’s own tools (the Postgres connector and any other connector you set up) are one MCP endpoint, /mcp/native. This is the line deedglass mcp snippet --transport http --client claude-code prints:

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

Replace dg_test_REPLACE_ME with your key. From the Quickstart directory you can let the shell fill it in:

Terminal window
claude mcp add --transport http --header "Authorization: Bearer $(cat .deedglass/quickstart.key)" deedglass http://127.0.0.1:8080/mcp/native

Add --scope project to write the server into this repo’s .mcp.json instead of your user config.

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.
  • The key in the config is an agent key. It can’t change policies or approve anything.