Skip to main content
Glama

Malon

███╗   ███╗ █████╗ ██╗      ██████╗ ███╗   ██╗
████╗ ████║██╔══██╗██║     ██╔═══██╗████╗  ██║
██╔████╔██║███████║██║     ██║   ██║██╔██╗ ██║
██║╚██╔╝██║██╔══██║██║     ██║   ██║██║╚██╗██║
██║ ╚═╝ ██║██║  ██║███████╗╚██████╔╝██║ ╚████║
╚═╝     ╚═╝╚═╝  ╚═╝╚══════╝ ╚═════╝ ╚═╝  ╚═══╝

Cut your AI coding agent's token waste by 69%. Zero accuracy loss.

Malon is a local-first MCP server that sits between your coding agent (Claude Code, Codex CLI, Cursor, Windsurf, Aider) and your codebase. Instead of your expensive primary model burning tokens on 40 grep hits and six dead-end files, Malon's cheap subagent does the hunting — and your agent only sees the 2-3 file:line spans that actually matter.

npx malon init         # 5-second setup
# Then add the MCP server to your agent — done.

Install · How it works · Benchmarks · Security · Docs


Why Malon?

Every coding agent has the same problem: it spends most of its thinking budget on navigation, not answers.

  • You ask "where is JWT validated?" — the agent greps the repo, reads 8 files, burns 24K tokens, and finds the answer on line 47 of the 6th file.

  • You open a project after two weeks — the agent re-reads everything from scratch, context window fills with noise, and hallucinations creep in.

Malon fixes both:

Problem

Malon's solution

Result

Agent burns tokens on grep/read loops

Cheap subagent narrows search in 2-3 rounds

69% fewer tokens

Every session starts from zero

Git-tracked memory ledger persists decisions

No re-read needed

Context gets noisy mid-session

Rot governor detects thrashing, recommends checkpoint

Fewer hallucinations

No visibility into spending

Cost governor tracks every token, shows live spend

Full transparency


Related MCP server: knitbrain

Quick start

# 1. Initialize Malon in your project
npx malon init

# 2. Start the MCP server
npx malon

# 3. Your agent connects automatically via STDIO.
#    Call malon_search("where is X") instead of native grep.

One-time setup. Works in under 10 seconds on any repo.


Benchmarks

69.2% token savings measured on a 5-language, 6-file search run across 5 query types. Each benchmark is reproducible — run test-env/run.ps1 yourself.

Query type

Queries

Native tokens

Malon tokens

Tokens saved

symbol_lookup

3

16,000

4,500

71.9%

cross_file

2

8,000

2,900

63.7%

Overall

5

24,000

7,400

69.2%

Larger repos → bigger savings. Malon shines when queries match 5+ files — the subagent reads exactly the relevant spans while a naive agent reads everything.

What makes the savings real

Technique

Without

With

System prompt

~1,000 tokens

~650 tokens (35% smaller)

Avg subagent rounds

3

2 (early-exit when confident)

Avg span size

300 tokens

150 tokens (precision-guided)

History retention

Full context kept

Last 2 rounds (saves ~2K tok/query)

Repeated queries

Full cost every time

Cached for 5 min (0 tok)

Per-query breakdown

Query

Files

Native

Malon

Saved

validateToken

2

8,000

1,600

80.0%

fibonacci

1

4,000

1,450

63.7%

Config

1

4,000

1,450

63.7%

handleLogin

1

4,000

1,450

63.7%

Database

1

4,000

1,450

63.7%

Pricing: gemini-2.0-flash at $0.10/M input, $0.40/M output.


How it works

Your Coding Agent ──→ malon_search("where is JWT validated?")
                          │
                          ▼
                    Search Subagent (Haiku-class, 2-3 rounds)
                     fts_grep → read_span → graph_walk
                          │
                          ▼
                    1-3 precise file:line spans
                     + one-line justification each
                          │
                          ▼
                    Your agent reads only those spans
                          │
                          ▼
                    Cost Governor logs tokens_saved
                    Rot Governor checks for thrashing

The four core loops

Search loop — Your agent calls malon_search instead of native grep. Malon's cheap subagent runs 2-3 rounds (FTS5 grep → span reading → graph walk), then returns only the 1-3 relevant spans. Your primary model never sees the intermediate noise.

Memory loop — Call malon_memory_write("decisions", "Use Prisma", "...") after any non-trivial change. The entry goes to .malon/memory/decisions.md — git-tracked, diffable, reviewable. Reopen the project weeks later and malon_memory_get returns a "where you left off" summary in ~3K tokens instead of a full repo re-read.

Cost loop — Every subagent call is logged with model, provider, tokens, and cost. malon status shows live spend, tokens used, and cumulative tokens saved vs. a naive baseline. No surprise bills. No hidden spending.

