Skip to main content
Glama
MarkdownLM

MarkdownLM MCP Server

Official
by MarkdownLM

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.

Related MCP server: RulesetMCP

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_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

question

The undocumented decision or question

category

Category hint

Responsegap_detected, resolution_mode, optional resolution, gap_id


Environment variables

Variable

Required

Default

Description

MARKDOWNLM_API_KEY

API key from Settings → API & MCP

MARKDOWNLM_API_URL

https://markdownlm.com

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.

Available Tools

3 tools
query_knowledge_baseA

MANDATORY: Call this tool before writing any code, proposing any pattern, or making any architectural or dependency decision. It queries this team's private knowledge base of documented rules, stack decisions, and architectural constraints. Do NOT rely on general knowledge — your team's rules override defaults. Returns the matching documented rules with their sources. If no documentation exists for the topic, a gap is automatically logged for the developer to review, and you MUST call resolve_gap next. The 'category' field is required — pick the single best-fit value from the allowed enum that describes the domain of your query.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesNatural language question about how to implement something or what rule applies. Be specific to the task at hand. Examples: "What authentication library should I use?", "How should errors be handled in API routes?", "What is the approved ORM for this project?"
categoryYesThe knowledge base category that best matches your query domain. Required. Use "architecture" for system design, layering, module boundaries, or component relationships. Use "stack" for framework, library, or language version choices. Use "testing" for test frameworks, coverage requirements, or testing patterns. Use "deployment" for CI/CD pipelines, hosting platforms, or release processes. Use "security" for auth, authorisation, secrets management, or input validation. Use "style" for naming conventions, formatting rules, or code organisation. Use "dependencies" for approved or banned packages and version policies. Use "error_handling" for exception strategies, logging formats, or monitoring. Use "business_logic" for domain rules, workflow constraints, business invariants, pricing logic, subscription rules, or permission models. Use "general" only when no other category fits.

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description fully carries the burden. It discloses that the tool returns matching documented rules with their sources, and if no documentation exists, a gap is automatically logged and the agent MUST call resolve_gap next. This makes the behavior predictable and transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single paragraph but contains all necessary information without redundancy. It is front-loaded with the mandatory call instruction. Slightly more structure (e.g., bullet points for category examples) could improve readability, but it is concise and effective.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description adequately explains what is returned (matching rules with sources) and the fallback behavior. It covers the tool's role in the agent's workflow, including the gap-logging mechanism and the need to call resolve_gap if no documentation exists.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, but the description adds significant value by providing concrete examples for the 'query' field and detailed guidance for each enum value of 'category'. This helps the agent select appropriate values beyond the schema's minimal descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: to query a private knowledge base for documented rules, stack decisions, and architectural constraints. It distinguishes itself from siblings by specifying that if no documentation exists, the agent must call resolve_gap, and mentions sibling tools resolve_gap and validate_code in the context.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says 'MANDATORY: Call this tool before writing any code, proposing any pattern, or making any architectural or dependency decision.' It also provides guidance on what to do if no documentation exists (call resolve_gap) and requires the 'category' field with instructions on how to choose the best-fit value from the enum.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

resolve_gapA

Call this when query_knowledge_base returned no documented guidance for a decision you need to make. Logs the undocumented decision as a knowledge gap so the developer can review and document it. Returns how you should proceed based on the team's configured gap policy: "ask_user" = stop and ask the developer for a decision before continuing; "infer" = MarkdownLM has auto-resolved the gap, use the returned resolution value; "agent_decide" = proceed with your best judgement and document your reasoning. Do NOT call this if query_knowledge_base returned matching rules — it is only for genuinely undocumented decisions.

