Skip to content

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:

bash
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 ​

bash
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 list

Codex MCP

Claude Code ​

bash
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 list

Claude Code MCP

Claude Desktop ​

Open Settings → Developer → Edit Config in the desktop app. On macOS, the file is:

text
~/Library/Application Support/Claude/claude_desktop_config.json

Find the executable path first:

bash
which decision-layer-mcp

Replace command in the JSON below with that path, then add decision-layer alongside existing mcpServers entries.

json
{
  "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 ​

VariablePurpose
DL_API_URLDecision Layer API URL
DL_WEB_URLAdmin console URL for result links
DL_TOKENBearer token required for an existing Cube user
DL_LOCALEMethod 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 ​

  • ENOENT or executable missing: activate the environment where you installed the adapter and check which decision-layer-mcp. To replace an incorrect Claude Code registration, run claude mcp remove --scope user decision-layer, then repeat the connection command above.
  • Connection refused: check that the server is running and DL_API_URL uses 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.