Knowledge Base MCP Server
A zero-dependency MCP server that provides a persistent personal knowledge base for Claude using local JSON file storage. It enables users to manage notes through tools for adding, searching, and indexing content built entirely with Node.js built-ins.
README
š§ Knowledge Base MCP Server
A zero-dependency Model Context Protocol (MCP) server that gives Claude a persistent personal knowledge base ā built entirely with Node.js built-ins.
What is MCP?
The Model Context Protocol is an open standard (by Anthropic) that lets AI assistants talk to external tools and data sources in a structured, secure way. Think of it as a universal plugin system for LLMs.
āāāāāāāāāāāāāāāāāāā JSON-RPC 2.0 āāāāāāāāāāāāāāāāāāāāāāāā
ā Claude Desktop ā āāāāāāā stdio āāāāāāāāāāāŗ ā knowledge-mcp ā
ā (MCP host) ā ā (this server) ā
āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāāāāāā
ā ā
ā calls tools like kb_search(query="python") ā
ā reads resources like kb://notes ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Every message is a JSON-RPC 2.0 object sent over stdin/stdout.
Architecture
server.js
āāā Persistence layer loadDB / saveDB (JSON file in ~/)
āāā Business logic noteAdd / noteSearch / noteList / noteDelete / noteStats
āāā MCP dispatch table dispatch(method, params, db) ā result | error
āāā stdio transport readline loop ā JSON-RPC framing
The MCP Handshake
client ā server: initialize { protocolVersion, clientInfo }
server ā client: result { protocolVersion, capabilities, serverInfo }
client ā server: notifications/initialized (no response expected)
After this, the client can call any method at any time.
Tools
| Tool | Description |
|---|---|
kb_add |
Store a note with title, content, and optional tags |
kb_search |
Full-text + tag search (AND logic for multiple tags) |
kb_list |
List all notes, optionally filtered by tag |
kb_delete |
Delete a note by ID |
kb_stats |
Summary stats: note count, tag index, newest/oldest |
Resources
| URI | Description |
|---|---|
kb://notes |
Complete JSON dump of all notes |
kb://tags |
Tag ā note-list index |
Installation
Prerequisites
- Node.js 18+ (no npm packages required)
Add to Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json
(macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"knowledge-base": {
"command": "node",
"args": ["/ABSOLUTE/PATH/TO/knowledge-mcp/server.js"]
}
}
}
Restart Claude Desktop. You'll see a š icon confirming the server connected.
Add to Claude Code (CLI)
claude mcp add knowledge-base node /absolute/path/to/server.js
Running Manually
# Start the server (stays alive, reads from stdin)
node server.js
# Run unit tests
node server.js --test
# Run integration tests (spawns a real server subprocess)
node integration-test.js
Try it interactively
node server.js
Then paste (hit Enter after each line):
{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05"}}
{"jsonrpc":"2.0","method":"notifications/initialized","params":{}}
{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"kb_add","arguments":{"title":"Hello","content":"My first note","tags":["demo"]}}}
{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"kb_search","arguments":{"query":"first"}}}
Key Design Decisions
- Zero dependencies ā Ships as a single file. Works wherever Node ā„ 18 exists.
- File persistence ā Notes survive restarts. DB lives at
~/.knowledge-mcp-db.json. - Strict JSON-RPC ā Correct error codes (-32601 method-not-found, -32603 internal, -32700 parse-error) so MCP hosts can handle errors gracefully.
- Notifications handled ā
notifications/initializedis a one-way message; the server silently ignores it rather than sending a bogus response. - isError flag ā Tool errors use
{ isError: true }per spec, not JSON-RPC errors, so Claude sees the error text rather than a protocol failure.
Data Format
{
"id": "1",
"title": "MCP Guide",
"content": "Model Context Protocol connects AI to tools.",
"tags": ["mcp", "ai"],
"createdAt": "2026-03-09T05:00:00.000Z",
"updatedAt": "2026-03-09T05:00:00.000Z"
}
Extending This Server
To add a new tool:
- Add its logic as a plain function (e.g.
noteUpdate) - Add a descriptor object to the
TOOLSarray - Add a
case 'kb_update':to thetools/callswitch block
That's it ā no framework, no codegen, no magic.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.