A smart router that helps users discover the most relevant tools
MCP Finder: My Personal Tool Router
I built this project to solve a simple problem: I have too many MCP tools and I don't know which one to use.
Instead of manually searching through documentation or guessing which server has the right tool, I created this "router". I just ask it a question in plain English, and it tells me exactly which tool to use.
How It Works
When I ask a question like "Scan my docker images for security issues", here is what happens behind the scenes:
- Intent Analysis: First, the system looks at my query to understand what I want. It checks if I'm asking for something "local", "free", or if I need a specific type of tool (like "security" or "database").
- Search: It searches my catalog (
mcpfinder.sqlite) using two methods:- Keywords: Matches words in my query to tool descriptions.
- Meaning (Embeddings): Matches the concept of my query to tools (so "picture" matches "image").
- Scoring: It gives every tool a score based on how well it matches. It even gives a bonus to tools that work best with my current editor (like Cursor).
- AI Reranking: Finally, it sends the top candidates to a small AI model (GPT-4o-mini). The AI looks at them like a human would, picks the best one, and explains why.
The Data Flow
I keep it simple. My data lives in a CSV file, and the app reads from a fast SQLite database.
- Source of Truth:
db.csv- This is where I manually add or edit tools. It's just a spreadsheet.
- The Database:
mcpfinder.sqlite- The app doesn't read the CSV directly (it's too slow). Instead, I load the data into this SQLite database.
- The file
mcp_suggester/load_mcp_csv_to_sqlite.pyhandles this conversion.
How I Set It Up
1. Prerequisites
I need Python installed. Then I install the dependencies:
pip install -r requirements.txt
2. Environment Variables
I need to tell the app where my database is and give it an OpenAI key (for the "smart" parts like understanding meaning and reranking).
$env:MCP_CATALOG_DB = ""
$env:OPENAI_API_KEY = "sk-..."
3. Running It
I can run the server directly to test it:
python -m mcp_suggester.server
4. Using the Web UI (Optional)
If you want a visual interface to test queries, you can use the Streamlit app:
streamlit run ui_app.py
This opens a browser window where you can:
- Type your query in a text box
- Adjust settings with sliders (number of results, candidate pool size)
- See the results with nice formatting, reasoning, and copy-pasteable examples
No need to run the server separately—the UI app calls the logic directly.
Using It in Cursor
This is the best part. I connect this "router" to Cursor so I can use it while I code.
- Open Cursor Settings > MCP.
- Add a new MCP server:
- Type:
command - Command:
python - Args:
-m mcp_suggester.server - Env: Add my
PYTHONPATH,MCP_CATALOG_DB, andOPENAI_API_KEY.
- Type:
Now, in Cursor Chat, I just type:
"Find a tool to deploy this app to Kubernetes"
And it responds with the exact tool I need (e.g., Helm -> deploy_application).
Project Structure
mcp_suggester/: The core logic.server.py: The entry point that Cursor talks to.scoring.py: The math that ranks tools.intent.py: The logic that figures out what I want.
db.csv: My list of tools.mcpfinder.sqlite: The database the app actually reads.
How I Measure Quality
I don't just guess if the search is working. I have a test suite in the evaluation/ folder to prove it.
eval_dataset.csv: This is my "exam" for the system. It contains 27 real-world questions (like "Find a tool to deploy to Kubernetes") and the exact tool that should be the top answer.evaluate.py: This script runs those questions through three different strategies to see which one wins.
The Results
When I run the benchmark (python evaluation/evaluate.py), here is what I typically see:
- Keyword Search Only: ~60% accuracy.
- It fails when I use different words than the tool description (e.g., asking for "pictures" when the tool says "images").
- Hybrid Search (Keywords + Meaning): ~55-60% accuracy.
- Better at understanding concepts, but sometimes gets confused by similar tools.
- Hybrid + AI Reranking: ~70%+ accuracy.
- This is why the LLM is essential. It closes the gap by "thinking" about the results.
What the AI Actually Does
You might wonder, "Why do I need an LLM? Can't I just search?"
When the system finds 20 possible tools, it sends the top 3-5 to the LLM (GPT-4o-mini) with a very specific prompt. The LLM is not just summarizing. It is acting as a judge.
Here is exactly what it does for every single query:
- It Reads the Documentation: It looks at the tool's description, arguments,
Tools (1)
find_toolSearches and reranks tools from the catalog based on a natural language query.Environment Variables
MCP_CATALOG_DBrequiredPath to the SQLite database containing the tool catalog.OPENAI_API_KEYrequiredAPI key for OpenAI to perform intent analysis and AI reranking.Configuration
{"mcpServers": {"mcp-finder": {"command": "python", "args": ["-m", "mcp_suggester.server"], "env": {"MCP_CATALOG_DB": "/path/to/mcpfinder.sqlite", "OPENAI_API_KEY": "sk-..."}}}}