Show HN: XRAY MCP – AST-grep wrapped in a tiny server for code-aware AI (github.com)

5 points by srijanshukla18 ↗ HN
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

Would love to know your thoughts!

9 comments

[ 2.1 ms ] story [ 25.6 ms ] thread
Nice. Will check it out. I’ve tried using AI-assisted code search before and always hit the “grep guessing” problem you mentioned.
Looks 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.

Will 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?
I am surprised that tools like Gemini CLI and Claude Code are not doing this by default.
This is amazing, such tools for supporting the ai tools to do a better job at helping us is what we need!
Neat project - I liked that you used ast-grep to help the LLM better understand codebases. looks promising for improving code navigation.