← Back to directory
L

Lat MCP Server

Community
A knowledge graph for your codebase, written in markdown
Category
Dev Tools #95 of 438
Stars
★ 2.0k Very popular
Transport
stdio (local process)
Runtime
Node.js 22+
Credentials
Optional API key
License
MIT
Last commit
62FMRS · C

lat.md is a markdown-based knowledge graph for codebases, published from the Vercel Labs repository (MIT license, npm package lat.md). It splits domain knowledge into interconnected markdown files under lat.md/, binding docs to code with [[wiki links]], source-symbol links, and // @lat: backlink comments, with lat check enforcing consistency. The CLI also offers lat search for semantic search, lat expand for expanding refs, and lat mcp to start an MCP server for editor integration. Semantic search is offline by default (a bundled all-MiniLM-L6-v2 WASM model) and can optionally use hosted embeddings via OpenAI or Vercel AI Gateway keys. The README provides no MCP server manifest, tool list, or client config example, so this profile contains no concrete tool names or install config. Overall it suits teams using coding agents that are willing to maintain domain knowledge in markdown; it offers limited value where adding source annotations is undesirable or agents are not used.

Strongest · Documentation 15/20 Weakest · Reliability 10/20

Reliability
10/20
Security and permissions
12/20
Maintenance
14/20
Documentation
15/20
Setup experience
11/20
Why each score
Reliability 10/20
The README states the MCP server is started via `lat mcp`, with `lat check` validating graph consistency, so the intended behavior is coherent. However, no server manifest is cached and only the README was supplied: there is no visible evidence of the MCP init handshake, declared tool list, error handling, or committed tests. Under the static calibration, reliability cannot exceed 12 without verifiable execution evidence (real CI workflows plus committed tests covering key paths), and since neither is present the score is lowered. 10.
Security and permissions 12/20
The boundary is reasonably clear: semantic search runs offline by default using a bundled local all-MiniLM-L6-v2 model compiled to WASM (no native binaries, no network); remote embeddings via OpenAI or Vercel AI Gateway only when the user supplies a key. Key resolution is explicit (env var, key file, helper command with a 10s timeout, config file). Deductions: the docs do not state whether keys are persisted to disk or where requests are sent, and the side effects/permission scope of `lat init` hooks, pre-commit hooks, and GitHub bots are not disclosed or confirmation-gated. No red-line issues (no malware, credential theft, or unconfirmed irreversible defaults) were found. 12.
Maintenance 14/20
MIT license is explicit, and the repository is active rather than archived (1913 stars and 33 open issues indicate usage; popularity is treated only as a discovery signal and adds no points). An npm package and version badge suggest a real release channel. Deductions: the repository is not cached, so commit cadence, issue response time, dependency updates, and a security-response channel cannot be verified, leaving governance and versioning evidence gaps. 14.
Documentation 15/20
Reasonably layered: problem motivation, the concept set (`[[wiki links]]`, source backlink comments via `// @lat:`, `lat check` enforcement), a directory layout example, the full CLI surface (init/check/locate/section/refs/search/expand/mcp), key resolution order, backend switching via `lat reindex`, and development requirements (Node 22, pnpm, rustup). Deductions: MCP client configuration examples, tool parameter details, cost disclosure, and troubleshooting are missing, and the README is untrusted evidence that cannot be cross-verified against source here. 15.
Setup experience 11/20
The install path is short: `npm install -g lat.md` followed by `lat init` in the target repo, with offline semantic search working without an API key. Deductions: there are no examples for wiring the MCP server into a mainstream client/editor, no platform compatibility notes, and development builds require a Rust/WASM toolchain. With no server manifest or executable evidence the setup ceiling is 15; missing client integration examples bring the score to 11.

Static review · not runListed 2026-09-10

Read the FMRS scoring method →

Fit and risk

What it can accessReads local filesWrites / deletes local files

Best for

  • Teams and individual developers who want a maintainable knowledge graph for their codebase
  • Users of coding agents who want them to work from stable, searchable context
  • Projects that treat markdown as the documentation medium and want docs and source to stay in sync
  • Environments that need offline semantic search (the default local WASM embedding model)

Not for

  • Small projects that only need a single flat AGENTS.md file (limited benefit from a knowledge graph)
  • Teams that do not use coding agents and do not plan to maintain markdown domain docs
  • Users expecting an out-of-the-box hosted service or a cloud multi-user documentation platform
  • Projects unwilling to add // @lat: annotations to source code

