Use Dcision in Claude Code
Connect Claude Code to Dcision with the MCP server and the Dcision skill — list, check and run decisions, write and validate decision schemas, and use the CLI and SDKs from your agent.
Claude Code can work with Dcision in two complementary ways:
- The MCP server gives Claude the tools: list your decisions, read their contract, check a state, run a decision, read executions, list templates and validate a schema.
- The Dcision skill gives Claude the judgment: how decisions work, how to write a valid decision schema, which calls are billed and the pitfalls to avoid. It also teaches Claude to use the API with
curlwhen the MCP server isn't connected.
Install both. Each takes one command.
Before you start
Create an API key at app.dcision.io/api-keys and export it in the shell you start Claude Code from:
export DCISION_API_KEY="dcs_test_…"Start with a test key
Use a dcs_test_… key while you experiment. Runs with a test key are real and count as usage, but destinations deliver with livemode: false, so your CRM and workflows can tell them apart. Switch to a dcs_live_… key when an agent runs decisions for production.
Connect the MCP server
The Dcision MCP server runs at https://api.dcision.io/mcp (Streamable HTTP) and authenticates every request with your API key as a Bearer token.
claude mcp add --transport http dcision https://api.dcision.io/mcp \
--header "Authorization: Bearer $DCISION_API_KEY" \
--scope userThe shell expands $DCISION_API_KEY when you run the command, and Claude Code stores the header in your user configuration (~/.claude.json) — outside the repository.
To share the server with your team, commit a .mcp.json at the root of the repository instead. Claude Code expands ${DCISION_API_KEY} from each person's environment, so the file holds no secret:
{
"mcpServers": {
"dcision": {
"type": "http",
"url": "https://api.dcision.io/mcp",
"headers": { "Authorization": "Bearer ${DCISION_API_KEY}" }
}
}
}Don't use claude mcp add --scope project with the header above: it writes the expanded key into .mcp.json. Write the file by hand with the ${DCISION_API_KEY} placeholder.
Check the connection with claude mcp list, or with /mcp inside a session: dcision should be connected with nine tools. A 401 means the key is missing, malformed or revoked.
Install the skill
The skill is a single SKILL.md file, published with this documentation:
mkdir -p ~/.claude/skills/dcision
curl -fsSL https://docs.dcision.io/skills/dcision/SKILL.md -o ~/.claude/skills/dcision/SKILL.mdClaude Code loads it on its own when a request mentions Dcision, a decision slug, a decision schema or routing and classifying with Dcision. Run the same command again to update it. The skill follows the open Agent Skills format, so other agents that read SKILL.md files can use it too.
Try it
Ask in plain language — Claude picks the tools:
- "Which Dcision decisions do I have, and which are deployed?"
- "Show me what
lead-qualificationexpects and an example state." - "Run
support-routingon this ticket and tell me the route and the action." - "Check whether these five payloads are valid states for
lead-qualification— don't run them." - "Write a decision schema that classifies inbound e-mails into billing, technical and sales, escalates urgent ones, and validate it."
- "Start from the
ticket-triagetemplate and adapt it to our categories." - "How many decisions have we used this month, and how many failed runs did
spam-detectionhave today?"
Creating, editing and deploying decisions stays in the app: Claude writes and validates the schema, you paste it in the decision's editor, test it in the Playground and deploy it.
Tools
| Tool | Billed | What it does |
|---|---|---|
get_account | No | The key's workspace, the key, the plan and this period's usage — like GET /v1/me. |
list_decisions | No | The workspace's decisions: slug, name, status and active version — like GET /v1/decisions. |
get_decision | No | One decision's contract: state schema, questions and options, actions and an example state. |
check_state | No | Checks a state against a decision's state schema without running it. |
run_decision | Yes | Runs the active version on a state — like POST /v1/decisions/{slug}. |
list_executions | No | Recent runs with answers, action and metrics — never the inputs. |
list_templates | No | The built-in templates. |
get_template | No | One template's complete decision schema. |
validate_schema | No | Validates a decision schema offline, with the editor's rules. |
run_decision is the only tool with a cost, and the only one not annotated as read-only. Claude Code asks before it calls an MCP tool until you allow it: allow the read-only tools freely and keep run_decision behind the prompt while you experiment. Inputs, outputs and errors of every tool are in the MCP reference.
The CLI and the SDKs from Claude Code
Claude Code can also drive the CLI in a terminal — handy for schemas kept in your repository:
dcision validate decision.json
dcision check-state decision.json --state-file samples/lead-1.json
dcision decide lead-qualification --state-file samples/lead-1.json --jsonThe CLI and the SDKs are not published on npm or PyPI yet: build them from a checkout of the Dcision repository (pnpm --filter "@dcision/cli..." build). The skill tells Claude not to install packages with these names from a registry.
When Claude writes application code that calls Dcision, point it at the TypeScript SDK or the Python SDK — dcision.decide("lead-qualification", state) with safe retries — or at plain HTTPS as in Run a decision.
Without the MCP server
The skill works without the MCP server: with DCISION_API_KEY in the environment, Claude calls the REST API with curl, and the same MCP server over plain HTTP for the tools REST doesn't have — validate_schema, check_state and the templates. See Call the server with curl.
Security
- Keys stay out of the repository. Use the
${DCISION_API_KEY}placeholder in.mcp.json, never the key itself, and don't paste keys into the chat. - A key can do what the API can do for its workspace: read its decisions and executions and run decisions. It can't create, edit or deploy decisions, manage members or billing — those need a signed-in user in the app.
- Runs are billed.
run_decisioncounts like any API call: one decision per run, however many questions. Ask Claude for a sample before it runs a whole dataset, and watch usage withget_account. - Executions never return inputs.
list_executions, likeGET /v1/executions, doesn't return the states you sent. - Revoke a key in API Keys if it leaks; the API and the MCP server refuse a revoked key.
Other clients
Cursor, VS Code, Claude Desktop, Codex and Gemini CLI connect to the same server — see MCP server.
Python SDK
The dcision package for Python 3.9+ — build from source, decide, destinations and functions, errors, idempotent retries, executions, me() and webhook verification with Flask or FastAPI.
MCP server
The Dcision MCP server at https://api.dcision.io/mcp — authentication, the nine tools with their inputs and outputs, errors, and setup for Claude Code, Cursor, VS Code, Claude Desktop, Codex, Gemini CLI and curl.