delego MCP server
✓ VerifiedProvides intent-bound action authorization for AI agents using deterministic policies, human-in-the-loop approvals, and signed audit trails.
Also known as Delego-Dev/delego
- Stars
- 25
- Tools
- —
- Downloads, 30 days
- 246
- Latest version
- 0.3.4
- Last commit
- Jun 11, 2026
- License
- Apache-2.0
What is delego MCP?
delego provides intent-bound action authorization for AI agents using deterministic policies, human-in-the-loop approvals, and signed audit trails.
Summary generated from the project's README
About delego MCP server
Delego provides a decision and audit layer designed to protect against the confused deputy problem in AI agent workflows. It sits between an LLM agent and a credential broker to ensure that an agent only performs actions specifically authorized by a human. By using deterministic policies instead of stochastic models, it prevents prompt injections from tricking an agent into using valid credentials for unauthorized purposes. The system is implemented in pure Python and does not hold any user secrets or credentials itself.
Developers can use this as a local MCP server via stdio by installing the delego-mcp extra. Once configured in an MCP client like Claude Code, the agent uses tools such as delego_propose_action to submit requests. If a policy requires it, a human must manually approve the action through the delego CLI using commands like approve or deny. The server maintains a tamper-evident, Ed25519-signed hash chain for all actions, providing a verifiable audit trail of every intent and approval.
What you can do with it
- 1Preventing unauthorized action substitutionA developer can ensure an agent cannot reuse a single human approval to execute a different, malicious command.
- 2Enforcing strict financial or operational limitsYou can define policies that restrict agent actions based on specific transaction amounts or allowed destinations.
- 3Verifying the integrity of agent logsAn administrator can check the signed audit ledger to ensure no history has been altered or reordered.
- 4Integrating with existing credential managersThe system can be wired to work alongside tools like Agent Vault or OneCLI without needing to manage the secrets directly.
Written from the project's README. Every use case is checked against a quote from it.
How to install delego MCP
Formats verified 10 Nov 2026Add to CursorAdd to GooseInstall delego MCP in Claude Code
$ claude mcp add delego -- uvx delegoInstall delego MCP in Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"delego": {
"command": "uvx",
"args": [
"delego"
]
}
}
}Install delego MCP in VS Code
.vscode/mcp.json
{
"servers": {
"delego": {
"type": "stdio",
"command": "uvx",
"args": [
"delego"
]
}
}
}Install delego MCP in VS Code CLI
$ code --add-mcp '{"name":"delego","type":"stdio","command":"uvx","args":["delego"]}'Install delego MCP in Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"delego": {
"command": "uvx",
"args": [
"delego"
]
}
}
}Install delego MCP in Codex
$ codex mcp add delego -- uvx delegoInstall delego MCP in Codex config.toml
~/.codex/config.toml
[mcp_servers.delego] command = "uvx" args = ["delego"]
Install delego MCP in Gemini CLI
$ gemini mcp add -s user delego uvx -- delegoInstall delego MCP in Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"delego": {
"command": "uvx",
"args": [
"delego"
]
}
}
}Configuration
DELEGO_HOMEDirectory holding the policy, signing keys, and audit ledger (defaults to ~/.delego). Set this to keep state project-scoped, e.g. /abs/path/to/project/.claude/.delego.
| Name | Description | |
|---|---|---|
| DELEGO_HOME | Directory holding the policy, signing keys, and audit ledger (defaults to ~/.delego). Set this to keep state project-scoped, e.g. /abs/path/to/project/.claude/.delego. |
Automated checks
Ran Nov 14, 2026Full report →Passed our automated checks. That is not a security audit: read the code and give the server the narrowest access it needs. How checks work
- Source repository linked and reachabledelego-dev/delego is public and reachablegithub.com/delego-dev/delego ↗Pass
- Package names this repository as its sourcedelego names delego-dev/delego as sourcepypi.org/project/delego/ ↗Pass
- Build provenance (Sigstore attestation)Sigstore attestation for delegopypi.org/project/delego/ ↗Pass
- Open source license (OSI)Apache-2.0spdx.org/licenses/Apache-2.0.html ↗Pass
- Commit or release in the last yearLast commit or release 2026-06-11github.com/delego-dev/delego ↗Pass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNo popular package one edit away from delegoPass
- No critical advisory in the package or its dependencies6 resolved dependencies checked; no critical advisoryosv.dev ↗Pass
- No hidden instructions to the model0 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNot checked
- Remote endpoint answers the MCP handshakeNot checked
README
View on GitHubdelego
Website: delegohq.com · Docs: delegohq.com/docs · Spec: Delego-Dev/specification
Intent-bound action authorization for AI agents. It sits between an agent and whatever credential broker holds the user's secrets, and it answers the one question brokers don't: is this specific action the thing the human actually asked for?
agent ──propose──▶ delego ──if allowed──▶ credential broker ──▶ service
(LLM) (policy + (Agent Vault / (bank,
approval + OneCLI / SaaS,
audit) Browser Use…) API)
│
└── needs_approval ──▶ human (CLI)
📜 Protocol: delego implements protocol 0.3 of the open delego wire specification — canonicalization, the policy schema, intent/fingerprint binding including the §4.2 query-fold, and the signed audit chain. The authorization token (spec §9) is an optional profile, not yet implemented.
Why this exists
The "agent gets its own scoped credential, and never holds the user's secret directly" pattern is now a crowded, converging space — Infisical's Agent Vault, OneCLI, Browser Use, Nango, and others all do credential brokering.
The harder problem sits one level up — the confused deputy: the agent holds a valid credential, a prompt injection redirects it, the scope covers the action, so the broker happily injects the secret and the action goes through. The credential is the wrong place to catch this — it's valid. OAuth tokens carry no commitment to the original instruction.
Authorising the action (not just the credential) is an active area — see deterministic policy engines (OPA/Cedar, Permit), human-in-the-loop approval (HumanLayer), MCP gateways/firewalls, and the "pre-action authorization" line of research. delego is a small, deterministic, local, Apache-2.0 reference for it: no LLM in the decision path, no credential custody, approvals bound to the exact action fingerprint, and a signed, hash-chained audit trail — riding the existing broker layer rather than competing with it.
What it is / isn't
- Is a decision-and-audit layer. Deterministic policy, human approval for sensitive actions, signed append-only audit ledger.
- Isn't a credential vault or a proxy. It delegates execution to a broker
through a thin
BrokerAdapterinterface — you ride the existing layer instead of rebuilding it. - Authorisation is pure Python, no LLM in the loop. A model can advise upstream; the decision that gates a credential is made outside the stochastic loop, so an injection can't talk its way past it.
Key properties
- Intent binding — every action carries a hash of the original human instruction, recorded in the audit ledger and re-checked at resolve time, so an approval cannot be re-pointed at a different claimed instruction.
- Action-bound, single-use approval — a human "yes" is bound to one exact action fingerprint. An agent that gets approval for action A cannot reuse it to run action B (the confused-deputy guard), and cannot replay the same approval to run action A twice — an approval releases its action exactly once.
- Tamper-evident audit — receipts form an Ed25519-signed hash chain.
Editing, reordering, removing a receipt, or dropping a field breaks
verification, which reports the fault rather than trusting the ledger.
Caveats (be precise): hash-chaining does not catch truncation of the
most recent receipts (a tail-truncated prefix verifies clean), and the local
signing key protects nothing against a host compromise. For rollback
detection, anchor the head externally and pass it to
verify(expected_head=…); for key safety, use an HSM/KMS. See SECURITY.md.
Quickstart
pip install delego # the `delego` library + CLI
# pip install "delego[mcp]" # add the `delego-mcp` server (MCP is an optional extra)
delego init # creates ~/.delego with signing keys and an example policy
delego policy # inspect the active policy
To run the full loop end-to-end from a clone — an allowed read, a forbidden deny, an over-cap deny, an approval flow, the confused-deputy guard refusing a substituted action, and audit-chain tamper detection (no agent or live service needed):
git clone https://github.com/Delego-Dev/delego && cd delego
pip install -e ".[dev]"
python examples/demo.py
pytest
Human side (CLI)
delego policy # show the active policy
delego pending # list actions awaiting approval
delego approve apr_xxxx # release a parked action (or: delego deny apr_xxxx)
delego log -n 20 # read recent receipts
delego verify # check the audit chain (hashes, linkage, signatures)
Agent side (MCP) — wiring into Claude Code
delego ships an MCP server (delego_mcp) over stdio — install it with the mcp
extra: pip install "delego[mcp]". Register it in your MCP
config (for Claude Code, .mcp.json at the project root) so the agent can
propose actions. Set DELEGO_HOME to keep the policy, signing keys, and ledger
project-scoped under .claude/.delego:
{
"mcpServers": {
"delego": {
"command": "delego-mcp",
"env": { "DELEGO_HOME": "/abs/path/to/project/.claude/.delego" }
}
}
}
Initialise that home and approve from the same one (the CLI and MCP server must share a home):
delego --home .claude/.delego init # keys, example policy, and a .gitignore
delego --home .claude/.delego pending # ...then: delego --home .claude/.delego approve apr_xxxx
If DELEGO_HOME is unset, the CLI also auto-uses ./.claude/.delego when run
from the project root, falling back to ~/.delego. (Use an absolute path in the
MCP env, since the server's launch directory isn't guaranteed.)
Tools exposed:
| tool | what it does |
|---|---|
delego_propose_action |
submit an action; returns allow / deny / needs_approval |
delego_resolve_action |
complete an approved action (fingerprint must match) |
delego_pending |
list actions awaiting human approval (read-only) |
delego_audit_tail |
read recent receipts |
delego_show_policy |
show the active policy |
Approving and denying are deliberately not exposed over MCP — the agent that proposed an action must never be able to approve it; a human decides out-of-band.
Typical flow: the agent calls delego_propose_action. If it comes back
needs_approval with an approval_id, a human runs delego approve <id>, then
the agent calls delego_resolve_action with the identical action to complete it.
Policy format
A rule matches on method / host / path (glob) / path_contains, decides
allow or needs_approval, and can attach constraints. Order is forbidden
(hard deny) → rules (first match wins) → default. A matched rule whose
constraints fail becomes a deny (fail-closed). See policy.example.yaml.
rules:
- name: place-order
decision: needs_approval
match: { method: POST, host: api.example.com, path: /orders }
constraints:
amount: { field: amount, max: 5000, currency: USD }
allow_list: { field: destination, in: [internal] }
Supported constraints: amount (cap + currency), allow_list
(field-in-set), rate_limit (max per minute/hour/day, counted from the ledger).
Build on delego
Three ways to use it, lowest friction first:
- As an MCP server —
delego init, add thedelego-mcpserver to your MCP config, and your agent proposes actions instead of executing them. No code. - As a library —
pip install delego, write a policy + aBrokerAdapter, and callfw.propose(...)in your tool-call path. - Behind a service — wrap the
Firewallin an HTTP API so many agents share one decision point and one audit chain.
The one extension point is the broker — where your credential lives and the authorised action actually runs. delego never holds the secret:
NullBroker(default) — simulates execution; for demos and tests.HTTPProxyBroker(gateway_url)— forwards the authorised action to an external credential gateway (OneCLI / vault / proxy) that injects the secret upstream.- Your own — implement
execute(action) -> dictagainst theBrokerAdapterprotocol indelego/brokers.py.
▶ Delego-Dev/sample-app — a FastAPI service built on the published package, with the full propose → approve → resolve loop and a copy-paste curl walkthrough. The best starting point for building your own.
See ROADMAP.md for where delego is going and where to help.
Status
- Implemented (protocol 0.3): the policy engine, intent hashing, action
fingerprinting with the URL query folded into the fingerprint (spec §4.2 —
/orders?to=meand/orders?to=attackerare different actions), the confused-deputy guard, intent-bound + single-use human approvals, the signed, hash-chained audit ledger with verification and an external head-anchor check (delego verify --expected-head), and the §9 authorization token (optional profile) — a short-lived, EdDSA-signed JWS a separated broker verifies before injecting a credential (build_firewall(..., mint_tokens=True);verify_token/require_fingerprint). - Single-writer daemon (
delego daemon): one long-running process owns the ledger, so every client routes through it andrate_limitis exact across all of them — not just one host's file lock. The CLI'sapprove/deny/pendingauto-route to a running daemon. Optional: with no daemon, everything works file-backed as before. - Brokers: the default
NullBrokerholds no credentials and makes no real request — it records what would be sent (for demos and tests).HTTPProxyBrokerforwards an authorised action — and its authorization token — to an external credential gateway; or write your own against theBrokerAdapterprotocol indelego/brokers.py. - Not yet: the MCP agent surface auto-routing to the daemon (it still talks to the firewall directly — wiring it is the next step), a TCP/cross-host daemon transport (it's a local Unix socket today), and a non-MCP HTTP surface.
- Known limitations: without the daemon, concurrent writes to the file-backed
ledger and approval store are serialised with an OS file lock (corruption-safe),
and a
rate_limitis exact only among processes sharing one home on one host. Rundelego daemonfor exact rate limits across all clients (one writer). The daemon serializes one action in flight at a time (a reserve-then-execute throughput optimization, and a TCP transport for other hosts, are future work). Path globbing is coarse (**and*collapse).
License
Licensed under the Apache License 2.0.
delego MCP questions
How do I add delego MCP to Claude Code?
Run claude mcp add delego -- uvx delego in your terminal. Add --scope user to make it available in every project.
How do I add delego MCP to Cursor?
Open ~/.cursor/mcp.json and add the server under mcpServers, using the Cursor config shown in the install section above.
Does delego hold my secrets or credentials?
No, delego is not a credential vault. It sits between an agent and a credential broker to authorize actions without holding the secrets itself.
Can an AI agent approve its own actions?
No, approving and denying actions are deliberately excluded from the MCP interface to ensure a human must decide out-of-band.
How does delego prevent prompt injection attacks from executing unauthorized actions?
It uses deterministic policy engines and intent binding, ensuring decisions are made outside the stochastic LLM loop and bound to a specific action fingerprint.
What happens if the audit trail is tampered with?
The system uses an Ed25519-signed hash chain; any editing, reordering, or removal of receipts will break verification.