# LayerMap [Health: Active]

**Category:** 🤖 Coding Agents  
**Repository:** https://github.com/coffeecoproject/layermap  
**GitHub Stars:** 11  
**npm Downloads (last month):** 8598  
**Views:** 4  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/layermap

## Description
Call graph for coding agents: callers up to HTTP routes, callees, usages for TS/JS, Go, Python, Java

## Tools
Capabilities this server exposes over MCP:

- **project_explore_map** — Use this instead of grep to answer what calls a function or method, what changing it affects (callers traced up to entry points such as HTTP routes, handlers, jobs and commands), what it calls, and what a directory or file contains: one call returns the callers or callees up to 8 levels deep, with file paths and line numbers, for TypeScript, JavaScript, Go, Python and Java. Read the static project map, zooming from the whole project to one declaration. path "." or a directory lists modules, module imports, external packages and its files: with exported declarations when the listing is small, as file names and line counts by directory when larger, and as modules only when very large. Start here to see what exists before searching or reading. A file path lists its declarations and members, imports, importers and top-level statements. A file path with name (or Container.member), optionally narrowed by its start line, or with a line alone, shows that declaration's calls, callers (including uses as a value), writes, heritage, decorators and members, aggregated per related declaration with @line sites; closures and locals are folded into their named container. depth also expands the related declarations hop by hop: up to 8 in one direction, which traces callers up to entry points (INCOMING) or callees down (OUTGOING), and up to 3 for BOTH. To find what a change affects, select the declaration with direction INCOMING and a depth up to 8, continue from any NOT EXPANDED declarations the view names, then confirm the entry points in source. Test files and standard-library call targets are hidden and counted by default; includeTests and includeUnresolved show them. Views use kinds f function, c class, m method, p property, v variable, t type, i interface, e enum; numbers are 1-based source lines. In a declaration view, @n marks where a relationship occurs and +n counts further sites, which project_find_references lists; a quoted path after the sites is the route the call or value is registered under there: its HTTP methods when the registration names them, then its path joined with the prefixes of the routers it is registered on, as far as the same function or file sets them (a prefix added where a router is mounted or passed in is not included); route "…" after a decorator is the full route the decorator maps, its class's path joined with its own. Static relationships are grouped by the declaration that owns them. Callers are direct calls, uses as a value (stored, passed, returned or selected, then usually invoked through that value) and calls through an interface, type or base member that a declaration implements (dispatched from); dispatches to lists the members that implement an interface, type or base member, which a call through it may reach; trace stops names calls whose target is a function value, a member without a mapped implementation or a computed key, which only source reading can follow; possible callers by name are calls elsewhere, in the same language, of a member with a method's name on a receiver of unknown type (an untyped value, or one an unloaded package produced); they may or may not reach that method. Read source at the printed line ranges. The map is static: trace stops, possible callers by name, framework wiring and unresolved targets need source reading, and a missing relationship does not prove absence. When a page reports more entries, continue with offset and otherwise unchanged arguments.
- **project_search_map** — Use this to find where a function, method, class or type is declared, by name or by words in its name, path or documentation, before exploring its callers with project_explore_map. Find declarations and files whose names, paths or source documentation match query terms. ANY (default) matches any term, ALL requires every term, LITERAL matches the exact text. Results are ranked by relevance and grouped by file with the declaration name, kind, 1-based line range and matched fields (kinds f function, c class, m method, p property, v variable, t type, i interface, e enum; numbers are 1-based source lines). Zoom into a result with project_explore_map({path,name}) or read its line range in the file. This is not a full-text search and does not prove absence; search the source text itself for exact text. Continue with offset and unchanged conditions.
- **project_find_references** — Use this to list every place a declaration is used (calls, imports, re-exports, reads and writes), compiled from current source: more complete than searching for its name. Compute usages of a mapped declaration from current source, including aliases, re-exports and non-call references. Select it as project_explore_map does, with path (its file) and name as printed by project_explore_map or project_search_map, and line (its start line) when names repeat; or with an entityRef or locator {path,start,kind}. Broader and more expensive than the cached callers in project_explore_map; file or unsupported declarations may lack a reference target. within and kinds filter usage locations before paging. objects contains compact declarations; targetRef and reference ownerRef identify them. Read a reference at its line range. A file that several compiler contexts read (such as packages of one workspace) lists its references once per context, each with that context's configPath. Continue with nextCursor and unchanged conditions, including after an empty partial page. Filtered exhaustion and missing results do not prove absence.
- **project_check_changes** — Use this once the edits are done, before reporting the work done: it lists what the uncommitted changes affect, from the changed functions up to the HTTP routes, jobs and commands that reach them, plus the existing tests related to them. Compares the working tree with a commit (HEAD by default, so uncommitted and untracked changes), finds the declarations the diff changed, removed or renamed, and follows their callers, and the code using a field or type, up to 8 levels. It reports, conclusion first: AFFECTED ENTRY POINTS reached through resolved calls, each route with its HTTP methods and full path, the chain to the change and whether the diff changed its registration; POSSIBLY AFFECTED ones reached only through a call on an interface or base member, or through code that uses a changed field or type; REQUESTED BY, the code and templates outside the tests that request the path of a route whose handler the change reaches or a route it removed, found by text; EXISTING TESTS CHANGED, the tests that existed before the diff and whose code it changed or removed; SHARED BY, when tests reach the changed code through more than one area (package or module), so a change meant for one feature may change others; NAMES STILL USED ELSEWHERE, environment variables and configuration keys the diff removed from a file that other files still read or set, found by text; NEW MODULE DEPENDENCIES, imports between the modules of the project overview that the base did not have, and those that make two modules depend on each other, for you to judge against the project's layers; NEW COMPILE ERRORS, what the compiler reports on lines the diff left unchanged and did not report before, in code a tsconfig covers; PACKAGES NOT FOUND, packages the changed code needs that are not installed in this directory, whose types the trace then lacks; EXISTING CODE LIKE THE NEW CODE, declarations the diff adds whose code reads almost the same as code the project already has; LEFT WITHOUT CALLERS, declarations whose last callers outside the tests the diff removed or changed, and that nothing extends, implements, overrides or wires with a decorator; CHECK BY HAND for what a static map cannot follow (changed configuration, templates, migrations or dependency files, changed registrations of routes not listed above, declarations with no callers, calls by name on receivers of unknown type); and RELATED TESTS, closest first, the existing test files the diff changed, that call or use the changed code, request a route it reaches, may request one through a path the map does not work out, spell out a stretch of such a route's path in their text, may call it through a receiver of unknown type or through a test support file beside or above them, import a changed file, are named for its module or sit beside it; given tests, NOT REACHED BY THE GIVEN TESTS, the changed declarations none of them calls or requests through a route, or uses when it is a field or type, with the entry points above them, the other tests of the project that run them, and those the given tests may run through a request whose path the map does not work out. It does not run or write tests: run the related ones if the change needs verifying; a failing or rewritten test of a feature the request is not about means the change leaked, so restore the test and narrow the change; a new dependency that runs against the layers or closes a cycle means moving what both modules need down rather than importing upward; new code like existing code means using the existing code, removing the old if the new replaces it, or having the existing code use the new where it is the one that can, unless the two are meant to differ, and changing existing code only where it is part of the task while telling the user of the rest; code left without callers means deleting it, with the tests that only test it, when the change replaced it; call it once when the edits are done; and confirm the entry points in source, since an empty list does not prove a change safe.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "layermap": {
    "command": "npx",
    "args": ["-y","layermap","mcp"]
  }
}
```

## Documentation

## What LayerMap does

LayerMap provides a layered, read-only map of a codebase for MCP clients. Its main use is answering impact and navigation questions that otherwise require repeated searches: what calls a symbol, what that symbol calls, where it is used, and which entry points a change can reach.

The map can connect callers to HTTP routes, handlers, jobs, and commands. It also reports modules, declarations within files, symbol usages, and the routes, jobs, commands, and related existing tests reached by uncommitted changes. Traces extend up to eight levels for callers and callees.

Supported languages are TypeScript, JavaScript, Go, Python, and Java. Resolution follows the relevant compiler or type checker, allowing relationships through interfaces, base classes, templates, and decorators to be represented as resolved language relationships rather than simple name matches. WeChat mini-programs receive additional links between page or component templates, bound methods, displayed components, emitted events, and page handlers.

## How it works

LayerMap builds a local code map and keeps it up to date on each call. Agents query the map through read-only MCP tools instead of reconstructing relationships through many independent searches. Results identify declarations, methods, functions, call locations, and registered routes; route output includes the HTTP method and full path when a framework route is resolved.

The system runs on the developer's machine and sends nothing. Its compiler-based approach is particularly relevant when text search could miss calls through interfaces, inheritance, templates, or decorators. It is intended for use by coding agents such as Claude Code and Codex, along with other MCP clients.

## Setup and configuration

Claude Code can install LayerMap from its plugin marketplace:

```text
/plugin marketplace add coffeecoproject/layermap
/plugin install layermap@layermap
```

Codex uses the corresponding marketplace and plugin commands:

```text
codex plugin marketplace add coffeecoproject/layermap
codex plugin add layermap@layermap
```

After installation, the client can use LayerMap's read-only MCP tools against the repository being analyzed.

## Tools and capabilities

- Trace callers upward by as many as eight levels, including the HTTP routes, handlers, jobs, and commands that lead to a symbol.
- Trace callees downward by as many as eight levels.
- List modules, file declarations, and usages of a symbol.
- Analyze uncommitted changes and identify reachable routes, jobs, commands, and related existing tests.
- Resolve calls using TypeScript, JavaScript, Go, Python, and Java compiler or type-checker relationships.
- Link WeChat mini-program templates, components, events, methods, and pages.

## Limitations and notes

LayerMap is focused on code relationships and impact analysis rather than semantic search, refactoring, or broad multi-repository search. Tools based on tree-sitter may be a better fit when more languages are required; language servers are more suitable for renaming and refactoring; embedding search is intended for meaning-based retrieval; and Sourcegraph is suited to searching across many repositories.

Published benchmark results cover small samples of tasks written by LayerMap's authors. Results vary by agent, task, reasoning settings, and whether maps were built ahead of time. The benchmark reports stronger endpoint discovery under tight request limits, while ordinary small local tasks could take additional time and cost.

_Full upstream README: https://allmcps.com/mcp/layermap/readme_

