3 ms·
Show HN: XRAY MCP – AST-grep wrapped in a tiny server for code-aware AI
Hi HN,
I built XRAY MCP after discovering that AI assistants were scanning my projects with plain grep and guessing. I tried direct tree-sitter integration and language servers; both felt heavy for a lightweight tool.
ast-grep hit a sweet spot: syntax-aware search in a single binary. XRAY MCP wraps it behind three endpoints—map, find, impact—so a model (or human) can answer questions like “what breaks if I change this function?” on demand.
It’s stateless, supports Python/JS/TS/Go, and installs quickly.
Repo: https://github.com/srijanshukla18/xray https://github.com/srijanshukla18/xray
Would love to know your thoughts!
- tcpip84 1y agoNice. Will check it out. I’ve tried using AI-assisted code search before and always hit the “grep guessing” problem you mentioned.
- srijanshukla18 1y agoexactly yep, hate it when it just keeps going in circles. thats a lot of extra tokens also you know! let me know your thoughts once you check it out
- satyajeetjadhav 1y agoLooks interesting. In my experience the way current coding agents behave is - they make a change, then rely on linter to highlight errors due to the change. Once linter errors are highlighted, they try to fix them. Providing access to something like this via mcp might help these coding agents plan better and limit or atleast understand the blast radius for refactors. Will try.
- srijanshukla18 1y agoYou've hit the nail on the head! "Understanding the blast radius" is the core problem xray mcp tries to solve. The whole idea behind tools like what_breaks is to give the agent that foresight before it makes a change, moving it from a reactive "change -> lint -> fix" cycle to a more proactive "plan -> analyze -> change" workflow. Thanks for checking it out! About the linting use case specifically, I've found claude code hooks to be very beneficial. Not sure if other tools have an equivalent. Check that out too!
- importhuman 1y agoWill check this out. Is there a prompt I can use in the beginning that doesn't need me to add the xray prompt in future calls?
- srijanshukla18 1y agoYes! depends on the code agent you are using. CLAUDE.md or GEMINI.md for example - you can be adding a one liner there - "always use xray mcp tools to make any changes or to explore a new codebase"
- preetidew 1y ago[dead]
- tushr 1y agoI am surprised that tools like Gemini CLI and Claude Code are not doing this by default.
- srijanshukla18 1y agoI know right! I am surprised that many of these cli tools just keep running around the codebase read whole files at once and grepping vaguely
- swatimodi 1y agoThis is amazing, such tools for supporting the ai tools to do a better job at helping us is what we need!
- srijanshukla18 1y agoHey, thanks for checking it out!
- kritika18 1y ago[dead]
- vaibhavdaga07 1y agoNeat project - I liked that you used ast-grep to help the LLM better understand codebases. looks promising for improving code navigation.
- srijanshukla18 1y agohey thanks for checking it out!