Skip to content

Agents and MCP

Dianthan is designed to be operated by coding agents as well as by people. This page covers the MCP server, the files written for models, and how to give an agent access you can trust.

In preview. The MCP server and the agent skill are in preview. /llms.txt is available now.

Documentation for models

/llms.txt is this entire documentation as one plain-text file. Paste its URL into any agent and it has everything it needs to integrate an app.

The MCP server

Install it for Claude Code, Cursor or any client that speaks the Model Context Protocol:

Terminal
npx dianthan mcp install

Or add it by hand:

JSON
{
  "mcpServers": {
    "dianthan": {
      "url": "https://api.dianthan.com/mcp",
      "headers": { "Authorization": "Bearer dn_agent_…" }
    }
  }
}

Tools

ToolDoes
apps.list, apps.createList and create apps, register domains
systems.add, systems.removeSwitch systems on and off
keys.createCreate a scoped server key and write it to the local environment
plans.create, plans.updateDefine plans and their entitlements
flags.set, flags.rolloutCreate flags and change rollouts
records.queryRead an app's records with structured filters
logs.query, errors.listRead events, errors and traces to debug
docs.searchSearch this documentation

Giving an agent a key

Create a key for the agent, not for yourself:

Terminal
dianthan keys create \
  --name "claude-code on ada's laptop" \
  --scopes records:read,records:write,logs:read \
  --expires 7d
  • Scope it. Give it only the scopes the task needs. A key that lists scopes can use only the routes they cover: records:read, records:write, files:read, files:write, logs:read, logs:write, usage:write, models:call and messages:send. Anything else is refused with 403 insufficient_scope.
  • Limit it to one app with --app when the work concerns one product.
  • Make it expire. A key that ends after the week's work can't be forgotten in a dotfile.

Every change the key makes is written to the audit log with the key that made it, and its record changes can be undone in one step. Revoke it from the console and its access ends on the next request.

The agent skill

A skill file teaches an agent the conventions in these docs: keep keys on the server, store refresh tokens in httpOnly cookies, record usage only after success, check entitlements rather than prices. Install it into a project:

Terminal
npx dianthan skill install   # writes .claude/skills/dianthan/SKILL.md

Prompts that work well

  • "Add Dianthan sign-in with magic links and Google to this Next.js app."
  • "Create a Pro plan at $12 a month with PDF export, and gate the export button on it."
  • "Record a usage event for every summary we generate, and stop at 500 a month on the free plan."
  • "Look at this app's errors from the last day and fix the most frequent one."