docs/repository-detection.md
The repository detection feature automatically identifies whether MCP servers discovered through search_servers are available as npm or PyPI packages. This enhances search results with accurate installation commands and package metadata.
Performance Improvements (v2.0):
npm install or pip install commands when packages are foundcheck_server_repo configuration parameterAdd to your mcp_config.json:
{
"check_server_repo": true,
"listen": ":8080"
}
true (default): Enable repository detection with batch processingfalse: Disable repository detection (faster but no install commands)The batch processor uses these internal settings for optimal performance:
// Configurable constants in internal/experiments/guesser.go
const (
batchRequestTimeout = 3 * time.Second // Timeout per npm request
maxConcurrentRequests = 10 // Max parallel requests
)
Repository detection is enabled by default in new configurations:
{
"listen": ":8080",
"data_dir": "",
"debug_search": false,
"check_server_repo": true,
"mcpServers": [],
"logging": {
"level": "info",
"enable_file": true,
"enable_console": true
}
}
# Basic search with repository detection (uses batch processing)
mcpproxy search-servers --registry pulse --search weather
# Limit results for faster response (batch processing applied to limited set)
mcpproxy search-servers --registry smithery --search database --limit 5
# Search without limit specification (uses default 10, processed in batch)
mcpproxy search-servers --registry mcprun --search api
{
"name": "search_servers",
"arguments": {
"registry": "pulse",
"search": "weather",
"limit": 10
}
}
When repository detection finds packages, results include enhanced information:
[
{
"id": "weather-service",
"name": "Weather MCP Server",
"description": "Provides weather data via MCP",
"url": "https://github.com/user/weather-mcp-server",
"installCmd": "npm install @user/weather-mcp-server",
"repository_info": {
"npm": {
"type": "npm",
"package_name": "@user/weather-mcp-server",
"version": "1.2.3",
"description": "Weather MCP server package",
"install_cmd": "npm install @user/weather-mcp-server",
"url": "https://www.npmjs.com/package/@user/weather-mcp-server",
"exists": true
}
},
"registry": "Example Registry"
}
]
The enhanced repository detection uses a three-phase approach:
GuessRepositoryTypesBatch(): Main batch processing methodapplyBatchRepositoryGuessing(): Merges batch results with server dataMaxIdleConns=100, MaxIdleConnsPerHost=20mcpproxy --log-level=debug --tray=false
tail -f ~/Library/Logs/mcpproxy/main.log | grep -E "(batch repository|concurrent request|npm package)"
Look for log messages like:
Starting batch repository type guessingBatch repository type guessing completedFound npm package in cacheFailed to guess repository type (for debugging failures)check_server_repo: trueNone. The batch processing is a drop-in performance improvement that maintains full API compatibility.
check_server_repo is enabled (adds npm lookup time)@user/repo)If you encounter npm rate limits:
maxConcurrentRequests in code if needed