ParametersJSON Schema
NameRequiredDescriptionDefault
questionYesThe specific undocumented decision you need to make, phrased as a question. Be precise so the developer understands exactly what is missing from the knowledge base. Example: "Which HTTP client library should I use for server-side requests — axios, got, or native fetch?"
categoryYesCategory that best describes the gap. Helps the developer triage and document the missing rule.

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must disclose behavioral traits. It explains the tool logs a knowledge gap and returns a policy decision. However, it does not mention whether the operation is read-only, requires authentication, or has side effects beyond logging. While it covers essential behavior, slightly more context about safety and effects would improve transparency. Still, it is clear and accurate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with a clear front-loading of the primary use case. It uses three sentences to convey the purpose, conditions, and expected return values. While it is moderately concise, it could be slightly more compact without losing clarity. Every sentence earns its place, but there is minor redundancy (e.g., 'undocumented decision' repeated).

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity, no output schema, and no annotations, the description provides a fairly complete picture. It explains the input parameters, the condition for use, and the three possible return values with actionable instructions. A minor gap is the lack of detail on what logging entails (e.g., is it persistent?), but overall it is sufficient for an agent to use the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema coverage is 100%, so the baseline is 3. The description adds some extra guidance for the 'question' parameter (phrasing as a precise question) but does not add significant meaning beyond the schema. The 'category' parameter is already fully described by the enum. Thus, minimal added value warrants a score of 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: to be called when query_knowledge_base returns no documented guidance. It distinguishes itself from the sibling tool 'query_knowledge_base' by specifying the condition under which to use it, and explicitly says when not to call it. This meets the criteria for a specific verb+resource with sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit usage guidelines: call this only when query_knowledge_base returns no matching rules, and do NOT call it if rules exist. It explains the three possible outcomes based on the team's gap policy, giving agents clear instructions on how to proceed. This fully satisfies the dimension with explicit when/when-not and alternative behavior.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

validate_codeA

Call this after writing or editing any non-trivial function, module, or API endpoint. Checks the code snippet against this team's documented rules for the given category. Returns a pass/fail verdict plus a list of violations — each with the rule violated, the problematic location, and a concrete fix suggestion. Fix all violations before presenting the code to the developer. Do NOT skip this step even if query_knowledge_base returned no results — the validation engine runs a broader rule check.

ParametersJSON Schema
NameRequiredDescriptionDefault
codeYesThe full code snippet to validate. Prefer complete functions or modules over partial fragments for accurate results.
taskYesOne-sentence description of what the code is supposed to do. Example: "Creates a JWT-authenticated POST /users endpoint that persists a new user to PostgreSQL."
categoryYesThe category whose rules should be applied during validation. Match this to the primary concern of the code. Example: use "security" for auth middleware, "architecture" for a new service layer, "error_handling" for a try/catch wrapper, "business_logic" for domain rules or workflow invariants.

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden. It discloses the return format (pass/fail plus violations with details) and important behavioral instruction ('Fix all violations before presenting the code'). It does not mention auth or rate limits, but the return detail is sufficient for a validation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise (5 sentences) with every sentence earning its place. It front-loads the usage context and then details return and instructions. No redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description adequately explains what the tool returns and how to act on results. It also integrates with sibling tool usage. It could mention error handling or limits, but overall is complete for its complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but the description adds meaningful context beyond schema: e.g., for 'code' prefers complete functions, for 'task' gives example, for 'category' gives usage examples per scenario. This helps the agent select appropriate parameter values.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool validates code against team rules, with a specific verb ('checks') and resource ('code snippet'). It distinguishes itself from siblings by referencing query_knowledge_base and explaining why this step is needed even if that tool returns no results.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states when to call ('after writing or editing any non-trivial function, module, or API endpoint') and gives a strong directive to not skip after query_knowledge_base. However, it does not explicitly list when not to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 3 tool updatesv2.0.0
    • First observedquery_knowledge_base
    • First observedresolve_gap
    • First observedvalidate_code

TDQS

A4.6/5.0

Scored across 3 tools

Disambiguation5/5

The three tools map to distinct phases of a workflow: querying rules before an action, validating code after writing it, and resolving undocumented gaps. No overlap; each tool has a clear, non-conflicting purpose.

Naming Consistency5/5

All tool names follow the same snake_case verb_noun pattern: query_knowledge_base, validate_code, resolve_gap. This is perfectly consistent and predictable.

Tool Count5/5

Three tools is an appropriate size for a focused knowledge-management/validation server. Each tool is necessary and sufficient for the stated workflow, with no bloat or missing core capability.

Completeness5/5

The server covers the complete lifecycle of enforcing team rules: query relevant rules, validate code against them, and handle gaps when no rule exists. The workflow has no dead ends; every tool has a clear next step.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides AI agents with professional coding standards, development best practices, and context-aware guidance through static documentation and AI-powered custom recommendations. Enables agents to access comprehensive development guidelines including coding rules, debugging techniques, and AI steering instructions.
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    Provides AI agents with queryable, version-controlled project rules and coding standards. Enables validation, rule-based guidance, and task summaries to keep AI work aligned with your project's conventions without repeating context.
    2
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Transforms static coding standards into a queryable live data store for AI agents, delivering task-specific rules and fix guidance on demand. This optimizes context window usage through progressive disclosure, ensuring agents apply relevant governance without loading massive documentation.
    2
    MIT