The MarkdownLM MCP Server acts as a persistent memory and governance layer, enabling AI coding agents to query team knowledge, validate code against defined rules, and log undocumented decisions before writing or suggesting code.
Query the Knowledge Base (
query_knowledge_base): Ask natural language questions about your team's documented rules, stack decisions, and architectural constraints across 10 categories (architecture,stack,testing,deployment,security,style,dependencies,error_handling,business_logic,general). Returns matching rules with sources and automatically logs gaps when no documentation exists.Validate Code Against Team Rules (
validate_code): Submit a code snippet with its purpose and category to check it against all documented team rules. Returns a pass/fail verdict with detailed violation reports — including which rule was broken and concrete fix suggestions — before code reaches a PR.Resolve Knowledge Gaps (
resolve_gap): When a decision is undocumented, log it as a knowledge gap for developer review. Returns the team's configured resolution policy: stop and ask the user (ask_user), use an AI-resolved answer (infer/markdownlm), or proceed independently (agent_decide).Enforce Team Standards: Ensures AI agents adhere to defined rules and best practices, preventing non-compliant code from reaching pull requests.
Broad Compatibility: Configurable with Claude Code, Claude Desktop, Cursor, Windsurf, Cline, and VS Code via the same npm package.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MarkdownLM MCP Servercheck if this code snippet follows our security and style rules"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 elseWhen using this MCP server, always specify a category.
categoryis a required field onquery_knowledge_base.
How it works
Your team documents architecture rules, stack decisions, and patterns in MarkdownLM.
This MCP server gives AI coding agents three focused tools to query and validate against that knowledge.
Agents validate code against your rules before suggesting changes — violations never reach PRs.
Setup
1. Get your API key
Log in to MarkdownLM
Go to Settings → API & MCP
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-mcpOr 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 |
| ✓ | Natural language question (e.g. "How should I handle auth?") |
| ✓ | Category of the query: |
Response — answer, 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 snippet to check |
| ✓ | What the code is supposed to do |
| ✓ | The knowledge base category relevant to this code |
Response — status (pass/fail), violations[] (rule, message, fix_suggestion), fix_suggestion
resolve_gap
Log a knowledge gap for an undocumented decision. Returns how to handle it based on your preferences: markdownlm (AI resolves), ask_user (wait for human), agent_decide (proceed independently).
Inputs
Field | Required | Description |
| ✓ | The undocumented decision or question |
| ✓ | Category hint |
Response — gap_detected, resolution_mode, optional resolution, gap_id
Environment variables
Variable | Required | Default | Description |
| ✓ | — | API key from Settings → API & MCP |
| — |
| Override for self-hosted or staging |
Rate limiting
100 tool calls per 60 seconds per user.
Logging
All tool calls are logged to stderr as newline-delimited JSON (timestamp, tool name, inputs, outcome). This is safe for stdio MCP transport and can be piped to any log aggregator.
Contributing & Security
This repository is strictly the bridge (the client), not the brain. To protect our intellectual property, infrastructure details, and customer data, please carefully review our Contributing Guidelines and Security Policy before making any modifications.
License
Copyright (c) 2026 MarkdownLM. All Rights Reserved.
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.