add_documentLABSCO SUMMARY
Nothing leaves the machine.
There is no embedding provider to configure and no key to obtain, which makes this cheap to try on documents you would not upload anywhere — the trade is that retrieval is similarity over a local index rather than a hosted vector service. The threshold argument on the query is what you tune when answers come back too loose or too empty.
What it is
A TypeScript MCP server that indexes documents on your own machine and answers questions against them by similarity. It handles PDF, DOCX, TXT and HTML, and is written with Chinese-language documents in mind as well as English.
What you get
- Ingestion —
add_documentfor one file by path,add_directoryto take everything in a folder query_knowledge_base— ask a question and get matching passages, with arguments for how many results to return and a similarity threshold to cut weak matches- Management —
list_documents,get_documentfor one by id,remove_document,clear_knowledge_base get_statsfor what the index currently holds- Automatic indexing on ingest, with the documents and index kept in their own directories beside the server
Requirements
Node and npm — clone, npm install, npm run build, then point your client at dist/index.js. No API keys and no external service: indexing and retrieval both run locally. The server creates a documents directory and an index directory on first use, so run it somewhere you are happy for those to live. MIT licensed.
Setup effort
Build from source — git clone https://github.com/ikungsjl/mcp-knowledge-base.git
USE CASES
Asking questions of a folder of PDFs
Add the directory once, then query it in words instead of opening files to search them one by one.
Keeping the index honest
List what is indexed, drop the documents that went stale, and check the stats before you trust an answer.
Tightening loose answers
Raise the similarity threshold and cap the result count so the assistant reads the best passages rather than everything nearby.
8 tools
Listed in project docs. Your client may show a different list.
add_directoryquery_knowledge_baselist_documentsget_documentremove_documentclear_knowledge_baseget_statsBEFORE YOU INSTALL
What to know first
Tools you get
8 tools named in the project's documentation.
Requires
node on PATH
Where it runs
The documented client runs the server on your machine.
INSTALLATION
Connect your client
Server setup
git clone https://github.com/ikungsjl/mcp-knowledge-base.git
cd mcp-knowledge-base
npm install
npm run buildMCP Clients
Any MCP client
{
"mcpServers": {
"knowledge-base": {
"command": "node",
"args": [
"<YOUR_PATH_TO_MCP_KNOWLEDGE_BASE>/dist/index.js"
],
"env": {}
}
}
}<YOUR_PATH_TO_MCP_KNOWLEDGE_BASE> is the full path of your clone — the project's own block uses the relative dist/index.js, which only works if the client starts the server inside the clone. The server keeps its documents/ and index/ folders in the directory it is started from.