docs/features/search-discovery.md
MCPProxy provides intelligent tool discovery using BM25 full-text search across all connected MCP servers.
When you have multiple MCP servers with dozens or hundreds of tools, finding the right tool becomes challenging. MCPProxy indexes all tools and provides fast, relevant search results.
MCPProxy uses BM25 (Best Matching 25) ranking:
Use the retrieve_tools built-in tool:
{
"query": "create github issue",
"limit": 5
}
Response:
{
"tools": [
{
"name": "github:create_issue",
"server": "github-server",
"description": "Create a new issue in a GitHub repository",
"score": 0.89
},
{
"name": "gitlab:create_issue",
"server": "gitlab-server",
"description": "Create an issue in GitLab",
"score": 0.72
}
]
}
curl -H "X-API-Key: your-key" \
"http://127.0.0.1:8080/api/v1/tools?q=create%20file&limit=10"
{
"tools_limit": 15
}
| Option | Type | Default | Description |
|---|---|---|---|
tools_limit | integer | 15 | Maximum results per query |
The search index is stored at:
~/.mcpproxy/index.bleve/
| Query | Finds |
|---|---|
create file | Tools for creating files |
github issue | GitHub-specific issue tools |
read json | Tools that read JSON data |
sql query database | Database query tools |
"create issue")github:create)If the search index becomes corrupted or out of sync:
# Stop MCPProxy
pkill mcpproxy
# Remove index
rm -rf ~/.mcpproxy/index.bleve
# Restart - index rebuilds automatically
mcpproxy serve
Check index status:
mcpproxy doctor
# Shows indexed tool count
MCPProxy supports the MCP notifications/tools/list_changed notification protocol. When an upstream MCP server updates its available tools (adds, removes, or modifies), it can send a notification to trigger automatic re-indexing:
capabilities.tools.listChanged: true send notifications when their tools changeDiscoverAndIndexToolsForServer() within secondsFor servers that don't support tool change notifications:
mcpproxy upstream restartWhen notifications are received:
INFO: "Received tools/list_changed notification from server: {name}"DEBUG: "Server supports tool change notifications - registered handler"DEBUG: "Tool discovery triggered by notification"Verify servers are connected:
mcpproxy upstream list
Check tool count:
mcpproxy tools list
Rebuild index if needed
If search results don't reflect current tools:
Restart the problematic server:
mcpproxy upstream restart server-name
Wait for re-indexing (check logs)
# Remove and rebuild
rm -rf ~/.mcpproxy/index.bleve
mcpproxy serve
AI clients typically use MCPProxy's search in two ways:
retrieve_tools to find relevant toolsThe tools_limit setting controls how many tools are suggested to the AI, balancing between: