mdt_mcp
v0.9.9MCP 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)
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, ororphan). Passinclude_content: trueto include block content.mdt_check: stale consumers, stale files, orphans with suggestions, render errors, and diagnostics.mdt_update: sync every consumer;dry_run: truepreviews. It refuses to write while validation errors exist.mdt_doctor: the same health checks asmdt doctor— config, data sources, template layout, duplicate providers, orphan consumers, unused providers, parser diagnostics, consumer sync, and cache — each with astatus(pass,warn,fail, orskip),message, and fixhint.mdt_info: the same project inspection asmdt 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 (ornull) and its consumers, by name.mdt_init: set up a project the same waymdt initdoes.
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(ormdt_list) before creating a provider, and reuse one that fits. - Use
mdt_previewto see what each consumer will contain before syncing. - Keep provider names unique across the project.
- After editing providers, run
mdt_update, thenmdt_check. - Run
mdt skillfor 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"