Heroku MCP Tool Search Server
Enables dynamic tool discovery and loading for Claude using BM25, regex, and semantic search algorithms. It supports managing a catalog of over 10,000 tools with minimal context overhead and provides a REST API for tool management.
README
MCP Tool Search Server
The Problem: When you give Claude 50+ tools, two things break:
- Context bloat - Tool definitions eat 10-20K tokens, leaving less room for actual work
- Selection accuracy - Claude gets confused and picks wrong tools when there are too many
The Solution: Instead of loading all tools upfront, Claude searches for tools and loads only what it needs.
Without Tool Search: With Tool Search:
┌─────────────────────┐ ┌─────────────────────┐
│ Load 100 tools │ │ Load 1 search tool │
│ (20K tokens) │ │ (200 tokens) │
│ │ │ │
│ Claude picks wrong │ │ Claude searches: │
│ tool 30% of time │ │ "weather" → 2 tools │
│ │ │ │
│ Context nearly full │ │ 95% context free │
└─────────────────────┘ └─────────────────────┘
How It Works
- You register your tools with this server (via REST API)
- Claude gets access to search tools (
tool_search_bm25,tool_search_semantic,tool_search_regex) - When Claude needs a tool, it searches → gets back tool names → uses them
Three search methods:
- BM25 - Keyword matching ("weather" finds
get_weather,get_forecast) - Semantic - Meaning-based ("send a message" finds
send_email) - Regex - Pattern matching (
get_.*finds all getter tools)
Deploy to Heroku
Or manually:
heroku create my-tool-search
heroku buildpacks:set heroku/python
git push heroku main
heroku ai:models:create claude-4-sonnet --as INFERENCE
Register Your Tools
curl -X POST https://your-app.herokuapp.com/tools \
-H "Content-Type: application/json" \
-d '{
"name": "get_weather",
"description": "Get current weather for a location",
"input_schema": {
"type": "object",
"properties": {"location": {"type": "string"}},
"required": ["location"]
}
}'
Test It
export INFERENCE_KEY=$(heroku config:get INFERENCE_KEY -a my-tool-search)
export INFERENCE_URL=$(heroku config:get INFERENCE_URL -a my-tool-search)
curl -s "$INFERENCE_URL/v1/agents/heroku" \
-H "Authorization: Bearer $INFERENCE_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-4-sonnet",
"messages": [{"role": "user", "content": "Find tools for checking weather"}],
"tools": [{"type": "mcp", "name": "mcp-tool-search/tool_search_semantic"}]
}'
API Reference
| Endpoint | Description |
|---|---|
POST /tools |
Register a tool |
GET /tools |
List all tools |
DELETE /tools/{name} |
Remove a tool |
GET /health |
Health check |
MCP Tools
| Tool | Use Case |
|---|---|
tool_search_bm25 |
Find tools by keywords |
tool_search_semantic |
Find tools by meaning |
tool_search_regex |
Find tools by pattern |
list_all_tools |
List all registered tools |
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.