Token导航 LogoToken导航TokenDH.com
Claude MCP Kb logo
文档知识stdio官方级别未说明来源级核验

Claude MCP Kb

MCP Server

@grandinharrison/claude-mcp-kb

一个用于Model Context Protocol (MCP)开发的持久化知识库服务器,具有GitHub集成和移除阻止列表功能,旨在消除重复的MCP研究。

工具数

0

提示词数

0

GitHub Stars

0

资源数

0
知识管理TypeScriptClaudeClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

grandinh

提供方

grandinh

最后核验

2026/5/17 20:23

运行时

Node.js

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

npx @grandinharrison/claude-mcp-kb

详细介绍

Claude MCP知识库

消除重复的MCP研究 -用于模型上下文协议(MCP)开发的持久知识库服务器,具有GitHub集成和删除块列表功能。

特性

  • 零研究MCP创建:内置MCP规范、最佳实践和模式知识
  • 始终保持最新:从官方MCP存储库和社区示例自动同步
  • GitHub集成:索引您的 .claude/ 所有存储库中的目录
  • 删除阻止列表:跟踪已删除的MCP并永久排除文件模式
  • 定期同步:每30分钟自动更新一次知识库(可配置)
  • 快速搜索:在所有索引文档中进行基于关键字的搜索

快速开始

先决条件

  • Node.js≥18
  • GitHub个人访问令牌(用于索引仓库)

安装

npm install -g @grandinharrison/claude-mcp-kb

或与 npx:

npx @grandinharrison/claude-mcp-kb

设置

  1. 设置GitHub令牌:
export GITHUB_TOKEN="your_github_pat_here"

或者使用Claude Code进行身份验证(令牌将从以下位置自动检测 ~/.claude/.credentials.json).

  1. 添加到克劳德代码:

添加到您的 .claude/settings.json:

{
  "mcpServers": {
    "knowledge-base": {
      "command": "npx",
      "args": ["-y", "@grandinharrison/claude-mcp-kb"],
      "env": {
        "GITHUB_TOKEN": "your_token_here"
      }
    }
  }
}

或者使用CLI:

claude mcp add --transport stdio knowledge-base -- npx @grandinharrison/claude-mcp-kb
  1. 首次运行:

服务器将自动:

  • 创建 ~/.claude-kb/ 目录
  • 索引官方MCP存储库
  • 通过以下方式发现您的存储库 .claude/ 目录
  • 开始定期同步(每30分钟一次)

用法

可用工具

search_knowledge_base

搜索MCP文档、示例和最佳实践。

{
  "query": "how to implement MCP tool with error handling",
  "maxResults": 10
}

退货:使用片段和源文件对搜索结果进行排名。

get_mcp_specification

获取当前的MCP协议规范、最佳实践和常见模式。

{}

退货:完整的MCP规范,包括生命周期、传输和功能。

list_repositories

列出所有带有文件计数的索引存储库。

{}

退货:带有计数的存储库列表。

add_blocklist_entry

将MCP服务器或文件模式添加到块列表中。

{
  "type": "file_pattern",
  "pattern": "**/*.secret.md",
  "reason": "Contains sensitive information"
}

或者屏蔽服务器:

{
  "type": "server",
  "serverName": "@example/bad-mcp-server",
  "reason": "Security vulnerability"
}

check_blocklist

检查是否有东西被堵住了。

{
  "serverName": "@example/my-server"
}

update_knowledge_base

手动触发同步(通常为自动)。

{
  "force": true
}

配置

编辑 ~/.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
  }
}

配置选项

  • 仓库:显式配置repos以进行索引
  • sync.intervalMinutes:同步的频率(5-1440分钟)
  • sync.autoDiscoverUserRepos:使用自动查找您的存储库 .claude/ 目录
  • sync.include官方网站:索引模型上下文协议/\*repos
  • sync.includeCommunityRepos:索引出色的mcp服务器列表
  • blocklist.strict:阻止而不提示用户

阻止列表

阻止列表存储在 ~/.claude-kb/data/blocklist.json 作为一个 仅附加日志.

阻止文件模式

{
  "type": "file_pattern",
  "pattern": "**/private/**",
  "reason": "Exclude private directories"
}

阻止MCP服务器

{
  "type": "server",
  "serverName": "@malicious/mcp-server",
  "version": "1.0.0",
  "reason": "Security vulnerability CVE-2025-12345"
}

移除是永久性的

一旦被阻止,条目将永远保留在日志中(除非手动编辑)。要覆盖,请执行以下操作:

  1. 编辑 ~/.claude-kb/data/blocklist.json
  2. allowOverride: true 在入口处
  3. 重新启动服务器

存储结构

~/.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)

发展

从源代码构建

git clone https://github.com/grandinharrison/claude-mcp-kb.git
cd claude-mcp-kb
npm install
npm run build

在开发模式下运行

npm run dev

运行测试

npm test

路线图

电流(v0.1.0)

  • ✅ 基本关键字搜索
  • ✅ GitHub集成
  • ✅ 定期同步
  • ✅ 阻止列表(服务器+文件模式)
  • ✅ 官方MCP回购指数
  • ✅ 自动发现用户存储库

计划(v0.2.0)

  • \[\]矢量搜索(txtai/FAISS集成)
  • \[\]语义相似性评分
  • \[\]MCP服务器模板生成
  • \[\]实时webhook同步
  • \[\]用于块列表管理的Web UI

未来

  • \[\]多云支持(GitLab、Bitbucket)
  • \[\]团队协作功能
  • \[\]使用情况分析
  • \[\]知识图关系

故障排除

“未找到GitHub令牌”

GITHUB_TOKEN 环境变量或使用克劳德代码进行身份验证。

“获取仓库时出错”

检查:

  1. 令牌具有 repo 范围
  2. 存储库已存在,您有权访问
  3. 网络连接

知识库未更新

  1. 检查 ~/.claude-kb/config.json -确保 sync.enabled: true
  2. 手动触发: update_knowledge_base 工具
  3. 检查stderr输出中的日志

搜索速度慢

当前MVP使用关键字搜索。升级到v0.2.0中的矢量搜索,以实现更快的语义搜索。

贡献

欢迎投稿!拜托:

  1. 分叉存储库
  2. 创建要素分支
  3. 添加新功能的测试
  4. 提交拉取请求

许可证

MIT许可证-请参阅许可证文件

作者

哈里森·格兰丁

致谢

目录标签

目录标签

知识管理TypeScriptClaude本地部署GitHub集成MCP开发自动同步阻止列表

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Node.js

来源包(packageName,安装包名)

@grandinharrison/claude-mcp-kb

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP