MCP Discovery Server
A meta-MCP server that discovers and explores other MCP servers using progressive disclosure patterns to reduce token usage by up to 99%.
README
MCP Discovery Server
A meta-MCP for discovering and exploring other MCPs using progressive disclosure patterns to reduce token usage.
Overview
The MCP Discovery Server helps you:
- Discover available MCPs without loading all schemas upfront
- Search for MCPs by keyword or category
- Load detailed schemas on-demand (progressive disclosure)
- Reduce token usage by 95%+ through intelligent caching
Features
Progressive Disclosure
Load only what you need:
- Minimal: Just MCP names (50-100 bytes)
- Brief: Names + key metadata (500-1000 bytes)
- Full: Complete schemas (2000-5000 bytes)
Resource-Based Access
- MCP metadata via
mcp-discovery://mcp/{name}/info - Tool lists via
mcp-discovery://mcp/{name}/tools - 5-minute cache TTL for fast repeat access
Smart Search
- Keyword-based search
- Category filtering
- Relevance scoring
- Fast results (<100ms)
Installation
Prerequisites
- Python 3.8+
- FastMCP library
Setup
- Install dependencies:
pip install fastmcp pydantic httpx
- Add to Claude Desktop config:
{
"mcpServers": {
"mcp-discovery": {
"command": "python",
"args": ["C:/github/mcps/mcp-discovery-server/server.py"]
}
}
}
- Restart Claude Desktop
Usage
Tool 1: List MCPs
Get a list of all available MCPs with configurable detail.
Minimal (Best for initial discovery)
# Returns: ["webscrape", "midi-converter", "drawio"]
list_mcps({
"detail_level": "minimal"
})
Brief (Balanced detail)
# Returns: [{"name": "webscrape", "language": "python", "categories": ["web"]}, ...]
list_mcps({
"detail_level": "brief"
})
Full (Complete schemas)
# Returns: Full MCP schemas with all metadata
list_mcps({
"detail_level": "full",
"category": "web" # Optional filter
})
Tool 2: Search MCPs
Find MCPs by keyword with relevance scoring.
# Search by keyword
search_mcps({
"query": "web scraping"
})
# Search with category filter
search_mcps({
"query": "audio",
"category": "audio",
"detail_level": "brief"
})
Tool 3: Get MCP Schema
Load full schema for a specific MCP.
# Get MCP schema
get_mcp_schema({
"mcp_name": "webscrape"
})
# Get tool-specific schema
get_mcp_schema({
"mcp_name": "webscrape",
"tool_name": "scrape_url"
})
Token Savings
Before (Traditional Approach)
Load all MCP schemas upfront: ~150KB
Execute operation: ~25KB
Total: ~175KB per interaction
After (Progressive Disclosure)
List MCPs (minimal): ~50 bytes
Search for relevant MCP: ~200 bytes
Load specific schema: ~800 bytes
Execute operation: ~500 bytes
Total: ~1.5KB per interaction
Savings: 99.1%!
Progressive Disclosure Workflow
1. Discovery Phase
├─ list_mcps("minimal") → ["webscrape", "midi-converter", ...]
└─ Token usage: ~50 bytes
2. Search Phase (optional)
├─ search_mcps(query="web") → [{webscrape details}]
└─ Token usage: ~200 bytes
3. Schema Loading Phase
├─ get_mcp_schema(mcp_name="webscrape") → {full schema}
└─ Token usage: ~800 bytes
4. Execution Phase
└─ Use loaded schema to call actual MCP tools
Total: ~1KB vs ~150KB (99.3% savings)
Resource URIs
Access MCP metadata directly via resources:
mcp-discovery://mcp/{name}/info
→ Get MCP metadata
mcp-discovery://mcp/{name}/tools
→ Get list of tools (if available)
Categories
MCPs are automatically categorized:
- web: Web scraping, crawling, extraction
- audio: MIDI, music, audio processing
- diagrams: Draw.io, flowcharts, visualizations
- meta: Discovery, helper tools
Caching
- Cache TTL: 5 minutes (configurable)
- Automatic cleanup: Expired entries removed automatically
- Performance: 100x+ faster for repeated queries
TypeScript Definitions
Progressive disclosure for type-safe tool loading:
// Load only what you need
import { ListMCPsParams } from './tools/list_mcps';
import { SearchMCPsParams } from './tools/search_mcps';
import { GetMCPSchemaParams } from './tools/get_schema';
Testing
Run the test suite:
python tests/test_server.py
Expected output:
========================================================
MCP DISCOVERY SERVER - TEST SUITE
========================================================
[Test 1] Loading MCP registry...
✓ Found 3 MCPs
[Test 2] List MCPs (minimal)...
✓ Returned 3 MCP names
[Test 9] Progressive disclosure token savings...
✓ Progressive disclosure working:
Minimal: 47 bytes
Full: 2847 bytes
Savings: 98.3%
Total: 10 | Passed: 10 | Failed: 0
Success Rate: 100.0%
Architecture
┌─────────────────────────────────────────┐
│ MCP Discovery Server │
├─────────────────────────────────────────┤
│ │
│ [Discovery Tools] │
│ ├─ list_mcps() - List all MCPs │
│ ├─ search_mcps() - Search by keyword │
│ └─ get_mcp_schema() - Load full schema │
│ │
│ [Resource Layer] │
│ ├─ mcp://{name}/info - MCP metadata │
│ └─ mcp://{name}/tools - Tool list │
│ │
│ [Cache Layer] │
│ ├─ 5-minute TTL │
│ ├─ Automatic cleanup │
│ └─ Fast repeat access │
│ │
│ [Config Reader] │
│ └─ Claude Desktop config integration │
│ │
└─────────────────────────────────────────┘
Examples
Example 1: Find Web-Related MCPs
# Step 1: Search for web MCPs
result = search_mcps({
"query": "web",
"detail_level": "brief"
})
# Returns:
{
"success": true,
"count": 1,
"results": [
{
"name": "webscrape",
"language": "python",
"categories": ["web"],
"relevance_score": 10
}
]
}
# Step 2: Get full schema
schema = get_mcp_schema({"mcp_name": "webscrape"})
# Now use webscrape tools with full knowledge
Example 2: Discover Audio Capabilities
# List all audio MCPs
audio_mcps = list_mcps({
"detail_level": "brief",
"category": "audio"
})
# Returns:
[
{
"name": "midi-converter",
"language": "python",
"categories": ["audio"]
}
]
Example 3: Explore All Tools
# Get minimal list
mcps = list_mcps({"detail_level": "minimal"})
# ["webscrape", "midi-converter", "drawio"]
# For each MCP, get tools
for mcp in mcps:
tools = get_resource(f"mcp-discovery://mcp/{mcp}/tools")
# Returns list of available tools
Performance Benchmarks
| Operation | Time | Token Usage |
|---|---|---|
| list_mcps (minimal) | <10ms | 50 bytes |
| list_mcps (brief) | <20ms | 500 bytes |
| list_mcps (full) | <50ms | 2500 bytes |
| search_mcps | <30ms | 300 bytes |
| get_mcp_schema | <20ms | 800 bytes |
| Resource access (cached) | <5ms | 0 bytes |
Contributing
To add a new MCP to the registry:
- Add MCP to Claude Desktop config
- Restart Claude Desktop
- Discovery server automatically detects it
To add custom categories:
- Edit
_load_mcp_registry()inserver.py - Add category detection logic
- Restart server
Troubleshooting
MCPs not showing up
- Check Claude Desktop config file location
- Verify JSON syntax in config
- Restart Claude Desktop
Slow performance
- Check cache TTL settings
- Verify network connectivity
- Monitor cache cleanup frequency
Missing categories
- Categories are auto-detected from MCP names
- Add custom logic in
_load_mcp_registry()
Future Enhancements
- [ ] Persistent cache (Redis)
- [ ] Real-time MCP health monitoring
- [ ] Tool usage statistics
- [ ] Fuzzy search with ranking
- [ ] Tool dependency detection
- [ ] Auto-generate tool documentation
License
MIT
Credits
Created following Anthropic's MCP progressive disclosure patterns. Based on guidelines from https://www.anthropic.com/engineering/code-execution-with-mcp
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.