Knowledge Base MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
npm install
npm run build
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add knowledge-base -- node "<FULL_PATH_TO_LOCAL_MCP_SIMPLE>/dist/index.js"

Replace <FULL_PATH_TO_LOCAL_MCP_SIMPLE>/dist/index.js with the actual folder you prepared in step 1.

README.md

A local MCP server that enables AI systems to search and query a knowledge base.

Knowledge Base MCP Server

A local MCP (Model Context Protocol) server that enables AI systems like Claude Desktop to search and query a knowledge base.

Features

  • Text Search: Search the knowledge base using natural language queries
  • Chunk Retrieval: Get specific chunks by ID for detailed information
  • Category Listing: Browse available topics in the knowledge base

Installation

# Install dependencies
npm install

# Build the TypeScript code
npm run build

Available MCP Tools

Tool Description
search_knowledge Search for relevant information using a query string
get_chunk Retrieve a specific chunk by its ID
list_categories List all available categories in the knowledge base

Connecting to Claude Desktop

Add this server to your Claude Desktop configuration:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "knowledge-base": {
      "command": "node",
      "args": ["/path/to/local-mcp-simple/dist/index.js"]
    }
  }
}

After updating the config, restart Claude Desktop. You can then ask Claude to search the knowledge base, for example:

"Search the knowledge base for speed limits in school zones"

Development

# Build and run
npm run dev

# Or run separately
npm run build
npm start

Generating Knowledge Base

You can generate a new knowledge.json from any markdown file using the included script:

# Generate from a markdown file
npm run generate-knowledge -- ./path/to/your-document.md

# Specify output location
npm run generate-knowledge -- ./docs/handbook.md ./src/knowledge/knowledge.json

Markdown Format

The script parses markdown headings to create chunks:

  • H1 (#) - Sets the category for subsequent chunks
  • H2 (##) - Creates a new chunk with this title
  • H3 (###) - Also creates a new chunk with this title
  • H4 (####) - Included as bold text within the current chunk

Example markdown:

# Licences

## Getting your driver licence

To get a full driver licence, you need to go through three stages...

## Learner licence restrictions

There are licence restrictions that you need to follow...

# Speed Limits

## The rules

On roads where there's a speed limit sign, you must not drive faster...

This would create 3 chunks:

  1. "Getting your driver licence" (category: "Licences")
  2. "Learner licence restrictions" (category: "Licences")
  3. "The rules" (category: "Speed Limits")

Knowledge Base

The server uses src/knowledge/knowledge.json which contains pre-chunked content for search.

Tools (3)

search_knowledgeSearch for relevant information using a query string
get_chunkRetrieve a specific chunk by its ID
list_categoriesList all available categories in the knowledge base

Configuration

claude_desktop_config.json
{"mcpServers": {"knowledge-base": {"command": "node", "args": ["/path/to/local-mcp-simple/dist/index.js"]}}}

Try it

Search the knowledge base for speed limits in school zones
List all the categories available in my knowledge base
Get the content for the chunk with ID 123
Find information about driver licence restrictions in the knowledge base

Frequently Asked Questions

What are the key features of Knowledge Base MCP Server?

Natural language text search across markdown-based knowledge. Specific content chunk retrieval by ID. Category browsing for organized knowledge navigation. Automated knowledge base generation from markdown files.

What can I use Knowledge Base MCP Server for?

Querying internal company handbooks or documentation. Searching through personal notes or research markdown files. Providing AI access to specific project guidelines or rules. Organizing large markdown documentation sets for quick AI retrieval.

How do I install Knowledge Base MCP Server?

Install Knowledge Base MCP Server by running: npm install && npm run build

What MCP clients work with Knowledge Base MCP Server?

Knowledge Base MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Knowledge Base MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare