Heroku MCP Tool Search Server MCP Server

Enables dynamic tool discovery and loading for Claude using search algorithms.

README.md

MCP Tool Search Server

The Problem: When you give Claude 50+ tools, two things break:

  1. Context bloat - Tool definitions eat 10-20K tokens, leaving less room for actual work
  2. 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

  1. You register your tools with this server (via REST API)
  2. Claude gets access to search tools (tool_search_bm25, tool_search_semantic, tool_search_regex)
  3. 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

Tools 4

tool_search_bm25Find tools by keyword matching.
tool_search_semanticFind tools by meaning-based search.
tool_search_regexFind tools by pattern matching.
list_all_toolsList all registered tools.

Environment Variables

INFERENCE_KEYrequiredAPI key for inference model authentication
INFERENCE_URLrequiredBase URL for the inference service

Try it

Search for tools related to weather forecasting.
Find all tools that match the pattern get_.*
I need a tool to send messages, can you find one?
List all tools currently registered in the catalog.

Frequently Asked Questions

What are the key features of Heroku MCP Tool Search Server?

Dynamic tool discovery to prevent context bloat. Supports over 10,000 tools with minimal overhead. Three search methods: BM25, Semantic, and Regex. REST API for registering, listing, and removing tools.

What can I use Heroku MCP Tool Search Server for?

Managing large tool libraries for AI agents without exceeding token limits. Improving tool selection accuracy by loading only relevant tools. Building modular AI agent architectures with dynamic capabilities. Centralizing tool management across multiple AI projects.

How do I install Heroku MCP Tool Search Server?

Install Heroku MCP Tool Search Server by running: heroku create my-tool-search && heroku buildpacks:set heroku/python && git push heroku main

What MCP clients work with Heroku MCP Tool Search Server?

Heroku MCP Tool Search Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Heroku MCP Tool Search Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Open Conare