canton
An MCP server for Canton blockchain development
claude mcp add --transport stdio chainsafe-canton-mcp-server docker run -i canton-mcp-server \ --env JWT_SECRET="<generate-secure-secret>" \ --env CANTON_ENABLED="true" \ --env MCP_SERVER_URL="http://localhost:7284" \ --env CANTON_PAYEE_PARTY="damlcopilot-receiver::1220..." \ --env CANONICAL_DOCS_PATH="/path/to/canonical-daml-docs" \ --env CANTON_FACILITATOR_URL="http://46.224.109.63:3000"
How to use
This Canton MCP server provides AI-assisted DAML development tooling via the Model Context Protocol. It exposes two main tools: daml_reason for analyzing DAML code, suggesting patterns, and validating business logic; and daml_automater for automating Canton environments, tests, and builds (spinning up Canton networks, running tests, and building DARs). Authentication is implemented using a cryptographic challenge-response flow to obtain a JWT token, which is then sent in the Authorization header for protected requests. The server is designed to be used over a local or hosted MCP endpoint (e.g., http://localhost:7284/mcp) and can be integrated with clients like Cursor or Claude Desktop by configuring the MCP connection details in their respective config files. When testing, you can list tools, call a tool with arguments, or perform interactive testing with the MCP inspector.
How to install
Prerequisites:
- Docker installed for the recommended dockerized setup (or use uv/ Python for development).
- Optional: Canonical DAML docs repository cloned locally for pattern recommendations.
Installation steps (Docker, recommended):
- Clone the repository and navigate to the Canton MCP server directory.
- Start the server stack with Docker:
docker-compose up -d
- Verify the service is running:
curl http://localhost:7284/health
- If you need local development, you can run with uv (recommended for development):
uv sync
uv run canton-mcp-server
Alternate local development (Python/uv or pip):
# Using uv (recommended)
uv sync --dev
uv run canton-mcp-server
# Or install in editable mode and run
pip install -e .
canton-mcp-server
Prerequisites recap:
- Docker or Python (uv) with a proper Python environment
- Canonical DAML docs directory (see CANONICAL_DOCS_PATH) for pattern recommendations
Additional notes
Tips and considerations:
- Set CANONICAL_DOCS_PATH to point at your local canonical-daml-docs directory to enable pattern recommendations from the DAML/Canton repos.
- For production use, ensure X402 payments are properly configured and the Canton facilitator URL is reachable; include a party ID in requests to avoid rejection.
- JWT tokens expire after a defined period; re-authenticate when needed and refresh the Authorization header accordingly.
- When using Claude Desktop or Cursor, configure the MCP connection with the correct URL and token header format; the server supports SSE transport over HTTP(S).
- If you experience connection issues, check Docker container logs (docker-compose logs -f or docker logs <container_name>) and ensure environment variables (JWT_SECRET, MCP_SERVER_URL) are correctly set.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP