@dcprotocol/server
v0.2.0
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
- You want to connect a local vault to the default public relay or your own relay for remote agents
Install
npm install @dcprotocol/serverOn Debian/Ubuntu, local keychain-backed usage may require libsecret-1-0.
Run
npx -y @dcprotocol/serverOpen:
http://127.0.0.1:8420Environment Variables
| Variable | Purpose | Default |
|----------|---------|---------|
| VAULT_DIR | Vault storage directory | ~/.dcp |
| VAULT_PORT | Server port | 8420 |
| DCP_RELAY_URL | Relay URL for remote agent access | unset |
| DCP_MCP_SESSION_MINUTES | MCP auto‑unlock window after UI unlock | 30 |
If DCP_RELAY_URL is set, the server will connect the local vault to that relay after startup/unlock.
Use wss://relay.dcp.1ly.store if you want the default public relay run by the DCP maintainers, or set your own relay URL instead.
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
Owner / relay
GET /v1/relay/infoPOST /v1/relay/configPOST /v1/pairing/startGET /v1/servicesPOST /v1/servicesPATCH /v1/services/:idDELETE /v1/services/:id
Remote Agent Flow
This package is the local vault side of the relay flow:
- Start the server locally
- Set a relay URL
- Create a pairing token or trust a service
- Let a remote agent connect through
@dcprotocol/clientor the DCP proxy - Approve consent locally when required
For the full end-user flow, see the root README and the desktop package README.
Docs: see the root README for the full security model.
