# SDK, CLI & MCP

Source: https://dalp-staging.settlemint.com/docs/changelog/dalp-3-0/cli-api
Script token, identity, compliance and operations work from a terminal or an AI agent, under the signed-in account's permissions.

**Your team scripts the work it repeats, and an AI agent can do the same under the permissions of the person who signed it in.** Issuing a token, registering an identity or checking a holder list through the Console takes clicks that a nightly job or an agent cannot make. DALP 3.0 ships a CLI with commands for that work, an MCP server that offers the commands to agents, and a TypeScript SDK, all calling the Platform API.

Spotlight: The CLI, its MCP tools and the SDK call the Platform API, which checks every call the same way

The Model Context Protocol (MCP) is an open standard that lets an AI agent discover and call tools. Through it, an agent calls the same CLI commands a person types, and the Platform API applies the same permission checks to both.

## Before and after [#before-and-after]

**Before 3.0:** automating platform work meant writing your own client for each API call, and an AI agent had no ready set of DALP tools to discover. Work the Console handled, such as creating a token or registering an identity, stayed manual unless a developer built and maintained a wrapper for it.

**With 3.0:** `dalp` commands cover tokens, token sales, identities, identity recovery, KYC, compliance templates and providers. They also cover fixed yield schedules, settlements, webhooks, platform status and system administration. `dalp mcp add` offers those commands to an AI agent as tools. The Platform API applies the same role check, API key scope check and input validation to each call, returning the same structured error to a person, a script and an agent.

[Figure] Terminal, script and agent calls all pass the same Platform API checks. An operator's command, a script and an agent's MCP tool call all reach the Platform API, which applies the same role, scope and validation checks and returns either a result or a structured error envelope. Labels: Operator; Terminal; Types a command; Script; Pipeline; --format json; MCP tools; Agent; Registered as tools; Same checks; Platform API; Role, scope, validation; Result; Allowed; JSON, YAML or Markdown; Error envelope; Refused; id, category, retryable.

A command, a script and an agent's MCP tool call all reach the Platform API, which applies the same checks and returns a result or a structured error.

## Script the work your team repeats [#script-the-work-your-team-repeats]

The CLI runs Platform API operations from a terminal or a pipeline. `dalp login` opens an OAuth 2.0 device flow in the browser, so no password is typed into the terminal, and stores an API key in the macOS Keychain, or on other systems in a file only the user can read. Every command takes `--format json`, and also YAML, Markdown or JSON lines.

![Create API key sheet asking for a name, a scope and an expiration, over the list of API keys](https://dalp-staging.settlemint.com/docs/screenshots/console-my-account-api-keys-create.light.en.webp)

[Screenshot] Your team creates an API key for a script or pipeline, read-only or with write access.

A Developer at an issuing bank creates a seven-year bond with `dalp tokens create --type bond`, reads it back with `dalp tokens read`, and checks the empty holder list with `dalp tokens holders`. The same three commands run in the bank's nightly job against a test system, reading the JSON output to confirm each step.

When the identity team onboards an investor, `dalp identities create` and `dalp identities register` record the on-chain identity and its country, and `dalp identities registration-status` confirms it landed.

Repeated operational work runs the same way each time and leaves the same platform records as the Console does. We wrote each command by hand for its task, so a new Platform API operation reaches the CLI only when a release adds a command for it.

## Let an agent work under your permissions [#let-an-agent-work-under-your-permissions]

`dalp mcp add` registers the CLI as an MCP server with a supported agent such as Claude Code, Codex, Cursor or OpenClaw, and `dalp --mcp` runs the server directly. `dalp skills add` installs skill files that describe the commands, and `dalp --llms` and `dalp --schema` print the same descriptions as Markdown or JSON Schema.

A Compliance officer asks an agent in the editor to list the compliance templates and the trusted issuers configured for the bank's system. The agent finds the tools, calls them through the officer's signed-in session, and returns the lists. When the agent tries a role grant the officer does not hold, the Platform API refuses the call with a permission error, and the agent reports it instead of retrying.

An agent gets a governed set of tools without a separate integration, and every call it makes is checked against a real account. The agent sees every command whatever the account's roles, and it acts with the full permissions of the signed-in account. The key that `dalp login` creates can write, and a signing request made with an API key does not ask for the PIN or one-time code a Console user enters.

## Branch on errors instead of reading messages [#branch-on-errors-instead-of-reading-messages]

A Platform API failure returns a structured envelope with a stable `DALP-` id, a category, a retryable flag, a `why` and a `fix`. When DALP asks the caller to wait, the envelope also includes `retryAfterSeconds`. The TypeScript SDK raises it as a `DalpSdkError` with the same fields, and the CLI prints them in its JSON output.

A Developer's job submits a transfer to an investor whose on-chain identity lacks the required KYC claim. The call fails with "Recipient not verified", marked not retryable, and its `fix` says the recipient must complete identity verification first. The job stops and hands the case to the identity team instead of retrying until it times out, and no units move.

Calling code decides between retrying, fixing input and escalating from fields, and [the error guide](https://dalp-staging.settlemint.com/docs/api-reference/guides/errors) lists the categories and the retry rules for each. The message, `why` and `fix` are written for people, so code should branch on the `DALP-` id and the retryable flag.

## Upgrading [#upgrading]

Nothing to do. The CLI and the SDK are new client packages for the 3.0 Platform API, and existing API integrations keep working. Install the CLI with your package manager, run `dalp login` against your instance, and keep the CLI version in step with the platform release so its commands match the API.

## Why it matters [#why-it-matters]

- **Banks:** repeated issuance and onboarding work runs as a script your team can review, under the same role checks as the Console, without the Console's wallet-code prompt on signing.
- **Exchanges, CSDs and market infrastructures:** settlement and token operations can be driven from your own jobs, and each refusal comes back as a field your code can act on.
- **Partners:** your product can call DALP through a typed SDK or offer its operations to an AI agent without building a wrapper.

## Next steps [#next-steps]

- [Install the CLI →](https://dalp-staging.settlemint.com/docs/api-reference/cli/install)
- [Use the CLI with AI agents →](https://dalp-staging.settlemint.com/docs/api-reference/cli/ai-agents)
- [Understand role grants →](https://dalp-staging.settlemint.com/docs/concepts/compliance-and-identity/role-grant)