Rot loop — When context size exceeds a repo-calibrated ceiling or the same file is re-read 3+ times, Malon flags it. It saves a structured checkpoint to the memory ledger and recommends a fresh session — your progress is preserved, not lost.


Commands

malon init               # Initialize .malon/, config, and full index
malon init --incremental # Incremental re-index (git diff since last SHA)
malon init --local       # Local-only mode (auto-detect Ollama)
malon index              # Full re-index (re-parse all supported files)
malon status             # Session stats: spend, tokens saved, rot flags
malon reset              # Delete index.db, usage.log, lock file
malon local-check        # Test local LLM (Ollama) availability

MCP tools

Tool

What it does

malon_search

Search codebase, return 1-3 file:line spans with justification

malon_memory_get

Retrieve relevant memory entries (decisions, conventions, sessions)

malon_memory_write

Write to memory ledger. Scoped to .malon/memory/. Rejects secrets.

malon_status

Session spend, tokens, rot flags, tokens saved vs baseline

malon_checkpoint

Trigger rot checkpoint, save session progress to memory

malon_admin

Manage API keys (generate, list, revoke)


For your AGENTS.md

Add this to your CLAUDE.md, AGENTS.md, or .cursorrules:

## Malon MCP tools

Malon gives you search, memory, and status tools. Use them instead of
native grep/read when possible to stay focused on the answer.

1. For "where is X" or "how does Y work" — call `malon_search` first.
   It returns 1-3 precise file:line spans with a one-line justification,
   so you read the right slice instead of guessing.

2. For cross-file context (callers, imports, related symbols) —
   call `malon_search` with the symbol name. The subagent walks the
   call graph for you.

3. After a non-trivial change — call `malon_memory_write` with the
   decision. Future sessions will see it via `malon_memory_get`.

4. When reopening a project after days/weeks — call `malon_memory_get`
   with an empty query for a "where we left off" summary.

5. Check `malon_status` for spend, tokens saved, and rot flags.
   If a `rot_flag` is set, consider a fresh session — progress is saved.

6. Don't bypass Malon with native tools for cross-file questions.
   That defeats the purpose. Report missing results instead.

Security

Malon is designed so your code stays on your machine.

  • Local-first. The Search Subagent sends short code spans (1-3 snippets) to your LLM provider — never full files.

  • Local-only option. Configure Ollama for zero outbound data.

  • Secret scanning. malon_memory_write rejects API keys, tokens, and private keys before they touch disk.

  • Path confinement. Every filesystem operation is validated against the repo root. Path escape attacks are rejected in code.

  • No telemetry. Zero outbound calls except to your configured LLM provider. Opt-in only, default off.

  • Concurrent protection. .malon.lock prevents double-indexing. Stale locks auto-recover.

Full security posture →


Supported languages

TypeScript · TSX · JavaScript · JSX · Python · Go · Rust · Java


Configuration

All settings in .malon/config.yml:

  • pricing — Provider pricing tables with last_verified date

  • search — Provider, model, timeout, max subagent rounds

  • cost — Hard dollar ceiling (default: none), shadow heuristic

  • rate_limits — Per-session call/token limits

  • log — Log level (info/debug), optional file path

  • telemetry — Opt-in analytics (disabled by default)


Documentation

Doc

What's in it

AGENTS.md

Engineering manual: architecture, security posture, dev guide

SECURITY.md

End-user security posture and data handling

TERMS.md

Terms of service

PRIVACY.md

Privacy policy


Support & Issues


License

MIT

A
license - permissive license
-
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    B
    quality
    C
    maintenance
    A local-first MCP server that provides AI agents with safe codebase access through file discovery, hybrid lexical-semantic search, and project introspection. It features durable local memory and semantic indexing while keeping all data and processing entirely on your local machine.
    Last updated
    74
    39
    5
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    Local-first MCP server that gives any AI coding agent per-project memory, workflow intelligence, and always-on, lossless token & context optimization.
    Last updated
    37
    35
    3
    MIT
  • A
    license
    -
    quality
    B
    maintenance
    Local-first code intelligence and safety layer for AI coding agents. MCP server exposes dependency graph, impact analysis, and AST-compressed repo context, backed by typed local memory, patch-scope safety gates, and git-independent transaction rollback.
    Last updated
    MIT
  • A
    license
    -
    quality
    B
    maintenance
    A self-hosted MCP server that enables AI coding agents to read, edit, search, and run code in local projects with human review loops and policy controls.
    Last updated
    MIT

View all related MCP servers

Related MCP Connectors

  • Local-first RAG engine with MCP server for AI agent integration.

  • User-owned memory for AI agents, Copilot, Claude, IDEs, CLIs, and chat apps over remote MCP.

  • MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/malon-mcp/Malon_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server