Expand description
mdt_mcp is a Model Context Protocol (MCP) server for the mdt template engine. It exposes mdt functionality as MCP tools that can be used by AI assistants and other MCP-compatible clients.
§Tools
mdt_check— Verify all consumer blocks are up-to-date.mdt_update— Update all consumer blocks with latest provider content.mdt_list— List all providers and consumers in the project.mdt_find_reuse— Find similar providers and where they are already consumed in markdown and source files to encourage reuse.mdt_get_block— Get the content of a specific block by name.mdt_preview— Preview the result of applying transformers to a block.mdt_init— Initialize a new mdt project with a sample template file.
§Agent Workflow
- Prefer reuse before creation: call
mdt_find_reuse(ormdt_list) before introducing a new provider block. - Keep provider names global and unique in the project to avoid collisions.
- After edits, run
mdt_check(and optionallymdt_update) so consumer blocks stay synchronized.
§Usage
Start the MCP server via the CLI:
mdt mcpAdd the following to your MCP client configuration:
{
"mcpServers": {
"mdt": {
"command": "mdt",
"args": ["mcp"]
}
}
}Structs§
- Block
Param - Parameters for tools that need a block name.
- Init
Param - Parameters for the init tool.
- MdtMcp
Server - The MCP server for mdt.
- Path
Param - Parameters for tools that accept an optional project path.
- Reuse
Param - Parameters for reuse discovery.
- Update
Param - Parameters for the update tool.
Functions§
- run_
server - Start the MCP server on stdin/stdout.