Required permissions

  • Read/write access to the project repository (lat init creates the lat.md/ directory and configures coding agents' hooks and instructions)
  • Read access to API keys when hosted embeddings are configured: the LAT_LLM_KEY environment variable, a file named by LAT_LLM_KEY_FILE, or a shell command named by LAT_LLM_KEY_HELPER
  • Write access to local index and config (lat reindex and lat config involve local caches and a config file)

Risks and side effects

  • If hosted embeddings are used with an API key (OpenAI or Vercel AI Gateway), relevant text may be sent to an external service; the default local model makes no network requests
  • LAT_LLM_KEY_HELPER executes a shell command to print the key; if that variable is set from an untrusted source it poses a command execution risk
  • A key file with weak permissions could be read by other local processes
  • A knowledge graph that is not kept up to date with lat check can drift from the actual code and mislead agents
  • lat init modifies coding agents' hooks and instructions, which may affect existing workflows

Setup

Before you start

Runtime:Node.js 22+

LAT_LLM_KEY optionalsecret Optional; an OpenAI (sk-...) or Vercel AI Gateway (vck_...) API key used directly for hosted embeddings. Without it, the bundled local model is used.
Other optional settings (2)
LAT_LLM_KEY_FILE optional Optional; path to a file containing the API key, as an alternative to LAT_LLM_KEY.
LAT_LLM_KEY_HELPER optional Optional; a shell command that prints the API key (10s timeout), as a further alternative.
  1. Install globally: npm install -g lat.md
  2. Run lat init in the repository where you want to use lat; this sets up popular coding agents with hooks and instructions and scaffolds a lat.md/ directory.
  3. Write markdown files in lat.md/ describing architecture, business logic, test specs, and anything else that matters.
  4. Link between sections with [[file#Section#Subsection]] syntax and link to source symbols with [[src/auth.ts#validateToken]].
  5. Annotate source code with // @lat: [[section-id]] comments (or # @lat: [[section-id]] in Python) to tie implementation back to concepts.
  6. Run lat check to validate graph and documentation consistency.
  7. Run lat mcp to start the MCP server for editor integration.

Development requires Node.js 22, pnpm, and Rust installed through rustup; build with pnpm install, pnpm buildall, pnpm test.

Check that it works

Start the server with lat mcp and confirm lat's tools appear in your client's tool list; you can also run lat check first to confirm graph validation works.

Troubleshooting

  1. lat check fails: it indicates inconsistent references or specs missing a // @lat: backlink; add the links or comments as indicated
  2. Semantic search results are poor: try rebuilding the index with lat reindex; use --remote for hosted embeddings or --local to force the offline model
  3. Key is not found: check the resolution order of LAT_LLM_KEY, LAT_LLM_KEY_FILE, and LAT_LLM_KEY_HELPER, or run lat config to print the config file location
  4. Build or run failures: confirm Node.js 22, that pnpm is installed, and that Rust is installed through rustup with the matching WASM target
  5. lat mcp is not usable in the editor: confirm the command is started at the project root and that the client config points to this MCP server
  6. Cannot find a section: use lat locate for exact or fuzzy name search, then lat section to view the section with its links and refs

Things to try

Once connected, you can ask your AI assistant things like:

  • Search the knowledge graph: how do we handle authentication?
  • Show me the auth#OAuth Flow section with its links and refs.
  • Find what references the architecture#Request Pipeline section.
  • Expand the [[OAuth Flow]] reference in this prompt for me.

Use cases

Let agents search the knowledge graph to discover key design decisions, constraints, and domain context quickly instead of grepping through the codebase
Start code review from the semantic changes in lat.md/ to understand what changed and why
Capture the context and reasoning behind a prompt into the graph as agents work, so future sessions start with full context
Describe test cases as sections in lat.md/ marked require-code-mention: true and have lat check flag specs without a // @lat: backlink
Build pre-commit hooks, GitHub bots, and CI tasks that improve the knowledge graph in the background
Use lat search for semantic search and lat expand to expand [[refs]] in a prompt for agents

Overview

lat.md is a markdown-based knowledge graph for your codebase. It keeps a set of interconnected markdown files in a lat.md/ directory at the project root, describing architecture, business logic, and test specs: sections link to each other with [[wiki links]], docs link into the codebase ([[src/auth.ts#validateToken]]), source files link back with // @lat: [[section-id]] comments (# @lat: [[section-id]] in Python), and lat check ensures nothing drifts out of sync. It addresses the fact that a single flat AGENTS.md does not scale: key design decisions get buried and agents hallucinate context they should be able to look up. The CLI provides lat init, lat check, lat locate, lat section, lat refs, lat search, and lat expand; lat mcp starts an MCP server for editor integration. Semantic search works offline by default using a bundled local all-MiniLM-L6-v2 embedding model compiled to WebAssembly (no native binaries, no network), and can optionally use hosted embeddings via an OpenAI or Vercel AI Gateway key.

Similar servers

Context7 80 · B

Upstash's official server providing up-to-date third-party library docs for AI coding assistants

★ 63.3k · Tools 2 Compare with this →

Source revision e52136e98e06 Data synced 2026-10-19 Read the FMRS scoring method