Skip to main content
Glama

search_mcp_docs

Search official MCP protocol and FastMCP framework documentation to find relevant information for building MCP servers. Enter a query to get ranked results with URLs, titles, and content previews.

Instructions

Search MCP protocol and FastMCP documentation with ranked results.

This tool provides access to comprehensive MCP documentation including:

MCP Protocol:

  • Architecture and core concepts

  • Transports (stdio, streamable HTTP)

  • Tools, Resources, and Prompts

  • Lifecycle and capabilities negotiation

  • Error handling and security

FastMCP Framework:

  • Python server patterns and decorators

  • Tool definitions with type hints

  • Resource and prompt templates

  • Client integration examples

Use this to find relevant MCP documentation for building MCP servers.

Args: query: Search query string (e.g., "tool input schema", "stdio transport") k: Maximum number of results to return (default: 5)

Returns: List of dictionaries containing: - url: Document URL - title: Display title - score: Relevance score (higher is better) - snippet: Contextual content preview

Input Schema

NameRequiredDescriptionDefault
queryYes
kNo

Input Schema (JSON Schema)

{ "properties": { "k": { "default": 5, "title": "K", "type": "integer" }, "query": { "title": "Query", "type": "string" } }, "required": [ "query" ], "title": "search_mcp_docsArguments", "type": "object" }

Implementation Reference

  • The core handler function for the 'search_mcp_docs' tool. It searches a cached documentation index for relevant MCP and FastMCP docs, hydrates top results with content for snippets, and returns a ranked list of results with URLs, titles, scores, and previews.
    def search_mcp_docs(query: str, k: int = 5) -> list[dict[str, Any]]: """Search MCP protocol and FastMCP documentation with ranked results. This tool provides access to comprehensive MCP documentation including: **MCP Protocol:** - Architecture and core concepts - Transports (stdio, streamable HTTP) - Tools, Resources, and Prompts - Lifecycle and capabilities negotiation - Error handling and security **FastMCP Framework:** - Python server patterns and decorators - Tool definitions with type hints - Resource and prompt templates - Client integration examples Use this to find relevant MCP documentation for building MCP servers. Args: query: Search query string (e.g., "tool input schema", "stdio transport") k: Maximum number of results to return (default: 5) Returns: List of dictionaries containing: - url: Document URL - title: Display title - score: Relevance score (higher is better) - snippet: Contextual content preview """ cache.ensure_ready() index = cache.get_index() if index is None: return [] results = index.search(query, k=k) url_cache = cache.get_url_cache() # Hydrate top results with content for snippets top = results[: min(len(results), cache.SNIPPET_HYDRATE_MAX)] for _, doc in top: cached = url_cache.get(doc.uri) if cached is None or not cached.content: cache.ensure_page(doc.uri) # Build response with snippets return_docs: list[dict[str, Any]] = [] for score, doc in results: page = url_cache.get(doc.uri) snippet = text_processor.make_snippet(page, doc.display_title) return_docs.append( { "url": doc.uri, "title": doc.display_title, "score": round(score, 3), "snippet": snippet, } ) return return_docs
  • Registers the search_mcp_docs tool on the FastMCP server instance using the @mcp.tool() decorator.
    mcp.tool()(docs.search_mcp_docs)
  • Imports the docs module containing the search_mcp_docs function for tool registration.
    from .tools import docs

Other Tools

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/praveenc/mcp-server-builder'

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