Claude MCP Knowledge Base
A persistent knowledge base server for MCP development with GitHub integration and removal blocklist.
README
Claude MCP Knowledge Base
Eliminate repeated MCP research - A persistent knowledge base server for Model Context Protocol (MCP) development with GitHub integration and removal blocklist.
Features
- Zero-Research MCP Creation: Built-in knowledge of MCP specifications, best practices, and patterns
- Always Up-to-Date: Automatically syncs from official MCP repositories and community examples
- GitHub Integration: Indexes your
.claude/directories across all repositories - Removal Blocklist: Track deleted MCPs and exclude file patterns permanently
- Periodic Sync: Auto-updates knowledge base every 30 minutes (configurable)
- Fast Search: Keyword-based search across all indexed documentation
Quick Start
Prerequisites
- Node.js ≥18
- GitHub Personal Access Token (for indexing repos)
Installation
npm install -g @grandinharrison/claude-mcp-kb
Or use with npx:
npx @grandinharrison/claude-mcp-kb
Setup
- Set GitHub Token:
export GITHUB_TOKEN="your_github_pat_here"
Or authenticate with Claude Code (token will be auto-detected from ~/.claude/.credentials.json).
- Add to Claude Code:
Add to your .claude/settings.json:
{
"mcpServers": {
"knowledge-base": {
"command": "npx",
"args": ["-y", "@grandinharrison/claude-mcp-kb"],
"env": {
"GITHUB_TOKEN": "your_token_here"
}
}
}
}
Or use the CLI:
claude mcp add --transport stdio knowledge-base -- npx @grandinharrison/claude-mcp-kb
- First Run:
The server will automatically:
- Create
~/.claude-kb/directory - Index official MCP repositories
- Discover your repos with
.claude/directories - Start periodic sync (every 30 minutes)
Usage
Available Tools
search_knowledge_base
Search MCP documentation, examples, and best practices.
{
"query": "how to implement MCP tool with error handling",
"maxResults": 10
}
Returns: Ranked search results with snippets and source files.
get_mcp_specification
Get current MCP protocol spec, best practices, and common patterns.
{}
Returns: Complete MCP specification with lifecycle, transports, capabilities.
list_repositories
List all indexed repositories with file counts.
{}
Returns: Repository list with counts.
add_blocklist_entry
Add MCP server or file pattern to blocklist.
{
"type": "file_pattern",
"pattern": "**/*.secret.md",
"reason": "Contains sensitive information"
}
Or block a server:
{
"type": "server",
"serverName": "@example/bad-mcp-server",
"reason": "Security vulnerability"
}
check_blocklist
Check if something is blocked.
{
"serverName": "@example/my-server"
}
update_knowledge_base
Manually trigger sync (normally automatic).
{
"force": true
}
Configuration
Edit ~/.claude-kb/config.json:
{
"version": "1.0.0",
"repositories": [
{
"owner": "your-org",
"repo": "your-repo",
"branch": "main",
"includePatterns": [".claude/**/*.md"],
"excludePatterns": ["**/node_modules/**"],
"indexingEnabled": true,
"type": "user"
}
],
"sync": {
"enabled": true,
"intervalMinutes": 30,
"autoDiscoverUserRepos": true,
"includeOfficialMCPRepos": true,
"includeCommunityRepos": true
},
"storage": {
"cacheDir": "~/.claude-kb",
"maxIndexSizeMB": 1000
},
"blocklist": {
"enabled": true,
"strict": true
}
}
Configuration Options
- repositories: Explicitly configured repos to index
- sync.intervalMinutes: How often to sync (5-1440 minutes)
- sync.autoDiscoverUserRepos: Auto-find your repos with
.claude/dirs - sync.includeOfficialMCPRepos: Index modelcontextprotocol/* repos
- sync.includeCommunityRepos: Index awesome-mcp-servers lists
- blocklist.strict: Block without prompting user
Blocklist
The blocklist is stored in ~/.claude-kb/data/blocklist.json as an append-only log.
Block a File Pattern
{
"type": "file_pattern",
"pattern": "**/private/**",
"reason": "Exclude private directories"
}
Block an MCP Server
{
"type": "server",
"serverName": "@malicious/mcp-server",
"version": "1.0.0",
"reason": "Security vulnerability CVE-2025-12345"
}
Removal is Permanent
Once blocked, entries remain in the log forever (unless manually edited). To override:
- Edit
~/.claude-kb/data/blocklist.json - Set
allowOverride: trueon the entry - Restart server
Storage Structure
~/.claude-kb/
├── config.json # Configuration
├── data/
│ ├── specification.json # MCP spec cache
│ └── blocklist.json # Blocklist log
├── repos/ # Cached repository content
│ ├── modelcontextprotocol/
│ │ └── servers/
│ └── your-username/
│ └── your-repo/
└── templates/ # MCP templates (future)
Development
Build from Source
git clone https://github.com/grandinharrison/claude-mcp-kb.git
cd claude-mcp-kb
npm install
npm run build
Run in Dev Mode
npm run dev
Run Tests
npm test
Roadmap
Current (v0.1.0)
- ✅ Basic keyword search
- ✅ GitHub integration
- ✅ Periodic sync
- ✅ Blocklist (servers + file patterns)
- ✅ Official MCP repos indexing
- ✅ Auto-discover user repos
Planned (v0.2.0)
- [ ] Vector search (txtai/FAISS integration)
- [ ] Semantic similarity scoring
- [ ] MCP server templates generation
- [ ] Real-time webhook sync
- [ ] Web UI for blocklist management
Future
- [ ] Multi-cloud support (GitLab, Bitbucket)
- [ ] Team collaboration features
- [ ] Usage analytics
- [ ] Knowledge graph relationships
Troubleshooting
"GitHub token not found"
Set GITHUB_TOKEN environment variable or authenticate with Claude Code.
"Error fetching repo"
Check:
- Token has
reposcope - Repository exists and you have access
- Network connectivity
Knowledge base not updating
- Check
~/.claude-kb/config.json- ensuresync.enabled: true - Manually trigger:
update_knowledge_basetool - Check logs in stderr output
Slow searches
Current MVP uses keyword search. Upgrade to vector search in v0.2.0 for faster semantic search.
Contributing
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Submit a pull request
License
MIT License - see LICENSE file
Author
Harrison Grandin
Acknowledgments
- Built on @modelcontextprotocol/sdk
- Inspired by the MCP community
- Special thanks to Anthropic for Claude Code
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。