Crates.io | fs_query |
lib.rs | fs_query |
version | 0.1.1 |
created_at | 2025-09-06 16:02:54.189657+00 |
updated_at | 2025-09-06 16:06:32.71489+00 |
description | A Model Context Protocol server for efficient code symbol extraction using Tree-sitter |
homepage | |
repository | |
max_upload_size | |
id | 1827211 |
size | 93,528 |
Finally, a tool that doesn't read your entire codebase just to find one function
Picture this: You ask your AI assistant a simple question like "show me the main function in this project." What happens? Most MCP tools treat code files like plain text and proceed to ingest your entire codebase like a digital vacuum cleaner having an existential crisis.
Traditional MCP file reading:
fs-query's approach:
fs-query is a Model Context Protocol (MCP) server that speaks fluent "symbol extraction" to AI assistants. Think of it as a translator between your AI and your codebase - one that actually understands the difference between a function definition and a function call in a comment.
It's powered by Tree-sitter, which is basically the difference between a surgeon and someone with a chainsaw when it comes to parsing code.
Your AI assistant can now ask intelligent questions like:
Instead of getting a novel-length response, it gets exactly what it needs. Revolutionary, I know.
Drop this into your MCP config and watch the magic happen:
{
"mcpServers": {
"fs_query": {
"command": "/path/to/fs_query",
"args": ["mcp"],
"env": {},
"transportType": "stdio",
"timeout": 120000,
"disabled": false
}
}
}
Before fs-query:
After fs-query:
Sure, you can use it from the command line too, if you're into that sort of thing:
# Find all functions with "handle" in the name
./fs_query extract-symbols --file-path "src/" --symbols function --name-regex ".*handle.*"
# Get all classes, because you're curious
./fs_query extract-symbols --file-path "**/*.py" --symbols class --pretty
But honestly, the real magic happens when your AI uses it.
I got tired of watching AI assistants read entire codebases just to answer simple questions. It's like asking someone what time it is and having them explain how clocks work, the history of timekeeping, and their personal relationship with punctuality.
The traditional MCP problem:
The fs-query solution:
Mind-blowing, right?
Other tools: "Let me index your entire project first..." fs-query: "Nah, I'll just parse what you need, when you need it"
Other tools: "Here's 50MB of context!" fs-query: "Here's exactly what you asked for"
Other tools: "Loading... please wait... still loading..." fs-query: "Done. What's next?"
MCP (Model Context Protocol) is like having a universal translator between AI assistants and your development tools. Instead of every AI reinventing the wheel with custom integrations, they can all speak the same language.
fs-query plugs into this ecosystem and makes your AI assistant actually useful for code navigation instead of just a very expensive grep replacement.
# Build the thing
cargo build --release
# Test it works
./target/release/fs_query extract-symbols --file-path "." --pretty
# Add to your AI assistant's MCP config
# (See the JSON above)
If you're tired of your AI assistant reading War and Peace when you just want to know what functions are in a file, fs-query is for you.
If you think parsing code with regex is a reasonable approach in 2024, this tool is definitely for you.
If you believe AI assistants should be precise surgical instruments rather than digital bulldozers, welcome to the club.
Built with: Tree-sitter (the good stuff), Rust (obviously), and a healthy disdain for inefficient tooling.
License: MIT (because life's too short for complicated licenses)
Warranty: None. But it probably won't delete your code. Probably.