
doc-lib-mcp
3 years
Works with Finder
0
Github Watches
0
Github Forks
0
Github Stars
doc-lib-mcp MCP server
A Model Context Protocol (MCP) server for document ingestion, chunking, semantic search, and note management.
Components
Resources
- Implements a simple note storage system with:
- Custom
note://
URI scheme for accessing individual notes - Each note resource has a name, description, and
text/plain
mimetype
- Custom
Prompts
- 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
-
summarize-notes: Creates summaries of all stored notes
Tools
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:
-
ingest-string: Ingest and chunk a markdown or plain text string provided via message
- Arguments:
content
(string, required),source
(string, optional),tags
(list of strings, optional)
- Arguments:
-
ingest-markdown: Ingest and chunk a markdown (.md) file
- Arguments:
path
(string)
- Arguments:
-
ingest-python: Ingest and chunk a Python (.py) file
- Arguments:
path
(string)
- Arguments:
-
ingest-openapi: Ingest and chunk an OpenAPI JSON file
- Arguments:
path
(string)
- Arguments:
-
ingest-html: Ingest and chunk an HTML file
- Arguments:
path
(string)
- Arguments:
-
ingest-html-url: Ingest and chunk HTML content from a URL (optionally using Playwright for dynamic content)
- Arguments:
url
(string),dynamic
(boolean, optional)
- Arguments:
-
smart_ingestion: Extracts all technically relevant content from a file using Gemini, then chunks it using robust markdown logic.
- 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.
-
- Uses Gemini 2.0 Flash 001 to extract only code, configuration, markdown structure, and technical definitions (no summaries or commentary).
- Passes the extracted content to a mistune 3.x-based chunker that preserves both code blocks and markdown/narrative content as separate chunks.
- Each chunk is embedded and stored for semantic search and retrieval.
- Arguments:
-
search-chunks: Semantic search over ingested content
- 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.
-
- Returns the most relevant chunks for a given query, optionally filtered by type and/or tag.
- Arguments:
-
delete-source: Delete all chunks from a given source
- Arguments:
source
(string)
- Arguments:
-
delete-chunk-by-id: Delete one or more chunks by id
- Arguments:
id
(integer, optional),ids
(list of integers, optional) - You can delete a single chunk by specifying
id
, or delete multiple chunks at once by specifyingids
.
- Arguments:
-
update-chunk-type: Update the type attribute for a chunk by id
- Arguments:
id
(integer, required),type
(string, required)
- Arguments:
-
ingest-batch: Ingest and chunk multiple documentation files (markdown, OpenAPI JSON, Python) in batch
- Arguments:
paths
(list of strings)
- Arguments:
-
list-sources: List all unique sources (file paths) that have been ingested and stored in memory, with optional filtering by tag or semantic search.
- 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:
-
get-context: Retrieve relevant content chunks (content only) for use as AI context, with filtering by tag, type, and semantic similarity.
- 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:
-
update-chunk-metadata: Update the metadata field for a chunk by id
- Arguments:
id
(integer),metadata
(object)
- Arguments:
-
tag-chunks-by-source: Adds specified tags to the metadata of all chunks associated with a given source (URL or file path). Merges with existing tags.
- Arguments:
source
(string),tags
(list of strings)
- Arguments:
- list-notes: List all currently stored notes and their content.
Chunking and Code Extraction
- 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 the
readability-lxml
library 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.
Semantic Search
- The
search-chunks
tool performs vector-based semantic search over all ingested content, returning the most relevant chunks for a given query. - Supports optional
type
andtag
arguments 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'".
Metadata Management
- Chunks include a
metadata
field for categorization and tagging. - The
update-chunk-metadata
tool allows updating metadata for any chunk by its id. - The
tag-chunks-by-source
tool allows adding tags to all chunks from a specific source in one operation. Tagging merges new tags with existing ones, preserving previous tags.
Configuration
[TODO: Add configuration details specific to your implementation]
Quickstart
Install
Claude Desktop
On MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
Development/Unpublished Servers Configuration
``` "mcpServers": { "doc-lib-mcp": { "command": "uv", "args": [ "--directory", "/home/administrator/python-share/documentation_library/doc-lib-mcp", "run", "doc-lib-mcp" ] } } ```Published Servers Configuration
``` "mcpServers": { "doc-lib-mcp": { "command": "uvx", "args": [ "doc-lib-mcp" ] } } ```Development
Building and Publishing
To prepare the package for distribution:
- Sync dependencies and update lockfile:
uv sync
- Build package distributions:
uv build
This will create source and wheel distributions in the dist/
directory.
- Publish to PyPI:
uv publish
Note: You'll need to set PyPI credentials via environment variables or command flags:
- Token:
--token
orUV_PUBLISH_TOKEN
- Or username/password:
--username
/UV_PUBLISH_USERNAME
and--password
/UV_PUBLISH_PASSWORD
Debugging
Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the MCP Inspector.
You can launch the MCP Inspector via npm
with this command:
npx @modelcontextprotocol/inspector uv --directory /home/administrator/python-share/documentation_library/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.
相关推荐
🔥 1Panel bietet eine intuitive Weboberfläche und einen MCP -Server, um Websites, Dateien, Container, Datenbanken und LLMs auf einem Linux -Server zu verwalten.
⛓️Rugele ist ein leichter, leistungsstarker, leistungsstarker, eingebetteter Komponenten-Orchestrierungsregel-Motor-Rahmen für GO.
🧑🚀 全世界最好的 llm 资料总结(数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Zusammenfassung der weltbesten LLM -Ressourcen.
Flock ist eine Workflow-basierte Low-Code-Plattform, um schnell Chatbots, Lappen und Koordinierung von Multi-Agent-Teams zu erstellen, die von Langgraph, Langchain, Fastapi und NextJs angetrieben werden.
PDF wissenschaftliche Papierübersetzung mit erhaltenen Formaten - 基于 ai 完整保留排版的 pdf 文档全文双语翻译 , 支持 支持 支持 支持 google/deeptl/ollama/openai 等服务 提供 cli/gui/mcp/docker/zotero
Fair-Code-Workflow-Automatisierungsplattform mit nativen KI-Funktionen. Kombinieren Sie visuelles Gebäude mit benutzerdefiniertem Code, SelbstHost oder Cloud, 400+ Integrationen.
Erstellen Sie einfach LLM -Tools und -Argarten mit einfachen Bash/JavaScript/Python -Funktionen.
😎简单易用、🧩丰富生态 - 大模型原生即时通信机器人平台 | 适配 qq / 微信(企业微信、个人微信) / 飞书 / 钉钉 / diskord / telegram / slack 等平台 | 支持 Chatgpt 、 Deepseek 、 Diffy 、 Claude 、 Gemini 、 xai 、 ppio 、 、 ulama 、 lm Studio 、阿里云百炼、火山方舟、 siliconflow 、 qwen 、 mondshot 、 chatglm 、 sillytraven 、 mcp 等 llm 的机器人 / agent | LLM-basierte Instant Messaging Bots-Plattform, unterstützt Zwietracht, Telegramm, Wechat, Lark, Dingtalk, QQ, Slack
Reviews

user_XWWXOK5R
As a loyal user of doc-lib-mcp, I am incredibly impressed by its seamless functionality and user-friendly interface. Created by shifusen329, it offers a comprehensive library that greatly enhances my project management workflow. I highly recommend this tool for anyone looking to improve their document organization and accessibility.

user_aYrN7fCd
As a dedicated user of the doc-lib-mcp application created by shifusen329, I am extremely impressed by its functionality and user-friendly interface. It has significantly streamlined my document management process. The welcome information is clear and helpful, making the start-up experience smooth. Highly recommended for anyone looking for an efficient document management solution!

user_vpfO24wk
As a dedicated user of doc-lib-mcp by shifusen329, I find it to be an essential tool for any developer. Its intuitive interface and comprehensive documentation make managing projects incredibly efficient. Highly recommend for its seamless integration and excellent support.

user_y3byTn1W
As a dedicated user of doc-lib-mcp by shifusen329, I am thoroughly impressed. This application streamlines document management effortlessly. The user interface is intuitive, and the functionality is robust, catering to all my documentation needs efficiently. Highly recommended for anyone seeking a seamless and efficient document management solution!

user_ah6kq9NV
As a dedicated user of doc-lib-mcp, I am thoroughly impressed by this incredible tool. Developed by shifusen329, it offers everything I need for seamless document management. Its streamlined interface and functionality make organizing documents a breeze. Highly recommend for anyone looking to enhance their productivity!

user_NVlTbO66
As a dedicated user of doc-lib-mcp, I can confidently say it's an outstanding resource for anyone working with MCP applications. The documentation provided is clear, comprehensive, and incredibly useful. Author shifusen329 has done an excellent job in curating the content, making it accessible for both beginners and experienced professionals. I highly recommend it to anyone looking to enhance their understanding and efficiency with MCP.