mdt_mcp

v0.9.9
mdt_mcp Checked 3 days ago

MCP server for mdt — AI assistant integration for markdown template synchronization

[![Crate][crate-image]][crate-link] [![Docs][docs-image]][docs-link] [![Status][ci-status-image]][ci-status-link] [![Coverage][coverage-image]][coverage-link] [![Unlicense][unlicense-image]][unlicense-link] mdt_mcp is a Model Context Protocol (MCP) server for mdt. It gives AI assistants structured, JSON-first access to a project's providers and consumers. Every tool accepts an optional project path. mdt_list, mdt_check, mdt_update, and mdt_doctor also accept ignore_unclosed_blocks, ignore_unused_blocks, ignore_invalid_names, and ignore_invalid_transformers.

Summary extracted from the README.

mdt_mcp

MCP server for mdt (manage markdown templates)

Crate Docs Status Coverage Unlicense

mdt_mcp is a Model Context Protocol (MCP) server for mdt. It gives AI assistants structured, JSON-first access to a project's providers and consumers.

Tools

  • mdt_list: providers and consumers with locations, transformers, arguments, and status (current, stale, render_error, or orphan). Pass include_content: true to include block content.
  • mdt_check: stale consumers, stale files, orphans with suggestions, render errors, and diagnostics.
  • mdt_update: sync every consumer; dry_run: true previews. It refuses to write while validation errors exist.
  • mdt_doctor: the same health checks as mdt doctor — config, data sources, template layout, duplicate providers, orphan consumers, unused providers, parser diagnostics, consumer sync, and cache — each with a status (pass, warn, fail, or skip), message, and fix hint.
  • mdt_info: the same project inspection as mdt info — block counts, data namespaces, template directories and files, diagnostic totals, and cache state.
  • mdt_find_reuse: rank existing providers by name (block_name) or content (content_query) before you create a new one.
  • mdt_preview: a provider and each consumer's rendered and current content.
  • mdt_get_block: a provider (or null) and its consumers, by name.
  • mdt_init: set up a project the same way mdt init does.

Every tool accepts an optional project path. mdt_list, mdt_check, mdt_update, and mdt_doctor also accept ignore_unclosed_blocks, ignore_unused_blocks, ignore_invalid_names, and ignore_invalid_transformers.

Responses

Every response is a JSON object with ok, action, and summary. A failure is a normal tool result with ok: false and error: { code, message, help }, for example mdt::config_parse or mdt::path_outside_root, rather than a protocol error.

Agent Workflow

  • Call mdt_find_reuse (or mdt_list) before creating a provider, and reuse one that fits.
  • Use mdt_preview to see what each consumer will contain before syncing.
  • Keep provider names unique across the project.
  • After editing providers, run mdt_update, then mdt_check.
  • Run mdt skill for the full agent guide.

Usage

Start the MCP server through the CLI. Its project root is the directory given with --path; without it, the server walks up from its working directory to the nearest directory with an mdt config file, like the CLI. Tool path arguments must resolve inside that root.

mdt mcp

Add it to your MCP client configuration:

{
	"mcpServers": {
		"mdt": {
			"command": "mdt",
			"args": ["mcp"]
		}
	}
}

mdt assist <generic|claude|cursor|copilot|pi> prints the exact setup for each client.

Installation

[dependencies]
mdt_mcp = "0.9.9"