mcp-doc-search
Enables searching and retrieving documentation files from a local docs folder using a search tool and dynamic resource URIs.
README
MCP Doc Search
MCP Document Search Server
Overview
This project was built as a hands-on exercise to understand the Model Context Protocol (MCP) by implementing all three core MCP primitives:
- Prompts
- Tools
- Resources
The final outcome is a simple documentation search MCP server that exposes:
- A
search_docstool for searching documentation - Dynamic resources representing documents stored in a local
docs/folder
The server can be tested and explored using the MCP Inspector.
MCP Concepts Learned
1. Prompts
Prompts are reusable instruction templates exposed by an MCP server.
Pattern:
prompts/listprompts/get
Example:
simple
A client can discover available prompts and retrieve the prompt content.
2. Tools
Tools expose executable functionality.
Pattern:
tools/listtools/call
Examples implemented during learning:
fetch
add
multiply
search_docs
A tool receives arguments, performs some action, and returns structured results.
3. Resources
Resources expose data that can be read by a client.
Pattern:
resources/listresources/read
Examples:
```text
docs://mcp
docs://architecture
docs://retrieval
Resources represent existing data and are analogous to files or documents.
MCP Mental Model
Tool = Function
Resource = File
Prompt = Template
Examples:
search_docs("MCP") -> Tool
docs://mcp -> Resource
code-review-template -> Prompt
Current Architecture
MCP Client
│
├── search_docs(query) [Tool]
│
└── docs://* [Resources]
│
└── read_resource()
Search Flow
User Query
↓
search_docs("MCP")
↓
Returns matching resource URIs
↓
docs://mcp
↓
read_resource("docs://mcp")
↓
Returns document content
This demonstrates the common MCP pattern:
Tool → Resource Chain
Project Structure
doc-search/
│
├── README.md
├── pyproject.toml
│
└── mcp_doc_search/
│
├── __init__.py
├── __main__.py
├── server.py
│
└── docs/
├── architecture.txt
├── retrieval.txt
└── mcp.txt
Features
Tool: search_docs
Input:
{
"query": "MCP"
}
Behavior:
- Searches all
.txtfiles in thedocsdirectory - Performs a case-insensitive search
- Returns matching resource URIs
Example output:
docs://mcp
Resources
Resources are generated dynamically from the docs directory.
Examples:
docs://mcp
docs://architecture
docs://retrieval
Reading a resource returns the document content.
Testing
The server can be tested using MCP Inspector.
Example configuration:
Command:
uv
Arguments:
run python -m mcp_doc_search
The Inspector can then:
- List tools
- Call
search_docs - List resources
- Read resources
Key Takeaways
- MCP follows a consistent discovery and execution pattern.
- Tools are used for actions and discovery.
- Resources are used for retrieving known content.
- Prompts are reusable instruction templates.
- Many knowledge and retrieval servers follow a Tool → Resource architecture.
- The MCP layer remains stable even when the retrieval implementation evolves from simple file search to BM25, vector search, hybrid search, or databases.
Future Improvements
- BM25 search
- Vector search
- Hybrid search
- SingleStore integration
- Result ranking and scoring
- Resource metadata
- Claude Desktop / Cursor integration
- Retrieval-Augmented Generation (RAG)
create venv: uv venv Go to correct toml file and run: uv sync uv run python -m mcp_simple_prompt --help
uv run python -m mcp_doc_search --help
Install inspector: npx @modelcontextprotocol/inspector and runs it port:6274 (For stdio transport, Inspector itself launches the server, so need not run uv run mcp-simple-prompt in another terminal) or run python -m mcp_doc_search in the arguments
Enter the proxy token or launch the Proxy configured url and enter-> Command: uv and arguments: run mcp-simple-prompt
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.