Build with AI

Ground your AI assistant in the official Canton docs and the Canton Foundation Daml skill, optionally gate drafts with Daml Reason, then check what it writes before you rely on it.

AI Tooling

ToolUse It For
Canton Docs MCPSearch and read Canton documentation from your assistant.
Canton Foundation Daml SkillAdd Daml language and development instructions to your assistant.
Daml ReasonMCP safety layer: corpus-grounded pattern retrieval and a gate on assistant drafts before you run daml build (self-host or ChainSafe hosted).

Browse all available tooling in the Canton Foundation Developer Hub.

Setup

Connect Canton Docs in the client you use, install the Daml Skill, and optionally configure Daml Reason. The sections below walk through each tool.

Canton Docs MCP

Connect your client to https://docs.canton.network/mcp over HTTP. Ask it to retrieve a specific documentation page and inspect the returned tool result. Check tool descriptions before use; documentation feedback tools send information to the docs team.

Claude

In Claude, open Customize, then Connectors. Choose Add, then Add custom connector, and enter a name and https://docs.canton.network/mcp. On Team and Enterprise plans, an owner adds it under Organization settings, then Connectors.

Claude Code
bash
claude mcp add --transport http canton-docs https://docs.canton.network/mcp

Cursor

Add to Cursor

Add the server to .cursor/mcp.json in your project, or to ~/.cursor/mcp.json for every project:

json
{
  "mcpServers": {
    "canton-docs": {
      "url": "https://docs.canton.network/mcp"
    }
  }
}

VS Code

Use the workspace-root .mcp.json format for portable configurations. VS Code offers this workspace destination when chat.mcp.workspaceRootConfig.enabled is enabled. Use the mcpServers object shown here.

json
{
  "mcpServers": {
    "canton-docs": {
      "type": "http",
      "url": "https://docs.canton.network/mcp"
    }
  }
}

For other destinations and supported clients, follow the VS Code MCP configuration guide. Its separate VS Code format uses servers; the two schemas are not interchangeable.

Canton Foundation Daml Skill

The Canton Foundation Daml Skill supplies language, authorization and testing instructions for your assistant. Follow its current installation instructions for your client.

Treat generated code as an implementation to review and test. The skill's reference material does not establish that your application satisfies its business rules.

Daml Reason (Optional)

Daml Reason is a safety layer between LLM drafts and ledger code. It is not a code generator and not a compiler: your editor still writes Daml, and dpm build / daml build still runs on your machine or in CI. The daml_reason MCP tool retrieves promoted patterns from a corpus, returns fail, ready_to_compile, or pass, and only allows pass when you supply a successful client compile result.

  1. Choose Hosted or Local

    Hosted vs local: ChainSafe operates an authenticated hosted MCP endpoint. Sign in on the Daml Reason site for an API key and the current URL. You can also self-host the server and promoted corpus bundle on your machine (see the site’s setup guide). A CantonNews-operated hosted instance may be offered later; until then, use self-host or the ChainSafe hosted service.

  2. Connect Your Editor

    Add a second MCP entry beside Canton Docs in .cursor/mcp.json (project) or ~/.cursor/mcp.json (global). Use the hosted URL and Bearer token from the developer guide, or local self-host:

    Cursor: local self-host example
    {
      "mcpServers": {
        "canton-docs": {
          "url": "https://docs.canton.network/mcp"
        },
        "daml-reason": {
          "url": "http://127.0.0.1:7286/mcp",
          "headers": {
            "Authorization": "Bearer YOUR_LOCAL_OR_HOSTED_KEY"
          }
        }
      }
    }

    For hosted mode, replace the url with the endpoint shown after you issue a key on daml-reason.chainsafe.io. Never commit a real API key. Keep keys in your environment or a gitignored local config.

  3. Check a Draft and Compile It

    Typical loop: send Phase A businessIntent to orient on corpus patterns; draft in the editor; send Phase B with damlCode and your compilationResult; revise until ready_to_compile, then run the build locally and submit diagnostics for a final verdict. The same protocol works in Cursor and in CI jobs.

Test Your Tooling

Use this prompt to generate a small contract and check who can use it. Your assistant should return the code, tests and a results table.

Paste it into the assistant you configured above. If it cannot run the tests, run the commands it gives you in your terminal and paste the output back. For help preparing a Daml project, follow Build Your First Canton App.

Prompt to Copy
Help me check my Canton AI tooling with a small Daml example.

1. Use the Canton Docs MCP to read the choice authorization and
   Daml Script testing documentation. Show the page links and
   report if the MCP is unavailable.
2. Create a minimal contract with a choice only its owner can
   exercise. Give a second party visibility but no permission
   to exercise that choice.
3. Write Daml Script tests showing that the owner succeeds and
   the second party is rejected for lack of authorization.
   Use submitMustFail for the rejection test. Check that a
   visibility or setup error is not causing the rejection.
4. Build and run the tests if you have terminal access and a
   Daml toolchain. Otherwise give me the files, commands and
   working directories so I can run them locally. Ask me to
   paste the terminal output before judging the results.

Finish with a table: Check | PASS / FAIL / NOT RUN | Evidence.
Include these rows:
- Canton Docs MCP returned documentation
- Contract builds
- Owner can exercise the choice
- Unauthorized party is rejected

Use PASS only for results supported by actual tool or terminal
output. For each test, name the test and quote its result.
Use NOT RUN for anything you could not execute. Explain any
failure and the next action I should take.

Check the Results

Look for PASS on all four rows, with a documentation link or build and test output as evidence. The unauthorized-party test passes when the attempted action is rejected.

If a row says FAIL, fix the reported problem and rerun that check. If it says NOT RUN, complete the missing setup or run the test locally. A table without supporting output is not a verified result.