pdf-knowledge-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@pdf-knowledge-mcpHow to extract text from PDF content streams?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
pdf-knowledge-mcp
pdf-knowledge-mcp 是一个面向 PDF 开发经验沉淀的本地 RAG MCP Server。它可以导入 PDF 解析、生成、渲染、文本提取、表格识别、版式分析、字体处理、OCR、PDF/A、签名、加密、性能优化等经验文档,并通过 MCP 工具提供检索和问答能力。
当前实现不依赖远程模型或外部向量数据库。文档会被切分为 chunk,使用本地 TF-IDF 向量和余弦相似度检索,并把索引持久化为 JSON 文件。后续可以在 src/knowledge-store.ts 中替换或扩展 embedding/provider。
安装与构建
cd C:\src\pdf-knowledge-mcp
npm install
npm run buildRelated MCP server: MyDocsMCP
启动
npm start该进程通过 stdio 提供 MCP 服务。
默认知识库索引路径为项目内的 data/pdf-knowledge-index.json。如需指定其他位置:
$env:PDF_KNOWLEDGE_STORE_PATH = "C:\src\pdf-knowledge-mcp\data\pdf-knowledge-index.json"
npm startMCP 配置
推荐先链接成本地命令:
cd C:\src\pdf-knowledge-mcp
npm link然后添加到 Codex:
codex mcp add pdf-knowledge -- pdf-knowledge-mcp通用 MCP 客户端配置示例:
{
"mcpServers": {
"pdf-knowledge": {
"command": "node",
"args": ["C:/src/pdf-knowledge-mcp/dist/index.js"],
"env": {
"PDF_KNOWLEDGE_STORE_PATH": "C:/src/pdf-knowledge-mcp/data/pdf-knowledge-index.json"
}
}
}
}工具
ingest_document
导入 PDF 开发经验文档。支持直接传入 content,也支持传入 UTF-8 文本、Markdown、JSON、HTML 文件路径。
{
"title": "PDF text extraction notes",
"source": "notes/text-extraction.md",
"tags": ["parsing", "text", "font"],
"content": "When extracting text from PDF content streams, ToUnicode CMaps are essential...",
"chunkSize": 1800,
"chunkOverlap": 200,
"replaceExisting": true
}也可以从文件导入:
{
"filePath": "C:/docs/pdf-rendering-notes.md",
"tags": ["rendering", "performance"]
}search_knowledge
基于本地向量索引检索相关经验片段。
{
"query": "ToUnicode font extraction",
"limit": 5,
"tags": ["text"]
}返回内容包括分数、文档标题、来源、标签、chunk id、命中词和 excerpt。
ask_pdf_expert
先检索知识库,再基于检索结果生成带来源的 PDF 开发回答。
{
"question": "How should I handle fonts when extracting PDF text?",
"limit": 5,
"maxContextChars": 8000
}如果没有匹配内容,工具会明确提示需要先导入相关经验文档。
验证
npm testSmoke test 会验证:
文档导入、分块和索引持久化;
本地向量检索和标签过滤;
ask_pdf_expert返回带来源的 RAG 回答;MCP Server 可以通过 stdio 响应
initialize请求。
说明
这个服务适合作为 PDF 开发经验知识库的基础版本:它先保证本地、可追溯、可运行。未来可以扩展的方向包括真实 embedding 模型、SQLite/向量数据库、PDF/Docx 文档解析器、自动目录同步、以及与 pdf-debug-mcp、pdf-specification-mcp 的联合查询。
Available Tools
3 toolsask_pdf_expertB
Answer a PDF development question by retrieving relevant local knowledge first and returning an answer with citations.
| Name | Required | Description | Default |
|---|---|---|---|
| tags | No | Only use chunks that contain all of these tags. | |
| limit | No | Maximum number of retrieved chunks to use. | |
| question | Yes | PDF development question to answer with retrieved local knowledge. | |
| maxContextChars | No | Maximum retrieved context characters to include in the answer. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided; description only says retrieves knowledge and returns answer with citations. Lacks disclosure on side effects, permissions, or dependencies (e.g., prior ingestion).
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence that is clear, front-loaded, and efficient. No waste.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
No output schema; description lacks details on answer format, citation structure, or prerequisites. The tool is complex (RAG-based) and needs more context for correct selection and use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% so baseline 3. Description adds context about retrieval but does not enhance parameter meaning beyond schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states verb 'Answer', resource 'PDF development question', and method 'retrieve local knowledge and return with citations'. Distinguishes from sibling tools like search_knowledge.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Implies usage for PDF development questions but provides no explicit when-to-use or when-not-to-use guidance, nor alternatives. The context from siblings is not referenced.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
ingest_documentA
Ingest a PDF development experience document into the local RAG knowledge base. The server chunks, vectorizes, indexes, and persists the content locally.
| Name | Required | Description | Default |
|---|---|---|---|
| tags | No | Optional tags for classifying or filtering knowledge, such as parsing, rendering, font, ocr, pdfa, signature. | |
| title | No | Human readable title. Defaults to the file name or source. | |
| source | No | Stable source identifier, such as a file path, URL, note id, or repository path. | |
| content | No | Raw text or Markdown content to ingest. Use this or filePath. | |
| filePath | No | Path to a UTF-8 text, Markdown, JSON, or HTML document. Relative paths are resolved from the MCP server process cwd. | |
| chunkSize | No | Approximate maximum characters per chunk. | |
| chunkOverlap | No | Approximate overlapping characters between adjacent chunks. | |
| replaceExisting | No | Replace existing documents with the same source before ingesting. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description clearly discloses the tool's behavior: 'The server chunks, vectorizes, indexes, and persists the content locally.' It accurately describes the write operation, though it could further address idempotency or failure modes.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, front-loaded with verb and resource, and contains no filler. Every sentence adds value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (8 parameters, no output schema), the description covers the core process but omits details about supported file types (schema allows non-PDF formats) and post-ingestion querying. It is mostly complete but has a minor inconsistency between description ('PDF') and schema (other formats).
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with parameter descriptions present. The description does not add per-parameter meaning beyond the schema, which is acceptable. Baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Ingest a PDF development experience document into the local RAG knowledge base.' It specifies the verb (ingest), resource (PDF document), and destination (RAG knowledge base), and distinguishes from sibling tools like ask_pdf_expert (query) and search_knowledge (search).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for adding documents to the knowledge base but does not explicitly state when to use this tool versus alternatives like ask_pdf_expert or search_knowledge. No when-not or direct comparisons are provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_knowledgeA
Search the local PDF development knowledge base with semantic-style TF-IDF vector retrieval and return ranked chunks with source references.
| Name | Required | Description | Default |
|---|---|---|---|
| tags | No | Only search chunks that contain all of these tags. | |
| limit | No | Maximum number of chunks to return. | |
| query | Yes | PDF development question, keyword, API name, error symptom, or concept to search for. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Description mentions 'semantic-style TF-IDF vector retrieval' and 'ranked chunks' but doesn't detail limitations, required permissions, or behavior for edge cases. No annotations provided to offset this.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single, concise sentence with no extraneous information. Every phrase adds value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With 3 parameters and no output schema, the description covers the core purpose and return format (ranked chunks). Could be improved by noting range of acceptable queries or performance considerations.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with good descriptions for each parameter (query, tags, limit). The description doesn't add significant meaning beyond what the schema already provides, so baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states the tool searches a local PDF knowledge base using semantic-style TF-IDF vector retrieval and returns ranked chunks with source references, distinguishing it from siblings like ask_pdf_expert or ingest_document.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Implied usage for searching PDF development knowledge, but no explicit guidance on when to use this tool versus ask_pdf_expert (which likely handles interactive Q&A) or ingest_document (which ingests documents).
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.
3 tool updates
v0.1.0- First observed
ask_pdf_expert - First observed
ingest_document - First observed
search_knowledge
TDQS
Each tool serves a distinct purpose: ingest for adding documents, search for retrieval, and ask for QA with citations. No overlapping functionality.
All tools follow a consistent verb_noun pattern in snake_case (ask_pdf_expert, ingest_document, search_knowledge), making their roles clear.
Three tools is a minimal but reasonable set for a knowledge base server, covering the core operations of ingestion, retrieval, and question answering.
The server covers the essential CRUD-like operations for a RAG system (ingest, search, QA). Missing delete or update, but these are less critical for the domain.
Maintenance
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
The CustomGPT.ai MCP server is a fully managed, RAG-powered endpoint that connects large language models with private knowledge bases and external data sources. It provides tools for retrieval-augmented generation queries (send_message), data ingestion (upload_file), and source listing, enabling AI agents to query private documents like PDFs with high accuracy and real-time citations.
Personal knowledge base MCP server with semantic search, auto-categorization, metadata extraction
The Needle MCP server enables semantic search on documents stored in files like PDFs, DOCX, and XLSX by connecting AI applications to external data sources. It provides capabilities to create and manage document collections, perform natural language searches on stored content, and retrieve relevant information without requiring exact keyword matches.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA Retrieval Augmented Generation MCP server that ingests documents into a local vector database and enables semantic search queries.10-
- FlicenseAqualityDmaintenanceMCP server that enables semantic search over local PDF collections using local RAG, with automatic indexing of new documents.5-
- AlicenseNot gradedqualityAmaintenanceMCP server for local RAG over personal notes, PDFs, and documents, enabling plain-English querying and hybrid search with multi-hop context expansion.MIT
- FlicenseNot gradedqualityCmaintenanceMCP server for retrieving answers from local PDFs using RAG with FAISS and OpenAI.-
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/tycket033-tech/pdf-knowledge-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server