Back to Browse

Drift MCP Server

by Mrpkk
Developer ToolsLow Risk10.0MCP RegistryRemote
Free

Server data from the Official MCP Registry

Block an action a signed mandate does not permit: amount, payee, audience, currency, window, intent.

About

Block an action a signed mandate does not permit: amount, payee, audience, currency, window, intent.

Remote endpoints: streamable-http: https://drift.rta.lat/mcp

Security Report

10.0
Low Risk10.0Low Risk

Valid MCP server (1 strong, 0 medium validity signals). No known CVEs in dependencies. Imported from the Official MCP Registry.

3 tools verified · Open access · No issues found

Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.

Permissions Found in Source Code

Found by scanning the linked source code. This listing connects to a hosted endpoint, so none of this runs on your machine: it describes what the server software does where it is hosted.

HTTP Network Access

Connects to external APIs or services over the internet.

env_vars

Applies to the server that hosts this plugin, not to your machine.

file_system

Applies to the server that hosts this plugin, not to your machine.

How to Connect

Remote Plugin

No local installation needed. Your AI client connects to the remote endpoint directly.

Add this to your MCP configuration to connect:

{
  "mcpServers": {
    "io-github-mrpkk-drift": {
      "url": "https://drift.rta.lat/mcp"
    }
  }
}

Documentation

View on GitHub

From the project's GitHub README.

drift

M8ven Score Listed on mcpservers.org mrpkk/drift MCP server

Continuous mandate enforcement for AI agents. Every action is checked against the signed mandate before it happens, not once at signing.

Live: https://drift.rta.lat · MCP endpoint: https://drift.rta.lat/mcp

pip install drift          # or: pip install -e .
python3 -m drift.http_server --http 8080

Permissions and the state volume

The container starts as root for exactly one step: it creates the state directory and hands it to user 10001, then drops privileges with setpriv. The application itself never runs as root (/proc/1/status → Uid: 10001). Without that step a named volume is mounted root:root and the first paid call fails with Permission denied when writing the payment journal — verified and fixed on 26.11.2026. Check the result yourself:

docker compose exec drift cat /proc/1/status | grep Uid      # 10001
docker compose exec drift ls -ld /data/a                     # owned by 10001

Self-host in four commands

git clone https://github.com/mrpkk/drift && cd drift
docker compose up -d --build
curl -s http://127.0.0.1:8095/health          # {"status": "ok", ...}
docker compose ps                            # ждём Up (healthy), не просто Up
curl -s -X POST http://127.0.0.1:8095/mcp -H 'content-type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

Port already taken? Check first, then pick a free one:

ss -tlnp | grep ':8095' || echo "8095 свободен"
DRIFT_PORT=28095 docker compose up -d      # наружу по-прежнему только 127.0.0.1
curl -s http://127.0.0.1:28095/health

Если ss показывает python3 .../drift/http_server.py --http 8095 — drift уже запущен как системный сервис на этой машине; контейнер ему не нужен, проверяйте http://127.0.0.1:8095/health напрямую. 28.11.2026: на этой машине 8095 занят сервисом, а 18095 — статическим http.server, поэтому в примере свободный 28095.

Проверено 22.11.2026 на чистой машине: docker compose build → up -d → контейнер Up (healthy) (23.11.2026: проверено живьём — Up 23 seconds (healthy), /health 200 за 4 мс), /health → 200, tools/list → список инструментов. Образ запускается от пользователя drift (uid 10001), корневая ФС read-only, no-new-privileges.

What you get by default:

TransportHTTP on 127.0.0.1:8095 (не в интернете — публикация это ваше решение)
Quota100 free checks per day (DRIFT_FREE_TIER_PER_DAY)
Paymentoff until DRIFT_X402_ENABLED=1 and DRIFT_X402_PAY_TO are set
Statevolume drift-state → /data; persists /data/a/payments.json (payment journal). Free-tier counters and sessions are in memory and reset on restart
Hardeningread_only: true, no-new-privileges, non-root user in the image
HealthcheckGET /health каждые 30 с (в образе и в compose)

Turn the paid rail on (optional):

DRIFT_X402_ENABLED=1 DRIFT_X402_PAY_TO=0xYourAddress docker compose up -d
# default is Base Sepolia: the bundled facilitator (x402.org) does not serve mainnet.
# For real money set both:
#   DRIFT_X402_NETWORK=eip155:8453 DRIFT_X402_FACILITATOR=<mainnet facilitator> DRIFT_X402_ENABLED=1

Stdio mode stays available for local MCP clients:

docker run --rm -i drift-mandate:local python3 mcp_server.py

Nothing else is required: no database, no external service, no keys to fetch at build time. If the container is unhealthy, docker compose logs drift shows the reason.

Requirements

  • Docker Engine 24+ with Compose v2 (docker compose version), Linux/macOS/Windows.
  • ~256 MB RAM, 100 MB disk. No database, no external service, no build-time secrets.
  • A free TCP port — the default 8095 binds to 127.0.0.1 only.

Upgrade

git pull
docker compose up -d --build        # пересобирает образ, том не трогает
docker compose ps                   # снова Up (healthy)
curl -s http://127.0.0.1:8095/health

The drift-state volume survives rebuilds: /data/a/payments.json (payment journal) is not lost. Free-tier counters and sessions are in memory and reset — expected, it is written above.

Backup and restore

