@dcprotocol/client

Low-level runtime client used by DCP packages. For most agent developers, MCP through@dcprotocol/agent is the better public interface.

Install

npm install @dcprotocol/client

Requires Node.js 22.

When To Use It

  • You are extending DCP runtime packages.
  • You need a custom service integration and understand service identity/signatures.
  • You need direct local or relay transport behavior.

When Not To Use It

If you are building a normal agent, use MCP. MCP gives the model tool descriptions, scope guidance, and safer defaults.

Runtime Notes

  • Public wallet surface is Solana.
  • Remote agents should normally use @dcprotocol/agent install-service.
  • Use HTTP MCP from non-TypeScript runtimes.

Configuration

OptionUse
modeauto, local, or relay.
localUrlLocal vault URL. Default is http://127.0.0.1:8420.
relayUrlRelay URL. Default is wss://relay.dcp.1ly.store.
vaultIdRequired for relay mode.
vaultHpkePublicKeyRequired for relay encryption.
serviceIdRequired relay service identity.
servicePrivateKeyRequired relay signing key.

Example

import { DcpClient } from "@dcprotocol/client";

const dcp = new DcpClient({
  mode: "local",
  localUrl: "http://127.0.0.1:8420",
  agentName: "my_service",
});

const address = await dcp.getAddress("solana");