This is a submission for the GitHub Finish-Up-A-Thon Challenge
What I Built
I built smarter-faster-better-mcp β an MCP (Model Context Protocol) server designed to stop developers from wasting expensive AI tokens on irrelevant code.
Right now, when you ask an AI like Claude to fix a bug, you either let it blindly search your codebase (burning tokens and time) or you manually copy-paste multiple files into the context window. Both approaches lead to the same problem: the model gets confused by the noise and starts hallucinating.
My MCP acts as an intelligent middleman. Before the heavy AI model even touches the request, this server analyzes your codebase using real AST (Abstract Syntax Tree) parsing. For the JS/TS ecosystem, it uses a blazing-fast Rust-based parser (OXC), and for other languages, it uses Web Tree-Sitter. It walks the syntax tree, finds the exact component needed for the task, resolves complex paths (respecting your tsconfig.json paths), and maps out dependencies down to the specific line numbers.
The AI receives a perfectly packaged, minimal context payload. It processes the task instantly, costs pennies instead of dollars, and doesn't hallucinate because it's not distracted by noise.
Demo
π Project Repository: https://github.com/iHaiduk/smarter-faster-better-mcp
Result for AI:
{
"markdown": "[Scout: FOUND]\n---\n## filterMap (src/filter.ts:L9-14)\n```
ts\nexport const filterMap = (map: ProjectMap, query: string): SymbolEntry[] => {\n const keywords = extractKeywords(query)\n return map.symbols.filter((sym) => \n keywords.some((kw) => sym.name.toLowerCase().includes(kw))\n )\n}\n
```\nUsed: src/__tests__/filter.test.ts, src/bin/test-scout.ts",
"structuredContent": {
"symbols": "file|symbol|lines|tier|status\nsrc/filter.ts|filterMap|9-14|mustRead|ok",
"deps": "src/types.ts[37],src/shared/prompts/stop-words.ts[4]",
"confidence": 1.0,
"reason": "deterministic",
"queries": "trace_symbol:ProjectMap,trace_symbol:extractKeywords"
}
}
In the screenshot above, you can see how the MCP server acts as a smart proxy. Instead of dumping whole files into the prompt, it identifies the exact target function and automatically extracts the precise lines of code from dependency files. The result is a clean, structured package sent directly to the LLM.
The Comeback Story
This project was born out of pure frustration with API costs, but for a long time, it was stuck in a "fragile proof-of-concept" state. It worked in ideal conditions but would break instantly in the real world.
Before the Finish-Up-A-Thon, the project had critical flaws:
-
Destructive Cleanup: The cache cleanup procedure was way too aggressive. It could accidentally wipe out
distorbuildfolders, and because it ran in the background on startup, it caused silent system failures. -
Root Directory Crashes: Running the server in a root directory (
/or~) would immediately crash it due to permission errors when trying to index hidden system files. -
Broken MCP Connection: This was a nightmare. When starting via
bunxornpx, thedotenvlibrary would output debug logs (likeβ injected env...) straight tostdout. Since MCP strictly communicates via JSON overstdout, these text strings corrupted the JSON packets and caused instant disconnects in Claude Desktop or Cursor. -
Memory Leaks: If it accidentally hit a
node_modulesfolder, the indexing process would consume gigabytes of RAM and freeze. - Hard Setup: Users had to manually configure environment variables in their IDE configs just to get it running.
I completely overhauled the architecture to transform it from a fragile script into a robust, production-ready tool. Here is how the project evolved:
- Smarter AI Interactions: Instead of letting LLMs lazily rely on slow, blind text searches, I engineered the system to strictly guide them toward structured, AST-driven analysis. This ensures the AI actually "understands" the code structure rather than just matching strings.
- Lightning-Fast Indexing: I completely reworked the file traversal engine to aggressively filter out unnecessary noise right from the start. This transformed the indexing process from a potential memory hog into a near-instantaneous operation.
- Bulletproof Filesystem Handling: I overhauled how the tool interacts with your local environment. It now operates with strict boundaries and smart safeguards, ensuring that background processes never interfere with your source code, build artifacts, or critical system directories.
- Flawless Protocol Communication: A massive amount of work went into sanitizing the data streams. By completely isolating system logs from the strict JSON-based MCP communication channel, the connection is now rock-solid and unbreakable across all major AI clients.
- Production-Grade Developer Experience: I modernized the entire build and delivery pipeline for maximum efficiency and a minimal footprint. Coupled with automated CI/CD pipelines and secure publishing, the tool is now as easy to install as it is powerful to use.
Taking it from a "hacky script that might delete your build folder" to a stable, production-ready developer tool feels amazing.
My Experience with GitHub Copilot
GitHub Copilot was my co-pilot throughout this entire stabilization phase. I didn't just use it for basic autocomplete; I relied on it heavily for code quality control and finding bottlenecks.
When I was rewriting the AST traversal logic or fixing the complex path resolution with tsconfig.json, Copilot helped me spot edge cases I would have missed. It was instrumental in debugging the weird protocol issues and optimizing the TypeScript code to ensure the server remains lightweight and fast. It acted as a true pair programmer, allowing me to focus on the architecture while it handled the heavy lifting of code refinement.


Top comments (0)