Skip to main content
Glama

recommend_mcp

Find suitable MCP servers for your development tasks by describing your functional needs in natural language, with filtering options for category and programming language.

Instructions

Recommend MCP servers based on your development needs.

Args: query: Description of the functionality you need (e.g., "database operations", "web scraping", "file management") limit: Maximum number of recommendations to return (default: 5) category: Filter by specific category (optional) language: Filter by programming language (optional)

Returns: Formatted markdown string with MCP recommendations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNo
languageNo
limitNo
queryYes

Implementation Reference

  • The handler function for the 'recommend_mcp' MCP tool. Decorated with @mcp.tool() for automatic registration. Handles input validation, calls the recommender's search logic, and formats the output as Markdown.
    @mcp.tool() def recommend_mcp( query: str, limit: int = 5, category: str = None, language: str = None ) -> str: """ Recommend MCP servers based on your development needs. Args: query: Description of the functionality you need (e.g., "database operations", "web scraping", "file management") limit: Maximum number of recommendations to return (default: 5) category: Filter by specific category (optional) language: Filter by programming language (optional) Returns: Formatted markdown string with MCP recommendations """ try: # Validate inputs if not query or not query.strip(): return "### Error\nPlease provide a query describing what functionality you need." if limit < 1 or limit > 20: limit = 5 # Search for recommendations scored_mcps = recommender.search_mcps( query=query.strip(), limit=limit, category=category, language=language ) # Format and return results return recommender.format_recommendations(scored_mcps, query) except Exception as e: return f"### Error\nAn error occurred while searching for recommendations: {str(e)}"
  • The @mcp.tool() decorator registers the recommend_mcp function as an MCP tool with the name matching the function name.
    @mcp.tool()
  • Input schema defined by type annotations and docstring parameters for query (str, required), limit (int, default 5), category (str, optional), language (str, optional), with str output.
    query: str, limit: int = 5, category: str = None, language: str = None ) -> str: """ Recommend MCP servers based on your development needs. Args: query: Description of the functionality you need (e.g., "database operations", "web scraping", "file management") limit: Maximum number of recommendations to return (default: 5) category: Filter by specific category (optional) language: Filter by programming language (optional) Returns: Formatted markdown string with MCP recommendations """
  • Core search logic used by the recommend_mcp handler, implementing query expansion, scoring, filtering, and sorting of MCP recommendations.
    def search_mcps(self, query: str, limit: int = 5, category: Optional[str] = None, language: Optional[str] = None) -> List[Tuple[Dict, int]]: """Search for MCPs based on query and return scored results.""" # Filter MCPs first filtered_mcps = self.filter_mcps(category, language) # Expand query with functional keywords search_terms = self.expand_query_with_keywords(query) # Calculate scores for each MCP scored_mcps = [] for mcp in filtered_mcps: score = self.calculate_relevance_score(mcp, search_terms) if score > 0: # Only include MCPs with some relevance scored_mcps.append((mcp, score)) # Sort by score (descending) and limit results scored_mcps.sort(key=lambda x: x[1], reverse=True) return scored_mcps[:limit]

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bxzymy/mcp-recommend'

If you have feedback or need assistance with the MCP directory API, please join our Discord server