@maplayer/maplayer
v0.1.11
Published
Code intelligence for AI agents
Readme
MapLayer
Code intelligence for AI agents. MapLayer indexes your repository into a local SQLite graph and serves it over MCP — giving Claude, Codex, Cursor, and other AI tools structured code navigation instead of raw file reads.
npm install -g @maplayer/maplayerQuick start
maplayer init # scaffold .maplayer/ config and update agent instruction files
maplayer index # parse the repo into a local code graphThen wire maplayer serve into your AI tool (see Wiring into AI tools).
maplayer init updates existing agent instruction files (CLAUDE.md, AGENTS.md, .cursorrules, GEMINI.md) but does not create them if they are missing. Create the ones you use first, then rerun maplayer init.
Requirements
- Node.js 22+
- Source code in one or more of: TypeScript, JavaScript, Java, Kotlin, Python, C#, Swift, YAML
If your project uses a different Node version, install Node 22 alongside it with nvm or fnm:
nvm install 22 && nvm use 22
npm install -g @maplayer/maplayer
node:sqliteis marked experimental in Node 22 and may print anExperimentalWarningon stderr. This does not affect functionality. Suppress it withNODE_NO_WARNINGS=1 maplayer indexif needed.
Wiring into AI tools
Claude Code
Add to .claude/settings.json in your project:
{
"mcpServers": {
"maplayer": {
"command": "maplayer",
"args": ["serve"]
}
}
}Codex
Add to .codex/config.toml in your repo:
[mcp_servers.maplayer]
command = "maplayer"
args = ["serve"]
startup_timeout_sec = 30Gemini CLI
Add to .gemini/settings.json (or ~/.gemini/settings.json for all projects):
{
"mcpServers": {
"maplayer": {
"command": "maplayer",
"args": ["serve"]
}
}
}Cursor
In Cursor settings, add an MCP server with command maplayer and argument serve.
Continue.dev
Add to .continue/config.yaml:
mcpServers:
- name: maplayer
type: stdio
command: maplayer
args:
- serveMCP tools are only available in agent mode in Continue.
Roo Code
Add to .roo/mcp.json:
{
"mcpServers": {
"maplayer": {
"command": "maplayer",
"args": ["serve"]
}
}
}MCP tools
Once the server is running, agents can call the following tools:
| Tool | Description |
|------|-------------|
| query_maplayer | Primary entry point. Intent-routed query planner — routes to the right tool, shapes the response, and logs telemetry. Use this for most queries. |
| search_symbols | Find functions, classes, and types by name or keyword |
| find_by_intent | Full-text search over file summaries and symbol names |
| trace_dependencies | List imports and dependents for a file |
| find_callers | Find all call sites of a function |
| find_callees | Find all functions called by a function |
| get_symbol_body | Read a symbol's exact source (policy-gated) |
| get_file_slice | Read a specific line range from a file (policy-gated) |
| get_file_summary | Cached file-level summary with freshness metadata |
| describe_module | A file's purpose, exports, and key behaviors |
| list_changed_files | Files changed since last index or a given commit |
All results include a freshness field (fresh / stale / missing) so the agent knows whether the index reflects the current file on disk.
Git lineage indexing
Build a full commit history index for file and symbol lifecycle queries:
maplayer index --full-historyThis enables agents to query when a symbol was introduced, how a file was renamed over time, and which commits touched a given path.
Graph explorer
Visualize your indexed symbol graph in a browser:
maplayer visualize
maplayer visualize --port 4311 --max-nodes 1200 --max-edges 4000Features: force-directed layout, pan/zoom, node and edge detail panel, git history per symbol, unified and split diff view, neighborhood focus mode, and live reload when the index updates.
Timeline view
Explore git history as a filterable, chartable event stream:
maplayer timeline
maplayer timeline --port 4312Filter by author, path, symbol, event type, or time range. Drill into individual commits to see file changes and symbol-level diffs.
Symbol search CLI
Search the index from the terminal without starting a server:
maplayer find "user service"
maplayer find --kind class,function "auth"
maplayer find --intent "file upload handling"
maplayer find --json "parse"Policy
maplayer init creates .maplayer/policy.yaml — commit this file. It controls what gets indexed and what agents can retrieve. Secrets, keys, and generated files are excluded by default.
exclude:
paths:
- ".env*"
- "secrets/**"
- "**/*.pem"
retrieval:
allow_raw_file_slice: true
max_slice_lines: 120
stale_summary_mode: "flag" # flag | block | allowTest any path:
maplayer policy check .env
# excluded tool=index path=.env
maplayer policy check src/main.ts
# allowed tool=index path=src/main.tsExits non-zero for excluded paths — usable in CI.
Audit log
Every MCP tool call is appended to .maplayer/audit.log (gitignored):
maplayer audit show # last 20 entries
maplayer audit show --tool get_symbol_body # filter by tool
maplayer audit show --json # machine-readable
maplayer audit tail # live stream
maplayer audit stats # zero-result rates, top missed queriesGitignore
maplayer init adds the correct entries automatically. To add them manually:
.maplayer/index.db
.maplayer/index.db-shm
.maplayer/index.db-wal
.maplayer/audit.logCommit policy.yaml and config.yaml.
