Skip to main content
Glama
anujmv

mcp-doc-search

by anujmv

mcp-doc-search

A small Model Context Protocol (MCP) server that gives an LLM grounded search and retrieval over a local folder of documents. The model calls search_docs to find relevant sources, then get_document to read and cite them, so answers stay grounded in your files instead of the model's memory.

Built as a focused, forward-deployed pattern: the simplest thing that makes retrieval real and citable, ready to drop into an enterprise workflow and extend with embeddings or evals.

Tools

Tool

What it does

search_docs

Ranks documents in the docs folder against a query and returns top matches with snippets and scores.

get_document

Returns the full text of a document by id, for citation or deeper reading.

Related MCP server: directory-indexer

Quick start

npm install
npm run build
DOCS_DIR=./docs npm start

The server speaks MCP over stdio, so it is launched by an MCP client rather than used directly.

Use with Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "doc-search": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-doc-search/dist/index.js"],
      "env": { "DOCS_DIR": "/absolute/path/to/your/docs" }
    }
  }
}

Then ask Claude something answerable from your docs, for example: "Search the docs for the KYC retry policy and cite the source."

How it works

  1. On startup the server indexes every .md / .txt file in DOCS_DIR.

  2. search_docs scores documents with a term-frequency relevance measure and returns ranked snippets.

  3. get_document returns full text for citation.

Scoring is intentionally simple. The point is the grounded retrieval contract, which is swappable for vector embeddings without changing the tool interface.

Roadmap

  • Vector embeddings + chunking for semantic search

  • PDF ingestion with OCR for scanned documents

  • A small eval set to measure answer groundedness

License

MIT

Available Tools

2 tools
get_documentGet documentA

Return the full text of a document by its id (filename), for citation or deeper reading.

ParametersJSON Schema
NameRequiredDescriptionDefault
idYesDocument id, e.g. a filename returned by search_docs

TDQS

A4.1/5.0
Behavior3/5

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

No annotations exist, so description carries full burden. It indicates read-only behavior by 'Return the full text' but does not disclose error handling, auth requirements, or rate limits. Minimal behavioral context beyond purpose.

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?

Single sentence efficiently conveys action, subject, and purpose without redundancy. Every word earns its place.

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?

Tool is simple with one parameter and clear purpose. Description covers use case and expected input. No output schema, but return type is implied as 'full text'. Complete for this context.

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

Parameters3/5

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

Schema coverage is 100% with description of id as 'Document id, e.g. a filename returned by search_docs'. The tool description adds 'for citation or deeper reading' but no new parameter-specific information beyond the schema. Baseline 3 is appropriate.

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?

Description clearly states verb 'Return' and resource 'full text of a document', specifying the identifier (id as filename) and use case (citation or deeper reading). It distinguishes from sibling search_docs, which is for searching, by focusing on retrieval.

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 phrase 'for citation or deeper reading' implies use after search_docs, but no explicit when-to-use or when-not-to-use guidance is provided. It gives context but lacks exclusions or alternatives.

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

search_docsSearch documentsA

Search the local document set for a query and return the most relevant documents with snippets. Use this to ground answers in real sources before responding.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesNatural language query or keywords
limitNoMax results

TDQS

A4/5.0
Behavior3/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 states the tool returns 'snippets' but does not elaborate on ordering, pagination, authentication, or scope constraints beyond 'local document set'. This is adequate but not fully transparent.

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 two sentences with no extraneous words. The first sentence states the core function, and the second provides usage guidance. It is front-loaded and efficient.

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?

Given the tool's simplicity (2 parameters, no output schema, one sibling), the description covers the main purpose and usage context. However, it lacks explicit details about the output structure (e.g., format of snippets), which would be beneficial since no output schema is provided.

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

Parameters3/5

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

Schema coverage is 100%, so the schema already documents both parameters. The description does not add any semantic detail beyond what the schema provides, such as clarifying the nature of snippets or the meaning of the limit parameter. Thus, baseline 3 is appropriate.

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 specifies the verb 'search' and resource 'local document set', and distinguishes from the sibling tool 'get_document' by implying it is for retrieval of specific documents, while search_docs is for searching and returning snippets.

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 description explicitly says 'Use this to ground answers in real sources before responding', providing clear context for when to use the tool. However, it does not explicitly state when not to use it or mention alternatives like get_document.

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

TDQS

A4.3/5.0
Disambiguation5/5

The two tools have completely distinct purposes: one for searching documents with snippets, the other for retrieving full text by ID. No ambiguity exists.

Naming Consistency5/5

Both names follow a consistent verb_noun pattern in snake_case (search_docs, get_document), making them predictable and easy to distinguish.

Tool Count4/5

With only two tools, the server is minimal but adequately scoped for a focused document search and retrieval purpose. It is slightly thin but not inappropriate.

Completeness5/5

The tool surface covers the essential workflow for a read-only document search: searching and retrieving full documents. No obvious gaps for its stated purpose.

Maintenance

ActivityStale
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

  • F
    license
    B
    quality
    D
    maintenance
    Provides intelligent retrieval capabilities for local files by scanning directories, generating vector indexes, and enabling semantic search through RAG (Retrieval Augmented Generation) with incremental indexing support.
    2
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables retrieval-augmented generation by allowing LLMs to search documents in a local folder using vector similarity, supporting multiple file formats.
  • A
    license
    A
    quality
    C
    maintenance
    Provides LLMs with secure, read-only access to local documentation by scanning directories, extracting content from PDF, DOCX, Markdown, and text files, and performing keyword searches.
    3
    14
    MIT

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/anujmv/mcp-doc-search'

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