MarkdownLM MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add -e "MARKDOWNLM_API_KEY=${MARKDOWNLM_API_KEY}" -e "MARKDOWNLM_API_URL=${MARKDOWNLM_API_URL}" markdownlm -- npx -y markdownlm-mcp
Required:MARKDOWNLM_API_KEYMARKDOWNLM_API_URL
README.md

Persistent memory and governance layer for AI coding agents

MarkdownLM MCP Server

MarkdownLM is the persistent memory and governance layer between your team and your AI coding agents. Define your rules once. Enforced everywhere. Every session.

Note:

The MarkdownLM knowledge base supports the following categories for all rules, patterns, and decisions:

  • architecture: Layering, boundaries, system design
  • stack: Frameworks, libraries, versions
  • testing: Test frameworks, coverage, patterns
  • deployment: CI/CD, platforms, scripts
  • security: Auth, validation, secrets
  • style: Naming, formatting, organization
  • dependencies: Approved/banned packages
  • error_handling: Exceptions, logging, monitoring
  • business_logic: Domain rules, workflow constraints, business invariants, pricing logic, subscription rules, permission models
  • general: Anything else

When using this MCP server, always specify a category. category is a required field on query_knowledge_base.

How it works

  1. Your team documents architecture rules, stack decisions, and patterns in MarkdownLM.
  2. This MCP server gives AI coding agents three focused tools to query and validate against that knowledge.
  3. Agents validate code against your rules before suggesting changes — violations never reach PRs.

Setup

1. Get your API key

  1. Log in to MarkdownLM
  2. Go to Settings → API & MCP
  3. Generate an API key

2. Configure your AI tool

Pick your tool below. All use the same npm package — one codebase, every platform.


Claude Code (CLI)
claude mcp add markdownlm -e MARKDOWNLM_API_KEY=mdlm_your_key_here -e MARKDOWNLM_API_URL=https://markdownlm.com -- npx -y markdownlm-mcp

Or manually edit ~/.claude/claude_code_config.json:

{
  "mcpServers": {
    "markdownlm": {
      "command": "npx",
      "args": ["-y", "markdownlm-mcp"],
      "env": {
        "MARKDOWNLM_API_KEY": "mdlm_your_key_here",
        "MARKDOWNLM_API_URL": "https://markdownlm.com"
      }
    }
  }
}

Claude Desktop

~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%/Claude/claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "markdownlm": {
      "command": "npx",
      "args": ["-y", "markdownlm-mcp"],
      "env": {
        "MARKDOWNLM_API_KEY": "mdlm_your_key_here",
        "MARKDOWNLM_API_URL": "https://markdownlm.com"
      }
    }
  }
}

Cursor

.cursor/mcp.json in your project root (project-scoped) or ~/.cursor/mcp.json (global):

{
  "mcpServers": {
    "markdownlm": {
      "command": "npx",
      "args": ["-y", "markdownlm-mcp"],
      "env": {
        "MARKDOWNLM_API_KEY": "mdlm_your_key_here",
        "MARKDOWNLM_API_URL": "https://markdownlm.com"
      }
    }
  }
}

Windsurf

~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "markdownlm": {
      "command": "npx",
      "args": ["-y", "markdownlm-mcp"],
      "env": {
        "MARKDOWNLM_API_KEY": "mdlm_your_key_here",
        "MARKDOWNLM_API_URL": "https://markdownlm.com"
      }
    }
  }
}

Cline (VS Code)

In the Cline extension settings (MCP Servers):

{
  "mcpServers": {
    "markdownlm": {
      "command": "npx",
      "args": ["-y", "markdownlm-mcp"],
      "env": {
        "MARKDOWNLM_API_KEY": "mdlm_your_key_here",
        "MARKDOWNLM_API_URL": "https://markdownlm.com"
      }
    }
  }
}

VS Code (Native/Extension)

.vscode/mcp.json in your project root:

{
  "servers": {
    "markdownlm": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "markdownlm-mcp"],
      "env": {
        "MARKDOWNLM_API_KEY": "mdlm_your_key_here",
        "MARKDOWNLM_API_URL": "https://markdownlm.com"
      }
    }
  }
}

Tools

`query_knowledge_base`

Query your team's documented rules before writing code. Returns relevant rules with sources and automatically logs gaps for undocumented decisions.

Inputs

Field Required Description
query Natural language question (e.g. "How should I handle auth?")
category Category of the query: architecture, stack, testing, deployment, security, style, dependencies, error_handling, business_logic, general

Responseanswer, sources[], gap_detected, optional gap_resolution


`validate_code`

Validate a code snippet against all documented rules. Returns pass/fail with violation details and fix suggestions.

Inputs

Field Required Description
code Code snippet to check
task What the code is supposed to do
category The knowledge base category relevant to this code

Responsestatus (pass/fail), violations[] (rule, message, fix_suggestion), `fix_

Tools (2)

query_knowledge_baseQuery your team's documented rules before writing code.
validate_codeValidate a code snippet against all documented rules.

Environment Variables

MARKDOWNLM_API_KEYrequiredAPI key generated from MarkdownLM settings
MARKDOWNLM_API_URLrequiredThe base URL for the MarkdownLM API

Configuration

claude_desktop_config.json
{"mcpServers": {"markdownlm": {"command": "npx", "args": ["-y", "markdownlm-mcp"], "env": {"MARKDOWNLM_API_KEY": "mdlm_your_key_here", "MARKDOWNLM_API_URL": "https://markdownlm.com"}}}}

Try it

Query the knowledge base for our team's current standards on error handling.
Validate this code snippet against our architecture rules for the security category.
How should I handle authentication in this new service according to our documented patterns?
Check if this proposed refactor violates any of our business logic constraints.

Frequently Asked Questions

What are the key features of MarkdownLM?

Persistent memory layer for AI coding agents. Governance enforcement for architecture and coding standards. Automated code validation against documented rules. Gap detection for undocumented decisions. Support for multiple categories including security, testing, and business logic.

What can I use MarkdownLM for?

Ensuring AI agents follow team-specific architecture boundaries before writing code. Automating compliance checks for security and authentication patterns. Preventing code violations from reaching pull requests by validating during the coding session. Standardizing error handling and logging practices across a distributed team.

How do I install MarkdownLM?

Install MarkdownLM by running: npx -y markdownlm-mcp

What MCP clients work with MarkdownLM?

MarkdownLM works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep MarkdownLM docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare