Knowledge Base MCP Server

Knowledge Base MCP Server

Enables AI assistants to manage a personal markdown-based knowledge base with natural language interactions. Supports creating, searching, updating, and organizing notes across categories like people, recipes, meetings, and procedures.

Category
访问服务器

README

Knowledge Base MCP Server

A Model Context Protocol (MCP) server for managing a personal markdown-based knowledge base. Enable AI assistants like Claude to read, search, and update your notes naturally.

Overview

This MCP server provides AI-native access to a personal knowledge base stored as markdown files with YAML frontmatter. It allows you to:

  • Create and organize notes across multiple categories
  • Search through your knowledge base using natural language
  • Update and maintain notes with AI assistance
  • Keep all data in human-readable, portable markdown format
  • Access your notes from Claude Desktop, Claude Code, or any MCP-compatible client

Features

Core Capabilities

  • 7 MCP Tools for complete knowledge base management

    • add_note - Create new notes
    • search_notes - Search by content, tags, or category
    • get_note - Retrieve full note content
    • update_note - Modify existing notes (replace or append)
    • list_notes - List notes with optional filters
    • delete_note - Remove notes (with backup)
    • list_categories - View all categories and counts
  • Smart Search with relevance scoring

    • Search across titles, content, tags, and metadata
    • Case-insensitive matching
    • Filter by category or tags
    • Ranked results by relevance
  • Flexible Organization

    • Default categories: people, recipes, meetings, procedures, tasks
    • Configurable category system
    • Tag-based organization
    • Rich metadata support
  • Data Safety

    • Automatic backups before updates
    • Atomic file writes
    • Human-readable markdown format
    • No vendor lock-in

Installation

Prerequisites

  • Python 3.11 or higher
  • uv package manager (recommended) or pip

Install with uv (Recommended)

# Clone the repository
git clone <repository-url>
cd knowledge-base-mcp

# Install dependencies
uv sync

# The server is now ready to use

Install with pip

# Clone the repository
git clone <repository-url>
cd knowledge-base-mcp

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install in development mode
pip install -e .

Configuration

Environment Variables

Create a .env file in the project root (optional):

# Knowledge base location (default: ~/knowledge-base)
KNOWLEDGE_BASE_PATH=~/knowledge-base

# Categories (comma-separated)
CATEGORIES=people,recipes,meetings,procedures,tasks

# Server settings
SERVER_NAME=Knowledge Base
LOG_LEVEL=INFO

Claude Desktop Setup

Add the server to your Claude Desktop configuration:

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

Windows: %APPDATA%\Claude\claude_desktop_config.json

Linux: ~/.config/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "knowledge-base": {
      "command": "uv",
      "args": [
        "--directory",
        "/absolute/path/to/knowledge-base-mcp",
        "run",
        "knowledge-base-server"
      ]
    }
  }
}

Alternative (using pip/venv):

{
  "mcpServers": {
    "knowledge-base": {
      "command": "/absolute/path/to/venv/bin/python",
      "args": [
        "-m",
        "knowledge_base_mcp.server"
      ],
      "env": {
        "KNOWLEDGE_BASE_PATH": "/path/to/your/knowledge-base"
      }
    }
  }
}

After configuration, restart Claude Desktop.

Usage

Example Interactions

Adding Notes

You: "I just met Sarah Chen at a conference. She works at Tesla on battery
     tech and is interested in our AI product. Tag this as important."

Claude: [Calls add_note tool]
✓ Note 'Sarah Chen' created in people/
  File: sarah-chen.md
  Tags: conference, tesla, important

Searching

You: "Who did I meet that works on batteries?"

Claude: [Calls search_notes with query="batteries"]
Found 1 result(s):

[people] Sarah Chen [conference, tesla, batteries, important]
   Battery engineer at Tesla. Met at tech conference. Interested in AI...

Retrieving Notes

You: "Show me my note about Sarah Chen"

Claude: [Calls get_note tool]
# Sarah Chen

**Category:** people
**Tags:** conference, tesla, batteries, important
**Date:** 2025-10-21

---

Battery engineer at Tesla...

Updating Notes

You: "Add to Sarah Chen's note that we scheduled a call for next Tuesday"

Claude: [Calls update_note with append=True]
✓ Note 'Sarah Chen' updated successfully
  Category: people
  Last updated: 2025-10-22

Quick Reference

You: "How long do I cook brussels sprouts in the air fryer?"

Claude: [Calls search_notes with query="brussels sprouts"]
Found 1 result(s):

[recipes] Brussels Sprouts [quick, vegetables, air-fryer]
   Cook at 400°F for 15-18 minutes, shake halfway through...

Knowledge Base Structure

Your knowledge base is stored as markdown files in a simple folder structure:

