
Security News
Opengrep Adds Apex Support and New Rule Controls in Latest Updates
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
@xiaohui-wang/mcpadvisor
Advanced tools
MCP Advisor & Installation - Find the right MCP server for your needs
MCP Advisor is a discovery & recommendation service that helps AI assistants explore Model Context Protocol (MCP) servers using natural language queries. It makes it easier to find and utilize the right MCP tools for specific tasks.
The fastest way to integrate MCP Advisor with your AI assistant is through the MCP configuration:
{
"mcpServers": {
"mcpadvisor": {
"command": "npx",
"args": ["-y", "@xiaohui-wang/mcpadvisor"]
}
}
}
Add this configuration to your AI assistant's MCP settings file:
~/Library/Application Support/Claude/claude_desktop_config.json
%AppData%\Claude\claude_desktop_config.json
npm install @xiaohui-wang/mcpadvisor
# or
yarn add @xiaohui-wang/mcpadvisor
# or
pnpm add @xiaohui-wang/mcpadvisor
# Run with npx
npx @xiaohui-wang/mcpadvisor
# Or if installed globally
mcpadvisor
MCP Advisor follows a modular architecture with clean separation of concerns and functional programming principles:
graph TD
Client["Client Application"] --> |"MCP Protocol"| Transport["Transport Layer"]
subgraph "MCP Advisor Server"
Transport --> |"Request"| SearchService["Search Service"]
SearchService --> |"Query"| Providers["Search Providers"]
subgraph "Search Providers"
Providers --> MeilisearchProvider["Meilisearch Provider"]
Providers --> GetMcpProvider["GetMCP Provider"]
Providers --> CompassProvider["Compass Provider"]
Providers --> OfflineProvider["Offline Provider"]
end
OfflineProvider --> |"Hybrid Search"| HybridSearch["Hybrid Search Engine"]
HybridSearch --> TextMatching["Text Matching"]
HybridSearch --> VectorSearch["Vector Search"]
MeilisearchProvider --> |"API Call"| MeilisearchAPI["Meilisearch API"]
GetMcpProvider --> |"API Call"| GetMcpAPI["GetMCP API"]
CompassProvider --> |"API Call"| CompassAPI["Compass API"]
SearchService --> |"Merge & Filter"| ResultProcessor["Result Processor"]
ResultProcessor --> |"Prioritize"| PriorityEngine["Provider Priority Engine"]
ResultProcessor --> |"Deduplicate"| Deduplicator["Result Deduplicator"]
ResultProcessor --> |"Filter"| SimilarityFilter["Similarity Filter"]
SearchService --> Logger["Logging System"]
end
GetMcpAPI --> |"Data"| ExternalMCPRegistry[("External MCP Registry")]
CompassAPI --> |"Data"| ExternalMCPRegistry
MeilisearchAPI --> |"Data"| MeilisearchDB[("Meilisearch DB")]
flowchart LR
Query["User Query"] --> Embedding["Embedding Generation"]
Query --> KeywordExtraction["Keyword Extraction"]
subgraph "Search Process"
Embedding --> VectorSearch["Vector Search"]
KeywordExtraction --> TextSearch["Text Search"]
VectorSearch --> |"Similarity Scores"| ResultMerging
TextSearch --> |"Match Scores"| ResultMerging["Result Merging"]
ResultMerging --> |"Combined Results"| Deduplication["Deduplication"]
Deduplication --> |"Unique Results"| Prioritization["Provider Prioritization"]
Prioritization --> |"Prioritized Results"| SimilarityFiltering["Similarity Filtering"]
SimilarityFiltering --> |"Filtered Results"| Limiting["Result Limiting"]
end
Limiting --> |"Final Results"| Response["Response to User"]
graph TD
Query["User Query"] --> Analysis["Query Analysis"]
Analysis --> |"Contains Keywords"| TextBias["Text-Biased Search"]
Analysis --> |"Semantic Query"| VectorBias["Vector-Biased Search"]
TextBias --> |"textMatchWeight: 0.7"| HybridSearch1["Hybrid Search Engine"]
VectorBias --> |"textMatchWeight: 0.3"| HybridSearch2["Hybrid Search Engine"]
subgraph "Hybrid Search Process"
HybridSearch1 & HybridSearch2 --> |"Parallel Execution"| Providers["Multiple Providers"]
Providers --> |"Raw Results"| Merging["Smart Merging"]
Merging --> |"Provider Priority"| Prioritization["Priority-Based Selection"]
Prioritization --> |"Unique Results"| Filtering["Adaptive Filtering"]
end
Filtering --> |"minSimilarity: 0.5"| FinalResults["Final Results"]
Filtering --> |"Fallback"| TopResults["Top 5 Results"]
Providers->>ExternalAPIs: API Requests
ExternalAPIs->>Providers: API Responses
Providers->>SearchSvc: All Provider Results
SearchSvc->>SearchSvc: Merge & Deduplicate Results
SearchSvc->>SearchSvc: Sort & Filter Results
SearchSvc->>Logger: Log Search Results
SearchSvc->>Client: Final Results
#### Core Components
1. **Search Service Layer**
- Unified search interface with provider aggregation
- Multiple search provider support with parallel execution
- Configurable search options (limit, minSimilarity)
- Intelligent result merging and deduplication
- Provider priority system for result ranking
- Adaptive similarity filtering with fallback mechanism
2. **Search Providers**
- **Meilisearch Provider**: Vector-based search using Meilisearch
- **GetMCP Provider**: API-based search from GetMCP registry
- **Compass Provider**: API-based search from Compass registry
- **Offline Provider**: Hybrid search combining text and vector matching
3. **Hybrid Search Strategy**
- **Text Matching**: Keyword-based search with exact and fuzzy matching
- **Vector Search**: Semantic similarity using embedding vectors
- **Configurable Weights**: Adjustable balance between text and vector search
- **Smart Fallback**: Ensures minimum result count even with high similarity thresholds
4. **Result Processing Pipeline**
- **Merging**: Combines results from multiple providers
- **Deduplication**: Removes duplicate results based on GitHub URL or title
- **Provider Prioritization**: Ranks results based on provider reliability
- **Similarity Filtering**: Filters results based on configurable threshold
- **Adaptive Fallback**: Ensures minimum result count for better user experience
5. **Vector Database Layer**
- Time-based data update strategy (1-hour freshness)
- Efficient vector indexing with HNSW
- Automatic schema management
- Connection pooling for performance
6. **Data Management**
- Intelligent caching with timestamp tracking
- Incremental updates to minimize resource usage
- Background data refresh to maintain responsiveness
- Comprehensive error handling and fallbacks
5. **Transport Layer**
- Stdio (default for CLI)
- SSE (for web integration)
- REST API endpoints
6. **Logging System**
- Structured logging with context information
- Detailed process tracking for debugging
- Performance metrics and timing
- Clean separation of console and file outputs
## System Optimizations
### Enhanced Error Handling System
MCP Advisor implements a robust error handling system to ensure reliability and provide detailed diagnostics:
#### Error Handling Flow Diagram
```mermaid
graph TD
Operation["Operation Execution"] --> |"Try"| Success{"Success?"}
Success -->|"Yes"| Result["Return Result"]
Success -->|"No"| ErrorType{"Error Type?"}
ErrorType -->|"Network Error"| NetworkHandler["Network Error Handler"]
ErrorType -->|"Database Error"| DBHandler["Database Error Handler"]
ErrorType -->|"Validation Error"| ValidationHandler["Validation Error Handler"]
ErrorType -->|"Unknown Error"| GenericHandler["Generic Error Handler"]
NetworkHandler --> FormatError["Format Error with Context"]
DBHandler --> FormatError
ValidationHandler --> FormatError
GenericHandler --> FormatError
FormatError --> LogError["Log Structured Error"]
LogError --> Fallback{"Fallback Available?"}
Fallback -->|"Yes"| FallbackOperation["Execute Fallback"]
Fallback -->|"No"| PropagateError["Propagate Error"]
FallbackOperation --> Result
PropagateError --> ClientError["Return Error to Client"]
Contextual Error Formatting
Structured Logging
Provider-Specific Error Handling
Graceful Degradation
MCP Advisor implements an intelligent data update strategy to balance performance and data freshness:
Timestamp Tracking
Conditional Indexing
Background Processing
Fallback Mechanisms
The enhanced logging system provides detailed visibility into system operations:
Context-Aware Logs
Performance Tracking
Process Visualization
MCP Advisor implements vector normalization to improve search accuracy and consistency:
graph LR
Input["Input Vector"] --> Normalize["Normalize Vector"]
Normalize --> |"Unit Vector"| Store["Store in Database"]
Query["Query Vector"] --> NormalizeQuery["Normalize Query Vector"]
NormalizeQuery --> |"Unit Vector"| Search["Search Database"]
Store --> |"Indexed Vectors"| Search
Search --> |"Cosine Similarity"| Results["Search Results"]
Vector Normalization Process
Implementation Details
MCP Advisor combines vector similarity and text matching for more accurate results:
graph TD
Query["User Query"] --> |"Text"| TextSearch["Metadata Text Search"]
Query --> |"Embedding"| VectorSearch["Vector Similarity Search"]
TextSearch --> |"Text Results"| Merge["Merge Results"]
VectorSearch --> |"Vector Results"| Merge
Merge --> |"Combined Ranking"| Filter["Apply Filters"]
Filter --> |"Category/Tag Filtering"| Sort["Sort by Final Score"]
Sort --> Results["Final Results"]
Parallel Search Execution
Weighted Result Merging
Advanced Filtering
npm install
# Required for vector search
OCEANBASE_URL=mysql://your_connection_string
# Optional for SSE transport
TRANSPORT_TYPE=sse
SERVER_PORT=3000
ENABLE_FILE_LOGGING=true
import { SearchService } from '@xiaohui-wang/mcpadvisor';
// Initialize the search service
const searchService = new SearchService();
// Search for MCP servers
const results = await searchService.search('vector database integration');
console.log(results);
Ideal for command-line tools and direct integrations:
// index.js
const { createServer } = require('@xiaohui-wang/mcpadvisor');
const server = createServer({ transport: 'stdio' });
server.start();
For web-based integrations:
// server.js
const { createServer } = require('@xiaohui-wang/mcpadvisor');
const server = createServer({
transport: 'sse',
port: 3000
});
server.start();
Follow the commit message convention:
Ensure code quality:
npm test
npm run type-check
npm run lint
Submit a pull request with:
class SearchService {
constructor(options?: SearchOptions);
search(query: string): Promise<SearchResult[]>;
}
interface SearchOptions {
limit?: number;
minSimilarity?: number;
}
interface SearchResult {
id: string;
name: string;
description: string;
similarity: number;
}
interface ServerConfig {
transport: 'stdio' | 'sse';
port?: number; // Required for SSE
enableFileLogging?: boolean;
}
OCEANBASE_URL
: Connection string for OceanBase vector databaseTRANSPORT_TYPE
: Transport method (stdio
or sse
, default: stdio
)SERVER_PORT
: HTTP server port (default: 3000)SERVER_HOST
: HTTP server host (default: localhost)SSE_PATH
: SSE endpoint path (default: /sse)MESSAGE_PATH
: Messages endpoint path (default: /messages)ENABLE_FILE_LOGGING
: Enable file logging (default: false)This project is licensed under the MIT License - see the LICENSE file for details.
Connect to the server using:
http://localhost:3000/sse
http://localhost:3000/messages?sessionId=<SESSION_ID>
http://localhost:3000/health
TRANSPORT_TYPE=rest SERVER_PORT=3000 ENABLE_FILE_LOGGING=true node build/index.js
Here are some example queries you can use with MCP Advisor:
"Find an MCP server for natural language processing"
"MCP server for financial data analysis"
"Recommendation engine MCP server for e-commerce"
"MCP server with image recognition capabilities"
"Weather data processing MCP server"
"Document summarization MCP server"
[
{
"title": "NLP Toolkit",
"description": "Comprehensive natural language processing toolkit with sentiment analysis, entity recognition, and text summarization capabilities.",
"github_url": "https://github.com/example/nlp-toolkit",
"similarity": 0.92
},
{
"title": "Text Processor",
"description": "Efficient text processing MCP server with multilingual support.",
"github_url": "https://github.com/example/text-processor",
"similarity": 0.85
}
]
Connection Refused
No Results Returned
SSE Connection Drops
Performance Issues
For detailed troubleshooting, check the logs in the logs
directory. Enable debug logging with:
DEBUG=true node build/index.js
MCP Advisor can be configured using the following environment variables:
Variable | Description | Default | Required |
---|---|---|---|
TRANSPORT_TYPE | Transport method (stdio , sse , rest ) | stdio | No |
SERVER_PORT | HTTP server port for SSE/REST transport | 3000 | No |
SERVER_HOST | HTTP server host for SSE/REST transport | localhost | No |
SSE_PATH | SSE endpoint path | /sse | No |
MESSAGE_PATH | Messages endpoint path | /messages | No |
ENDPOINT | REST endpoint path | /rest | No |
DEBUG | Enable debug logging | false | No |
ENABLE_FILE_LOGGING | Enable logging to files | false | No |
LOG_LEVEL | Log level (debug, info, warn, error) | info | No |
ENABLE_MEILISEARCH_TESTS | Enable Meilisearch tests | false | No |
VECTOR_ENGINE_TYPE | Vector engine type (memory , oceanbase , meilisearch ) | memory | No |
MCP Advisor supports multiple search providers that can be used simultaneously:
Uses the Compass API to retrieve MCP server information.
Uses the GetMCP API and vector search for semantic matching.
Uses Meilisearch for fast, typo-tolerant text search.
Meilisearch integration can be configured in src/config/meilisearch.ts
:
export const MEILISEARCH_CONFIG = {
host: 'https://ms-1c8c8f2b0bc7-1.lon.meilisearch.io',
apiKey: '', // API key with read permissions
indexName: 'mcp_server_info_from_getmcp_io'
};
/health
Health check endpoint.
Response:
{
"status": "ok",
"version": "1.0.0"
}
/sse
Server-Sent Events endpoint for establishing a connection.
Query Parameters:
Response:
/messages
Endpoint for sending messages to an established SSE connection.
Query Parameters:
sessionId
(string, required): The session ID of the SSE connectionRequest Body:
{
"jsonrpc": "2.0",
"method": "callTool",
"params": {
"name": "recommend-mcp-servers",
"arguments": {
"query": "financial data analysis"
}
},
"id": "1"
}
Response:
{
"jsonrpc": "2.0",
"result": {
"content": [
{
"title": "Financial Analytics MCP",
"description": "Comprehensive financial data analysis toolkit",
"github_url": "https://github.com/example/financial-mcp",
"similarity": 0.95
}
]
},
"id": "1"
}
/rest
REST API endpoint for direct requests (when using REST transport).
Request Body:
{
"jsonrpc": "2.0",
"method": "callTool",
"params": {
"name": "recommend-mcp-servers",
"arguments": {
"query": "financial data analysis"
}
},
"id": "1"
}
Response:
Same as /messages
endpoint.
with inspector
npx @modelcontextprotocol/inspector
MIT License - See LICENSE file for details.
FAQs
MCP Advisor & Installation - Find the right MCP server for your needs
The npm package @xiaohui-wang/mcpadvisor receives a total of 548 weekly downloads. As such, @xiaohui-wang/mcpadvisor popularity was classified as not popular.
We found that @xiaohui-wang/mcpadvisor demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.