databased/mcp-authz-spicedb-demo
AI agent tool-call authorization using SpiceDB (Google Zanzibar) via Model Context Protocol (MCP)
Platform-specific configuration:
{
"mcpServers": {
"mcp-authz-spicedb-demo": {
"command": "npx",
"args": [
"-y",
"mcp-authz-spicedb-demo"
]
}
}
}Add the config above to .claude/settings.json under the mcpServers key.
MCP server that uses AuthZed Cloud (SpiceDB) to authorize every tool call before execution.
┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
│ │ │ │ │ │
│ MCP Client │────▶│ MCP Server │────▶│ AuthZed Cloud │
│ (Claude, etc.) │ │ (this demo) │ │ (SpiceDB) │
│ │◀────│ │◀────│ │
└──────────────────┘ └──────────────────┘ └──────────────────┘
│
▼
┌──────────────┐
│ In-Memory │
│ Document & │
│ Refund │
│ Store │
└──────────────┘Every tool call follows this flow:
read_document("q1-report") as user alice)CheckPermission(user:alice, read, document:q1-report)insufficient_scope errordefinition user {}
definition team {
relation member: user
}
definition document {
relation owner: user
relation editor: user | team#member
relation viewer: user | team#member
permission read = owner + editor + viewer
permission write = owner + editor
}
definition refund {
relation approver: user
permission approve = approver
}| Tool | Description | SpiceDB
Loading reviews...