~/knowledge-base/
├── people/
│   ├── sarah-chen.md
│   ├── john-doe.md
│   └── ...
├── recipes/
│   ├── brussels-sprouts.md
│   ├── chocolate-cake.md
│   └── ...
├── meetings/
│   └── q4-planning.md
├── procedures/
│   └── onboarding-checklist.md
└── tasks/
    └── launch-preparation.md

Markdown Format

Each note is a markdown file with YAML frontmatter:

---
tags: [conference, tesla, batteries, important]
date: 2025-10-21
category: people
company: Tesla
role: Battery Engineer
email: sarah.chen@tesla.com
---

# Sarah Chen

**Met:** Tech Conference 2025, Silicon Valley
**Contact:** sarah.chen@tesla.com

## Notes

Interested in our AI product for battery optimization.
Has budget approval for Q1 2026.

## Follow-up

- [ ] Send demo link by end of week
- [ ] Schedule call for next Tuesday

Metadata Fields

Required:

  • tags: List of tags for categorization
  • date: Creation date (YYYY-MM-DD)
  • category: Category folder name

Optional (category-specific):

  • People: company, role, email, phone
  • Recipes: prep_time, cook_time, servings
  • Meetings: attendees, meeting_date, location
  • Tasks: priority, due_date, status

You can add any custom metadata fields as needed.

Development

Running Tests

# With uv
uv run pytest

# With pip
pytest

# Run specific test file
pytest tests/test_storage.py

# Run with coverage
pytest --cov=knowledge_base_mcp tests/

Project Structure

knowledge-base-mcp/
├── src/
│   └── knowledge_base_mcp/
│       ├── __init__.py
│       ├── server.py       # MCP server and tools
│       ├── storage.py      # File operations
│       ├── search.py       # Search functionality
│       └── models.py       # Data models
├── tests/
│   ├── test_server.py      # Integration tests
│   ├── test_storage.py     # Storage layer tests
│   └── test_search.py      # Search tests
├── examples/
│   └── sample-notes/       # Example notes
├── pyproject.toml          # Project configuration
└── README.md

Adding Custom Categories

Edit your .env file or environment configuration:

CATEGORIES=people,recipes,meetings,procedures,tasks,books,articles,ideas

The server will automatically create folders for new categories.

Troubleshooting

Common Issues

Server not appearing in Claude Desktop:

  • Verify the path in claude_desktop_config.json is absolute
  • Check that the command path is correct (uv or python path)
  • Restart Claude Desktop completely
  • Check Claude Desktop logs for errors

Notes not being created:

  • Verify KNOWLEDGE_BASE_PATH exists and is writable
  • Check file permissions
  • Ensure category is valid (use list_categories tool)

Search not finding notes:

  • Verify notes have proper YAML frontmatter
  • Check that tags are formatted as lists
  • Try searching with simpler queries
  • Use list_notes to see what notes exist

Permission errors:

  • Ensure the knowledge base directory has write permissions
  • On macOS, you may need to grant Claude Desktop disk access in System Preferences

Viewing Logs

Claude Desktop logs can help diagnose issues:

  • macOS: ~/Library/Logs/Claude/
  • Windows: %APPDATA%\Claude\logs\
  • Linux: ~/.config/Claude/logs/

Use Cases

Conference CRM

Track people you meet at conferences with contact info, notes, and follow-up tasks.

Recipe Collection

Store recipes with tags, cook times, and personal notes about modifications.

Meeting Notes

Keep meeting agendas, discussion points, and action items organized by topic.

Procedure Documentation

Maintain step-by-step procedures and checklists for recurring tasks.

Task Management

Track projects, deadlines, and task lists with priorities and status.

Integration with Other Tools

Obsidian

The markdown format is fully compatible with Obsidian. You can:

  • Open the knowledge base in Obsidian
  • Edit notes in either Obsidian or via Claude
  • Use Obsidian mobile for on-the-go access
  • Sync via Obsidian Sync or iCloud

Git Version Control

Consider adding git version control to your knowledge base:

cd ~/knowledge-base
git init
git add .
git commit -m "Initial knowledge base"

This provides:

  • Version history of all changes
  • Ability to revert changes
  • Backup to remote repository
  • Collaboration capabilities

File Sync

Use any file sync service:

  • iCloud Drive
  • Dropbox
  • Google Drive
  • Syncthing

Roadmap

Phase 2 Features (Planned)

  • HTTP API for web and mobile access
  • Web UI for browsing and editing
  • AI pendant integration via webhooks
  • Automatic summarization and insights
  • Calendar integration
  • Email integration

Future Considerations

  • Multi-user support
  • Real-time collaboration
  • Advanced search with embeddings
  • Automatic tagging suggestions
  • Template system for note types

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Add tests for new functionality
  4. Ensure all tests pass
  5. Submit a pull request

License

MIT License - see LICENSE file for details

Support

  • Report issues: [GitHub Issues]
  • Documentation: MCP Documentation
  • Community: [MCP Discord]

Acknowledgments

Built with:


Made with Claude Code

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选