# backup: one tar of the state volume (образ продукта, без внешних зависимостей)
docker run --rm -v drift_drift-state:/data -v "$PWD":/backup --entrypoint sh \
  drift-mandate:local -c 'tar -czf /backup/drift-state-$(date +%F).tar.gz -C /data .'

# restore into a fresh volume
docker compose down
docker run --rm -v drift_drift-state:/data -v "$PWD":/backup --entrypoint sh \
  drift-mandate:local -c 'rm -rf /data/* && tar -xzf /backup/drift-state-2026-11-29.tar.gz -C /data'
docker compose up -d

docker volume ls | grep drift shows the real volume name; if the project directory has a different name, the volume prefix differs too. Проверено 29.11.2026: tar внутри образа есть, бэкап и список содержимого работают; отдельный образ для бэкапа не нужен.

Восстановление проверено живьём: бэкап снят из тома с файлом, принадлежащим 10001; распакован в чистый том — ls -ln показывает 10001 10001, содержимое payments.json совпадает. То есть tar запускается от root, но хранит числовые uid/gid, и после restore сервис снова может писать журнал.

Troubleshooting

SymptomCauseFix
bind: address already in useport 8095 занят (часто системным drift)ss -tlnp | grep 8095, затем DRIFT_PORT=28095 docker compose up -d
container unhealthyсервер не отвечает на /healthdocker compose logs drift — там причина; curl -s http://127.0.0.1:8095/health
Permission denied на /data/aтом создан root:root (старый compose без шага setpriv)пересоздать том: docker compose down -v (сотрёт журнал) или починить права на /data
x402 падает на mainnetbundled facilitator не обслуживает Base mainnetзадать DRIFT_X402_NETWORK=eip155:8453 и DRIFT_X402_FACILITATOR=<mainnet>

The gap

An agent is granted a mandate: who to pay, how much, in which currency, until when. AP2 verifies that mandate once, at signature time. After that the agent acts alone, and nothing holds it inside its authority.

Measured proof that this matters, from the AP2 Python SDK itself:

verify_chain documents:
  "enforcing expected_aud / expected_nonce on the terminal hop when provided"

but kb_sd_jwt.verify calls verify_expected_claims only when typ in TYP_TERMINAL,
and a kb+sd-jwt+kb token — which the SDK itself produces whenever the payload
carries a cnf — falls into TYP_INTERMEDIATE:

  hop type      : kb+sd-jwt+kb
  aud in token  : https://attacker.example/ap2
  expected_aud  : https://honest-merchant.example/ap2
  ACCEPTED a token with the wrong audience.

The protocol an agent trusts with its spending authority does not check that the authority was not substituted. drift checks it.

What it checks

#rulecatches
1amountover the limit — the most common form of drift
2payeewrong recipient
3audiencepayment redirected to someone else
4currencycurrency substituted
5windowoutside the validity period
6intentintent outside the allowlist

Default is DENY. Rules run in fixed order, so a refusal names the most important reason rather than an incidental one.

MCP tools

toolpurpose
drift_checkcheck one action against a mandate
drift_sessioncheck a sequence, get a report with a chain fingerprint
drift_explainshow the rules in the order they apply

No SSE, no stateful sessions, no HTTP framework. Standard library only.

Example

from drift import Mandate, Drift, Action

m = Mandate(
    payee_id="shop", audience="https://merchant.example/ap2",
    max_amount_minor=10_000, currency="USD",
    valid_from=1_700_000_000, valid_until=1_700_086_400,
    allowed_intents=("buy",),
)
d = Drift(m)
verdict, rule = d.submit(Action(
    intent="buy", payee_id="shop", audience="https://merchant.example/ap2",
    amount_minor=99_999, currency="USD", at=1_700_000_060,
))
print(verdict, rule)   # DENY amount

Limits, stated plainly

  • Does not verify mandate signatures. That is AP2's job. drift runs after signature verification, at the level of decisions.
  • Does not execute. It decides; the caller acts.
  • Does not keep state. A session is an argument. No state means no attack surface and no divergence under replication.
  • Does not tell truth from intent. intent arrives from the agent and is untrusted input. drift bounds the damage; it does not certify the intent.

If an agent controls both intent and amount, it can lie in both. Closing that gap is attest's job: attest proves afterwards, drift bounds beforehand. They are complements.

Buying the setup ($79)

The code here is the engine. The setup — a hard per-task budget, a payee allowlist and a kill switch wired into your stack, tested on a dry run, with a runbook and a signed refusal receipt — is a paid job: $79, 48 hours.

Checking a USDC payment

scripts/check_usdc_payment.py reads the Base transaction receipt through a public RPC and looks for the USDC Transfer event into our address — the amount from a form or an email is not evidence.

python3 scripts/check_usdc_payment.py --tx 0x… --min 79

What it proves: the transfer exists, went to this address, in this token, for at least this amount. What it does not prove: that the sender was the buyer, that the transfer cannot be reversed, or that a second transfer will not arrive later. Two transfers add up; call it once per hash.

Use it from your agent

{
  "mcpServers": {
    "drift": { "url": "https://drift.rta.lat/mcp" }
  }
}

That block is how our own agents call this server. Tools: drift_check (one action), drift_session (a sequence), drift_explain (the six rules and why each exists). 100 free checks per day, then $0.005 per call over x402.

Licence

Apache-2.0.

Reviews

No reviews yet

Be the first to review this server!