@dcprotocol/server
v0.1.1
Published
REST API server for DCP Vault - localhost:8420
Maintainers
Readme
@dcprotocol/server
Local REST API + approval UI for DCP Vault. Binds to 127.0.0.1 only.
Use this when:
- You want browser‑based approvals
- Your agent runtime can’t spawn MCP subprocesses
- You need a local HTTP interface
Install
npm install @dcprotocol/serverRun
npx @dcprotocol/serverOpen:
http://127.0.0.1:8420Environment Variables
| Variable | Purpose | Default |
|----------|---------|---------|
| VAULT_DIR | Vault storage directory | ~/.dcp |
| VAULT_PORT | Server port | 8420 |
| DCP_MCP_SESSION_MINUTES | MCP auto‑unlock window after UI unlock | 30 |
Unlock / Lock
Unlock the REST process:
curl -X POST http://127.0.0.1:8420/v1/vault/unlock \
-H "Content-Type: application/json" \
-d '{"passphrase":"<your-passphrase>"}'Lock:
curl -X POST http://127.0.0.1:8420/v1/vault/lockUnlock MCP via the UI or:
curl -X POST http://127.0.0.1:8420/v1/vault/unlock-mcp \
-H "Content-Type: application/json" \
-d '{"passphrase":"<your-passphrase>"}'Unlock‑MCP uses the OS keychain; the passphrase is never written to disk.
Read / Sign (REST)
curl -X POST http://127.0.0.1:8420/v1/vault/read \
-H "Content-Type: application/json" \
-d '{"scope":"identity.email","agent_name":"my-bot"}'
curl -X POST http://127.0.0.1:8420/v1/vault/sign \
-H "Content-Type: application/json" \
-d '{"chain":"solana","unsigned_tx":"<base64>","agent_name":"my-bot"}'Endpoints
Browser UI
GET /— local approval UI (dark/light toggle, auto‑refresh)
Core
GET /healthGET /scopesGET /address/:chainGET /budget/check(requireschainfor USDC/USDT)GET /agentsGET /consentPOST /consent/:id/approvePOST /consent/:id/denyPOST /revoke/:agent
v1
POST /v1/vault/readPOST /v1/vault/signGET /v1/vault/activity(supportslimit,agent,type,since)POST /v1/vault/unlockPOST /v1/vault/lockPOST /v1/vault/agents/:id/revokeGET /v1/vault/mcp-status
Docs: see the root README for the full security model.
