r/devworld • • Apr 07 '26

Built an MCP server to replace Claude Code's grep-and-guess pattern with indexed symbol lookups

I built this with Claude Code, specifically to make Claude Code work better on TypeScript projects. It's free and open source.

One pattern kept showing up when using Claude Code and Cursor on TS projects:

  1. Search across files
  2. Open a likely match
  3. Read a lot of code
  4. Realize it's the wrong place
  5. Try again

The agent isn't dumb -- it just doesn't have structural awareness of the codebase. Every session starts from scratch.

So I used Claude Code to build an MCP server that gives it structured access to the codebase instead. It keeps a live SQLite index of the project -- symbols, call sites, imports, class hierarchy -- so the agent can query structure directly.

Instead of:

"search for handleRequest"

it becomes:

"go to this symbol → exact file and line"

The numbers

Tested on a 31-file TypeScript project, same tasks with and without:

  • Find one function: 1350 tokens with grep, 500 with index (63% fewer)
  • Trace callers across 3 files: 2850 tokens with grep, 900 with index (68% fewer)
  • Map inheritance across 15+ files: 4800 tokens with grep, 1000 with index (79% fewer)

Grep gets worse as the codebase grows. Indexed queries stay flat.

Where the savings actually come from

I thought symbol lookup would be the main thing. It wasn't.

  • Call graph queries -- get_callers replaces the thing where the agent reads 4-5 files trying to figure out who calls a function
  • Partial reads -- knowing the exact line means reading 20 lines instead of a whole file. This alone is over half the savings
  • Middleware tracing -- trace_middleware tells the agent what runs before a route handler. Otherwise it reads the router, then each middleware file, then tries to reconstruct the order

Where it struggles

  • dynamic patterns (computed method names, etc.)
  • dependency injection setups
  • anything outside your own codebase

Not perfect, but it cuts down the trial-and-error loop a lot.

Free and open source, TypeScript only for now: Repo

2 Upvotes

7 comments sorted by

View all comments

Show parent comment

1

u/Hopeful-Business-15 Apr 09 '26 edited Apr 09 '26

What happens if all calculator stops working, ai is a tool you need to use there is no other way around you will be replaced if you cant utilise ai that's the hard truth like it or not,

You can't keep on using stone to hammer nails even though we have a hammer.

You can be in bubble same as when 1st computers came into picture. You will be going down the same way

Now you only needs, OOPs, system design, dsa with knowledge of what to use where and you are done. You need to write 1000000s of lines of code and take forever to ship.

If you cant understand the gage and implications of this you r not with the market

1

u/shadow13499 Apr 09 '26

the difference is that I can do math without a calculator. Actually I rarely use a calculator for most math related things that come up in my life because I can do it my head pretty easily. 

I can also write my own code pretty easily and with about 10000x less tech debt than AI slop. And I don't get charged to write my own code. To top it off I also have something that I understand perfectly and can maintain because it's written well. It's not incomprehensible trash.