Doc Lib MCP

by shifusen329

Not rated
GitHub

About

An MCP server for document ingestion, chunking, semantic search, and note management.

Details

Author
shifusen329
Categories
Productivity, Other, Knowledge Base, Search

Setup

Install Doc Lib MCP in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/shifusen329/doc-lib-mcp

Follow the installation instructions in the repository README, then restart your MCP client.

A Model Context Protocol (MCP) server for document ingestion, chunking, semantic search, and note management.

- Implements a simple note storage system with:

- Customnote://URI scheme for accessing individual notes
- Each note resource has a name, description, andtext/plainmimetype

- Provides a prompt:

- summarize-notes: Creates summaries of all stored notes

- Optional "style" argument to control detail level (brief/detailed)
- Generates prompt combining all current notes with style preference

The server implements a wide range of tools:

- add-note: Add a new note to the in-memory note store

- Arguments:name(string),content(string)

- Arguments:content(string, required),source(string, optional),tags(list of strings, optional)

- Arguments:url(string),dynamic(boolean, optional)

- Arguments:

- path(string, required): File path to ingest.
- prompt(string, optional): Custom prompt to use for Gemini.
- tags(list of strings, optional): Optional list of tags for classification.

- Arguments:

- query(string): The semantic search query.
- top_k(integer, optional, default 3): Number of top results to return.
- type(string, optional): Filter results by chunk type (e.g.,code,html,markdown).
- tag(string, optional): Filter results by tag in chunk metadata.

- Arguments:id(integer, optional),ids(list of integers, optional)
- You can delete a single chunk by specifyingid, or delete multiple chunks at once by specifyingids.

- Arguments:id(integer, required),type(string, required)

- Arguments:

- tag(string, optional): Filter sources by tag in chunk metadata.
- query(string, optional): Semantic search query to find relevant sources.
- top_k(integer, optional, default 10): Number of top sources to return when using query.

- Arguments:

- query(string, optional): The semantic search query.
- tag(string, optional): Filter results by a specific tag in chunk metadata.
- type(string, optional): Filter results by chunk type (e.g., 'code', 'markdown').
- top_k(integer, optional, default 5): The number of top relevant chunks to retrieve.

- Arguments:id(integer),metadata(object)

- Arguments:source(string),tags(list of strings)

- Markdown, Python, OpenAPI, and HTML files are split into logical chunks for efficient retrieval and search.
- The markdown chunker uses mistune 3.x's AST API and regex to robustly split content by code blocks and narrative, preserving all original formatting.
- Both code blocks and markdown/narrative content are preserved as separate chunks.
- The HTML chunker uses thereadability-lxmllibrary to extract main content first, then extracts block code snippets from<pre>tags as dedicated "code" chunks. Inline<code>content remains part of the narrative chunks.

- Thesearch-chunkstool performs vector-based semantic search over all ingested content, returning the most relevant chunks for a given query.
- Supports optionaltypeandtagarguments to filter results by chunk type (e.g.,code,html,markdown) and/or by tag in chunk metadata, before semantic ranking.
- This enables highly targeted retrieval, such as "all code chunks tagged with 'langfuse' relevant to 'cost and usage'".

- Chunks include ametadatafield for categorization and tagging.
- Theupdate-chunk-metadatatool allows updating metadata for any chunk by its id.
- Thetag-chunks-by-sourcetool allows adding tags to all chunks from a specific source in one operation. Tagging merges new tags with existing ones, preserving previous tags.

The server requires the following environment variables (can be set in a .env file):

- OLLAMA_HOST: Hostname for Ollama API (default: localhost)
- OLLAMA_PORT: Port for Ollama API (default: 11434)
- RAG_AGENT: Ollama model to use for RAG responses (default: llama3)
- OLLAMA_MODEL: Ollama model to use for embeddings (default: nomic-embed-text-v2-moe)

- HOST: PostgreSQL database host (default: localhost)
- DB_PORT: PostgreSQL database port (default: 5432)
- DB_NAME: PostgreSQL database name (default: doclibdb)
- DB_USER: PostgreSQL database user (default: doclibdb_user)
- DB_PASSWORD: PostgreSQL database password (default: doclibdb_password)

- RERANKER_MODEL_PATH: Path to the reranker model (default: /srv/samba/fileshare2/AI/models/bge-reranker-v2-m3)
- RERANKER_USE_FP16: Whether to use FP16 for reranker (default: True)

On MacOS:~/Library/Application\ Support/Claude/claude_desktop_config.jsonOn Windows:%APPDATA%/Claude/claude_desktop_config.json

To prepare the package for distribution:

This will create source and wheel distributions in thedist/directory.

Note: You'll need to set PyPI credentials via environment variables or command flags:

- Token:--tokenorUV_PUBLISH_TOKEN
- Or username/password:--username/UV_PUBLISH_USERNAMEand--password/UV_PUBLISH_PASSWORD

Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using theMCP Inspector.

You can launch the MCP Inspector vianpmwith this command:

npx @modelcontextprotocol/inspector uv --directory /home/administrator/python-share/doc-lib-mcp run doc-lib-mcp

Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.

MCP server for Apple Notes with semantic search and CRUD operations. Claude searches, reads, creates, updates, and manages your Apple Notes through natural language.

Rememberizer MCP Server for Common Knowledge

Access personal or team knowledge from internal repositories like documents and Slack discussions.

A server for the Scrapbox/CoSense platform to retrieve, list, search, and create pages.

Give AI assistants secure access to your organization's structured business data. Search records, create and update records, retrieve schema information, and manage workflow states using natural language.

Production-ready RAG out of the box to search and retrieve data from your own documents.

Vectorize MCP server for advanced retrieval, Private Deep Research, Anything-to-Markdown file extraction and text chunking.

Codicil indexes a repo's Markdown/YAML/TOML docs into a local Chroma store and exposes query_docs/reindex_docs over MCP. Uses Ollama embeddings when available; with zero infra beyond that, it degrades to live keyword search off disk instead of failing.

Creates a personal, always-current knowledge base for AI by indexing documentation from websites, GitHub, npm, PyPI, and local files.

Local RAG system for Claude Code with hybrid search (semantic + BM25), cross-encoder reranking, markdown-aware chunking, 9 file formats, file watcher, and 12 MCP tools. Zero external servers. pip install knowledge-rag

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.