MCP Discovery Server

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%.

Category
访问服务器

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

  1. Install dependencies:
pip install fastmcp pydantic httpx
  1. Add to Claude Desktop config:
{
  "mcpServers": {
    "mcp-discovery": {
      "command": "python",
      "args": ["C:/github/mcps/mcp-discovery-server/server.py"]
    }
  }
}
  1. 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:

  1. Add MCP to Claude Desktop config
  2. Restart Claude Desktop
  3. Discovery server automatically detects it

To add custom categories:

  1. Edit _load_mcp_registry() in server.py
  2. Add category detection logic
  3. 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

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选