Skip to main content
Glama
Canton Ledgerview MCP Server

Canton Ledgerview MCP Server

by stratoslab

Canton Ledgerview MCP Server

This is a custom Model Context Protocol (MCP) server for the Ledgerview project. It provides tools to analyze the project structure and status with full HTTP API integration.

Prerequisites

  • uv (for Python dependency management)

  • Docker (for containerized deployment)

Related MCP server: AI Knowledge Center MCP

Quick Start with Docker

git clone https://github.com/stratoslab/Canton-MCP-Server.git
cd Canton-MCP-Server
docker build -t canton-mcp-server .
docker run -d -p 8000:8000 --name canton-mcp canton-mcp-server

Server will be available at http://localhost:8000

Local Development

Run the server directly using uv:

uv run src/server.py

MCP Client Setup

Add the following to your MCP settings file (e.g., claude_desktop_config.json):

{
  "mcpServers": {
    "canton-ledgerview": {
      "command": "uv",
      "args": [
        "run",
        "src/server.py"
      ],
      "cwd": "/absolute/path/to/Canton-MCP-Server"
    }
  }
}

HTTP API Integration

The server provides REST endpoints for AI agents and web applications:

Tool Execution

Execute any MCP tool via HTTP:

POST /tools/{tool_name}/call
Content-Type: application/json

{
  "arguments": {
    "arg1": "value1",
    "arg2": "value2"
  }
}

Example - DAML Safety Analysis:

curl -X POST http://localhost:8000/tools/analyze_daml_safety/call \
  -H "Content-Type: application/json" \
  -d '{"arguments": {"code": "template Limited\n  with\n    owner: Party\n  where\n    signatory owner"}}'

Response:

{
  "content": [{"type": "text", "text": "✅ DAML code passes basic safety gate analysis."}],
  "isError": false
}

Resource Management

List and read documentation resources:

# List all resources
GET /resources

# Read specific resource
POST /resources/read
Content-Type: application/json

{
  "uri": "canton://docs/ledger-model"
}

Available Endpoints

  • GET / - Server status

  • GET /health - Health check

  • GET /tools - List available tools

  • POST /tools/{name}/call - Execute tool

  • GET /resources - List documentation resources

  • POST /resources/read - Read documentation content

Intelligence Features

This server includes embedded knowledge about Canton and DAML:

Resources

Agents can read these specialized resources to understand Canton architecture:

  • canton://docs/ledger-model: DAML Ledger Model documentation

  • canton://docs/architecture: Canton Network architecture

  • canton://docs/language-reference: DAML language reference

  • canton://docs/chainsafe-mcp: ChainSafe MCP reference

  • canton://docs/llm-architecture: LLM-Primary Architecture

  • canton://docs/quickstart-demo: Canton Network Quickstart Demo

  • canton://docs/daml-intro: DAML Introduction and Tutorial

  • canton://docs/daml-patterns: DAML Design Patterns

  • canton://docs/splice-overview: Splice & Global Synchronizer Overview

  • canton://docs/splice-scan-api: Splice Scan API Reference

Specialized Tools

  • analyze_daml_safety: Performs semantic analysis on DAML code to identify missing safety markers

  • generate_canton_deployment_script: Generates tailored scripts for Dev/Prod environments

  • get_project_summary: Returns a summary of the project

  • check_server_status: Returns "OK" if reachable

  • list_available_docs: Lists all available documentation resources

  • add_documentation: Adds new documentation to the knowledge base

Available Tools

6 tools
add_documentationC

Adds a new documentation file to the MCP server's knowledge base.

Args: filename: name of the file (e.g., 'my_guide.md') content: The markdown content of the documentation description: Short description of what this doc covers

Inputs: content (required), filename (required), description. Returns: result

analyze_daml_safetyC

Analyzes DAML code against the Canton Safety Gates. This simulates the 'intelligent' reasoning by checking for specific safety markers.

Inputs: code (required). Returns: result

check_server_statusB

Returns a simple 'OK' if the server is up.

Inputs: no named parameters. Returns: result

generate_canton_deployment_scriptC

Generates a starter deployment script for a Canton network.

Inputs: network_type. Returns: result

get_project_summaryB

Reads the package.json and counts files in the specified project path to provide a summary. Arguments: project_path: Relative or absolute path to the project root.

Inputs: project_path. Returns: result

list_available_docsB

Lists all available Canton/DAML documentation resources.

Inputs: no named parameters. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 6 tools

    Disambiguation4/5

    Each tool targets a distinct verb+resource: DAML safety analysis, deployment script generation, docs listing/adding, project summary, and health check. The only mild overlap is between get_project_summary and check_server_status, both diagnostic reads, but their scopes (project contents vs. server liveness) are clearly stated.

    Naming Consistency5/5

    All six tools follow a consistent snake_case verb-first pattern (analyze_*, generate_*, list_*, add_*, get_*, check_*). Object nouns are explicit and predictable, so names are self-describing without needing descriptions.

    Tool Count5/5

    Six tools is well within the ideal 3-15 range and each maps to a distinct capability rather than a redundant variant. No filler or trivially duplicated tools are present.

    Completeness3/5

    Documentation management is half-covered: you can list and add docs but cannot retrieve, update, or delete an existing doc, creating a dead end for reading content. Additionally, despite the 'Ledgerview' framing, there are no tools to query ledger state or contracts, leaving the core domain only partially served.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers