Skip to main content
Glama
wanyingng

docs-search-engine

by wanyingng

Documentation Search Engine

A custom Model Context Protocol (MCP) server that acts as a documentation search engine.

This project attempts to build a simple, personal clone of Context7, unlocking the capability to access up-to-date documentation from GitHub repositories and web pages directly within your AI assistant's context.

šŸ› ļø Tech Stack

  • Python: Core programming language.

  • FastMCP: Framework for building MCP servers easily.

  • minsearch: Lightweight, in-memory full-text search engine.

  • uv: Fast Python package and environment manager.

  • Jina Reader: For turning web pages into LLM-friendly markdown.

  • requests: For handling HTTP requests and downloading zip files.

  • pytest: For comprehensive testing.

Related MCP server: CHECK-MODULE MCP Server

šŸ“‚ Project Structure

docs-search-engine/
ā”œā”€ā”€ main.py             # Entry point: Defines MCP tools and server configuration
ā”œā”€ā”€ search.py           # Core logic: Zip download, extraction, indexing, and search
ā”œā”€ā”€ scrape_web.py       # Web scraping functionality (using Jina Reader)
ā”œā”€ā”€ test_search.py      # Tests for search functionality
ā”œā”€ā”€ test_scrape_web.py  # Tests for web scraping
└── pyproject.toml      # Project dependencies and configuration

šŸš€ Workflow

  1. Ingestion: The server downloads documentation source code (e.g., as a .zip from GitHub).

  2. Indexing: Markdown content (.md and .mdx) is extracted and indexed in-memory using minsearch.

  3. Caching: Indexes are cached by URL to ensure fast subsequent searches without re-downloading.

  4. Retrieval: Users query the system via MCP tools (search_docs, scrape_web), and relevant context is returned to the LLM.

āš™ļø MCP Configuration

Add the following configuration to your MCP client settings (e.g., mcp_config.json in Google Antigravity):

{
  "mcpServers": {
    "docs-search-engine": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "C:/Users/username/path/to/docs-search-engine",
        "main.py"
      ]
    }
  }
}

Note: Replace C:/Users/username/path/to/docs-search-engine with the actual absolute path to your project directory.

šŸ’” Example Usage

Once the MCP server is connected to your AI assistant (e.g., VSCode, Claude, Cursor, Antigravity), you can use natural language to interact with it.

1. Search Documentation

"Search for 'context' in the FastMCP docs."
"Find information about 'indexing' in the minsearch docs (https://github.com/alexeygrigorev/minsearch)."

2. Scrape Web Pages

"Scrape the content of https://example.com/blog/article and summarize it."

3. Count Word Occurrences

"Count how many times the word 'LLM' appears on https://example.com/ai-trends."

šŸ’» Setup & Execution

Prerequisites

  • Python 3.13+

  • uv installed (recommended)

Installation

  1. Clone the repository and navigate to the directory:

    cd docs-search-engine
  2. Install dependencies:

    uv sync

Running Locally

To run the server manually for debugging:

uv run main.py

Testing

Run the comprehensive test suite to ensure everything is working correctly:

# Run all tests
uv run pytest -v

# Run specific test files
uv run pytest test_search.py -v
uv run pytest test_scrape_web.py -v

# Run only integration tests
uv run pytest -m integration -v

Available Tools

3 tools
count_word_occurrencesA

Count occurrences of a specific word on a web page.

This tool scrapes a web page and counts how many times a specific word appears in the content.

Args: url: The URL of the web page to analyze. word: The word to search for and count. case_insensitive: If True, count is case-insensitive (default: True).

Returns: A dictionary with the count and additional info.

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYes
wordYes
case_insensitiveNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full behavioral burden. It discloses that the tool scrapes a web page and returns a dictionary, which is useful, but it omits caveats about network dependency, page size limits, site accessibility, or what the vague 'additional info' actually contains.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured: a one-line summary, brief explanation, Args section, and Returns section. However, the first two sentences are somewhat redundant ('Count occurrences...' and 'This tool scrapes... counts...'), which slightly reduces tightness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with three parameters, the description covers inputs, behavior, and return type adequately. It does not specify the exact structure of the returned dictionary or note edge cases such as unavailable pages, but given the tool's simplicity, the remaining gaps are relatively minor.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate for the schema's bare types. The Args section clearly explains all three parameters, including the url to analyze, the word to count, and the case_insensitive behavior with its default. It fully adds meaning beyond the structured schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb-resource combination ('Count occurrences of a specific word on a web page') and clearly distinguishes the tool from siblings: scrape_web (raw content retrieval) and search_docs (searching documentation). The purpose is immediately obvious.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The purpose makes the tool's usage context clear: use it when you need word frequency from a web page. However, it does not explicitly contrast with alternatives or state exclusions for when another tool would be better, so it stops short of full usage guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

