Connect AI tools
Connect MCP so AI can discover and execute registered Methods and Recipes. Start the Decision Layer server first.
The adapter runs on your computer and calls the Decision Layer API. Use a client that supports local stdio MCP servers.
Keep the server terminal running. Use another terminal with the same virtual environment activated for the commands below.
Install the adapter
In the virtual environment where Decision Layer is installed:
pip install --pre 'decision-layer[mcp]'The connection commands below use the installed executable's path automatically. Match the API and Web URLs to your server's ports.
Codex
codex mcp add decision-layer --env DL_API_URL=http://127.0.0.1:8000 --env DL_WEB_URL=http://127.0.0.1:8000/ui -- "$(command -v decision-layer-mcp)"
codex mcp listClaude Code
claude mcp add --scope user --env DL_API_URL=http://127.0.0.1:8000 --env DL_WEB_URL=http://127.0.0.1:8000/ui --transport stdio decision-layer -- "$(command -v decision-layer-mcp)"
claude mcp listClaude Desktop
Open Settings → Developer → Edit Config in the desktop app. On macOS, the file is:
~/Library/Application Support/Claude/claude_desktop_config.jsonFind the executable path first:
which decision-layer-mcpReplace command in the JSON below with that path, then add decision-layer alongside existing mcpServers entries.
{
"mcpServers": {
"decision-layer": {
"command": "/absolute/path/decision-layer-mcp",
"env": {
"DL_API_URL": "http://127.0.0.1:8000",
"DL_WEB_URL": "http://127.0.0.1:8000/ui"
}
}
}
}Save, fully quit Claude Desktop, and reopen it. See the official local MCP guide for details.
Ask and inspect the result
First ask which metrics and analysis methods are available to check the connection. With the sample running, continue with:
Which department leads revenue in February 2026, and what is its revenue by region? Show the metrics and evidence used.
AI reads registered methods and the semantic catalog, selects inputs and asks about ambiguous meanings or dates.
Open the returned Run link to inspect results and queries. Save a recurring analysis as a Recipe.
Connection settings
| Variable | Purpose |
|---|---|
DL_API_URL | Decision Layer API URL |
DL_WEB_URL | Admin console URL for result links |
DL_TOKEN | Bearer token required for an existing Cube user |
DL_LOCALE | Method message language; use ko for Korean |
The sample contains revenue, departments and regions for January–March 2026. Grocery leads February revenue at 6,720.
The sample uses a local test identity. Keep real tokens in private client settings, outside Git.
Troubleshoot
ENOENTor executable missing: activate the environment where you installed the adapter and checkwhich decision-layer-mcp. To replace an incorrect Claude Code registration, runclaude mcp remove --scope user decision-layer, then repeat the connection command above.- Connection refused: check that the server is running and
DL_API_URLuses its port. - Access error or missing metrics: check token and source permissions in Connect Cube.
- No tools: restart the client or MCP session.
Running the adapter directly in a terminal may wait for input. The MCP client supplies protocol requests.