Madar logo

Madar

Indexes local JavaScript and TypeScript repositories for targeted function lookup, source excerpts, omissions, and continuation-based expansion.

Install Madar

Run the project’s own setup commands, in order.

Setup steps from the project

Madar installs with its own steps rather than a config we can generate, so these are copied as-is. Follow them in order and run the commands in a terminal. Source: github.com

  1. 1. Install
    npm install -g @lubab/madar
    
  2. 2. Add to your MCP client
    madar claude install --profile strict
    

Overview

Madar MCP server builds a local graph of JavaScript and TypeScript repositories so coding agents can retrieve source by file and symbol. Its MCP tools, context_pack and context_expand, return selected function bodies, source locations, omissions, freshness details, and continuation handles for omitted lines. Exact lookup works best when the target file and function are known; experimental discovery can investigate broader questions but may miss evidence. Madar runs locally without an API key and can also generate context packs, prompts, and handoffs through its CLI.

Use cases

  • Look up known JavaScript or TypeScript functions for an agent
  • Trace a statically bound local callee from a caller
  • Expand omitted source lines through continuation handles
  • Generate a context pack or prompt from a repository
  • Investigate code relationships with experimental discovery

Key features

  • Local JavaScript and TypeScript repository graph
  • Exact lookup by file and case-sensitive symbol
  • Source excerpts with omissions and freshness metadata
  • Continuation-based source expansion
  • CLI prompts, packs, summaries, and handoffs
  • Configurable exclusions with .madarignore

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

11/11 checks healthy over the last 42d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars21Stargazers on the source repository.
Last commit1d agoMost recent push to the default branch.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How Madar works

What Madar does

Madar gives coding agents targeted access to source code in a local JavaScript or TypeScript repository. It indexes files, declarations, imports, calls, framework metadata, and selected documentation into a repository graph. Agents can request functions by workspace-relative file and case-sensitive symbol, then inspect returned source excerpts and any reported omissions.

The primary MCP workflow is intended for source investigation. It is useful when an agent knows which functions matter and needs bounded source evidence rather than an entire repository dump. Madar also supports experimental query-based discovery for questions about authentication, endpoint behavior, report generation, or possible change impact. Discovery results can include verified source dependencies and static graph relationships, but they do not establish runtime behavior or complete task coverage.

How it works

Madar selects evidence from its local graph using either exact targets or experimental query matching. Exact requests support up to eight JavaScript or TypeScript targets and operate in explain mode. A target identifies a file and symbol; it selects a function, not a complete workflow, and does not infer every call made by that function.

Call-site inspection is available by adding a scan request for a callee. Madar checks the caller and returns a uniquely bound local implementation when the binding is verifiable. Identifier and static dotted calls are supported, while dynamic expressions and nested-closure calls are excluded.

Large functions are returned in budgeted pages. The context_expand tool follows continuation handles to retrieve omitted lines without repetition. Related evidence can use expandable handles, and source changes or exclusions can invalidate handles. Responses expose omissions, freshness, advisory coverage, and source references so the agent can decide whether more evidence is needed.

Setup and configuration

Install Node.js 20 or newer, then install the package globally:

Terminal
npm install -g @lubab/madar

Run commands from the repository you want to inspect. madar try builds or reuses the local graph and prints an experimental source preview without modifying project source. For direct CLI use, madar generate ., madar summary, and madar pack create or inspect context. The madar prompt command creates a provider-specific prompt, while madar handoff creates a share-safe handoff for another coding tool.

Agent installers are available for Claude Code, Codex CLI, Cursor, GitHub Copilot, and Gemini CLI. After installation, madar doctor and madar status help check the setup. Rerun the relevant installer after upgrading to refresh its managed profile.

Tools and capabilities

  • context_pack for exact source lookup and experimental discovery.
  • context_expand for following source-continuation and related-evidence handles.
  • Local graph indexing for JavaScript and TypeScript source relationships.
  • Budgeted responses with omission, freshness, and source-location metadata.
  • CLI generation of context packs, prompts, summaries, and handoffs.
  • .madarignore support for excluding generated output.

Limitations and notes

Madar is not a runtime tracer, hosted knowledge base, pull-request reviewer, or vulnerability scanner. Direct source reads may be preferable for small repositories or straightforward questions. Experimental discovery, architecture investigation, review, and impact analysis can omit necessary evidence and may require follow-up reads.

The graph follows source policy: root or workspace package.json files up to 128 KiB and JavaScript/TypeScript files under lib/ are eligible, while other JSON configuration files are not source evidence. Stale graphs should be regenerated. Ordinary security source remains indexable, but credentials and other sensitive files should be handled according to the repository's exclusion configuration. Madar itself does not require an API key; the connected coding agent may still send prompts or selected context to its configured model provider.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Madar

Madar is an MCP server that connects coding agents to a local JavaScript/TypeScript repository graph. Its main tools, context_pack and context_expand, return selected function source, omissions, freshness, and continuation-based expansions for exact lookup and experimental discovery.

Install Node.js 20 or newer, then run `npm install -g @lubab/madar`. From the target repository, use the agent-specific installer such as `madar claude install --profile strict`, then run `madar doctor` and `madar status`.

Yes, Madar provides a Cursor installer. Run `madar cursor install --profile strict` from the repository, then use the configured MCP integration for source lookup and expansion.

Madar indexes JavaScript and TypeScript source for its repository graph and function lookup. Its source policy covers eligible JavaScript and TypeScript files under `lib/` plus root or workspace `package.json` files up to 128 KiB.

Use `context_expand` with the returned continuation handle in the same MCP session. Continue with each new handle until the remaining whole source lines are delivered; a changed or newly excluded source file can invalidate the handle.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewMadar AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/madar?style=directory)](https://allmcps.com/mcp/madar)
HTML Embed
<a href="https://allmcps.com/mcp/madar"><img src="https://allmcps.com/api/badge/madar?style=directory" alt="Madar on AllMCPs" /></a>