scrape_webA

Scrape the content of a web page using Jina Reader.

This tool fetches the content of any web page and returns it in markdown format using the Jina Reader service.

Args: url: The URL of the web page to scrape (must be http or https).

Returns: The content of the web page in markdown format.

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must carry the burden. It does disclose key behavior: it fetches external web content, returns markdown, uses Jina Reader, and requires http/https URLs. However, it does not mention errors, access limitations, size limits, or that this is a read-only network operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is short and includes clear Args/Returns sections, but it is somewhat redundant: 'Scrape the content of a web page using Jina Reader' and 'fetches the content of any web page... using the Jina Reader service' overlap. It could be tightened without losing information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple one-parameter tool with an output schema, the description covers the essential contract: input URL must be http/https, output is the page content as markdown. It lacks failure-mode detail, but the tool is low-complexity and the return format is explicitly stated.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema provides zero description coverage, but the tool description compensates well for the single parameter: it identifies 'url' as the page to scrape and imposes the http/https constraint. This gives an agent meaningful information beyond the bare schema definition.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description identifies a specific verb and resource: scrape the content of a web page using Jina Reader, returning markdown. It does not explicitly compare against siblings such as search_docs, but the action and resource are clear enough to distinguish it.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the tool should be used when raw web page content is needed, and states it can handle 'any web page'. It gives no explicit guidance about when not to use it or what alternatives (e.g., search_docs, count_word_occurrences) are better suited for other tasks.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_docsA

Search documentation from a GitHub repository zip file.

This tool downloads documentation from a GitHub repository (as a zip), indexes the markdown files, and returns the most relevant documents matching the query. The index is cached for subsequent searches.

Args: query: The search query string. zip_url: URL to the GitHub zip file (default: FastMCP docs). Format: https://github.com/{owner}/{repo}/archive/refs/heads/{branch}.zip num_results: Maximum number of results to return (default: 5).

Returns: A list of matching documents with filename and content preview.

Examples: # Search FastMCP docs (default) search_docs("demo")

# Search minsearch docs
search_docs("index", zip_url="https://github.com/alexeygrigorev/minsearch/archive/refs/heads/main.zip")
ParametersJSON Schema
NameRequiredDescriptionDefault
queryYes
zip_urlNohttps://github.com/jlowin/fastmcp/archive/refs/heads/main.zip
num_resultsNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It transparently states that the tool downloads a zip, indexes markdown files, caches the index, and returns document previews. It does not mention network failure modes or cache invalidation, but the core side effects are clearly disclosed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with a summary, Args, Returns, and Examples sections. Every section contributes useful information, and the core purpose is front-loaded in the first sentence without unnecessary fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations and moderate complexity, the description covers the full workflow, parameter semantics, defaults, return shape, and practical examples. The presence of an output schema covers the return format details, so nothing critical is missing for an agent to invoke this correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Given 0% schema description coverage, the description fully compensates by explaining each parameter: query as a search string, zip_url with a default and required URL format, and num_results as a maximum count. This adds substantial meaning beyond the raw schema types and defaults.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool searches documentation from a GitHub repository zip file, with a specific verb, resource, and workflow (download, index, return relevant documents). It implicitly differentiates from siblings like scrape_web and count_word_occurrences by focusing specifically on GitHub-hosted documentation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied through examples and the default zip_url, showing when to call the tool directly. However, there is no explicit guidance about when to prefer this tool over alternatives or any exclusions for edge cases like searching non-markdown documentation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 3 tool updatesv0.1.0
    • First observedcount_word_occurrences
    • First observedscrape_web
    • First observedsearch_docs

TDQS

A3.9/5.0
Disambiguation4/5

scrape_web and count_word_occurrences both involve scraping a URL, so there is slight overlap, but count_word_occurrences is clearly a specialized analysis and search_docs is distinct. An agent can generally select the right tool from the stated purpose.

Naming Consistency5/5

All three tool names use a consistent verb_noun snake_case pattern (scrape_web, count_word_occurrences, search_docs), making the set predictable and easy to navigate.

Tool Count4/5

Three tools is a small but reasonable surface for a focused toolkit; only one tool actually performs documentation search, which feels slightly lean for a server named docs-search-engine, but no tool is redundant.

Completeness4/5

The core function of searching a GitHub repository's docs is implemented, but cache management and indexing of arbitrary scraped pages are not supported. These gaps are minor and can be worked around by passing a new zip_url or relying on the automatic index.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

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/wanyingng/docs-search-engine'

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