Skip to main content
Glama
grandinh
by grandinh

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

Related MCP server: obsidian-kb

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

  1. Set GitHub Token:

export GITHUB_TOKEN="your_github_pat_here"

Or authenticate with Claude Code (token will be auto-detected from ~/.claude/.credentials.json).

  1. 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
  1. 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:

  1. Edit ~/.claude-kb/data/blocklist.json

  2. Set allowOverride: true on the entry

  3. 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:

  1. Token has repo scope

  2. Repository exists and you have access

  3. Network connectivity

Knowledge base not updating

  1. Check ~/.claude-kb/config.json - ensure sync.enabled: true

  2. Manually trigger: update_knowledge_base tool

  3. 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:

  1. Fork the repository

  2. Create a feature branch

  3. Add tests for new functionality

  4. Submit a pull request

License

MIT License - see LICENSE file

Author

Harrison Grandin

Acknowledgments

Available Tools

6 tools
add_blocklist_entryA

Add an entry to the blocklist. Can block MCP servers or exclude file patterns from indexing.

ParametersJSON Schema
NameRequiredDescriptionDefault
typeYesType of blocklist entry
reasonYesReason for blocking/excluding
patternNoGlob pattern (for file_pattern type)
serverNameNoMCP server name (for server type)

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the behavioral disclosure burden. It reveals the core effect (blocking servers or excluding file patterns from indexing) but does not mention persistence, reversibility, duplicate handling, or any permissions required. The behavioral disclosure is partial.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences deliver the purpose and the two behavioral modes with no filler. The core action is front-loaded, and every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description plus fully documented schema provides enough information for an agent to call this tool correctly. It lacks guidance on subtle behavior like whether pattern or serverName is conditionally required, but those are inferable from the schema descriptions and enum.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all four parameters. The description adds little beyond restating the two modes, which the 'type' enum and parameter descriptions already convey. This matches the baseline for full schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Add') with a clear resource ('blocklist') and explicitly distinguishes two entry types: blocking MCP servers and excluding file patterns from indexing. This clearly separates it from sibling tools like check_blocklist and update_knowledge_base.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use the tool: to block MCP servers or exclude file patterns from indexing. It does not explicitly name alternatives or when-not-to-use, but the use cases are concrete enough to guide an agent.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

check_blocklistC

Check if a server or file pattern is blocked.

ParametersJSON Schema
NameRequiredDescriptionDefault
patternNoFile pattern to check
serverNameNoServer name to check

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must fully disclose behavior, but it only says 'check if ... blocked.' It does not state the return value, whether the operation is read-only, or how it behaves with both parameters provided. This is a minimal disclosure with no side-effect or result semantics.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single succinct sentence that front-loads the operation and its target. No filler or redundant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with two optional parameters and no output schema, the description omits critical context: expected return type, behavior when both parameters are supplied, and any prerequisites. The agent must guess these details, making the definition incomplete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the parameters are already documented in the schema. The description's 'server or file pattern' loosely maps to the properties but adds no new meaning about how the parameters interact or whether one or both are expected.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('check') and resource ('blocklist') with the specific scope of server names and file patterns. It is distinguishable from the sibling 'add_blocklist_entry' by the opposite verb, though it does not explicitly name that alternative.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to use this tool versus alternatives, such as when to call add_blocklist_entry instead. The description only states what it does, leaving usage context to be inferred from the tool name and siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_mcp_specificationA

Get the current MCP protocol specification, best practices, and common patterns. Always up-to-date knowledge about MCP development.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full behavioral burden. It discloses that the knowledge is always up-to-date and lists the content domains covered. However, it omits output format, size, and any side-effect information, which is a notable gap for an unannotated getter tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two short sentences with the core purpose front-loaded. The second sentence reinforces the up-to-date nature but is slightly redundant; overall it is efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter tool, the description adequately conveys the subject matter and currency. However, without an output schema or annotations, it would be more complete if it stated what the response looks like, such as a markdown document or structured data.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters and the schema documents this fully with an empty object. The baseline of 4 for zero-parameter tools applies; no additional parameter explanation is needed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly identifies the resource and action: 'Get the current MCP protocol specification, best practices, and common patterns.' This distinguishes it from the sibling tools by subject matter, though it does not explicitly call out the difference from search_knowledge_base.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when current, up-to-date MCP development knowledge is needed, especially through the 'Always up-to-date' phrase. However, it provides no explicit guidance on when to prefer this tool over siblings like search_knowledge_base, nor any exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_repositoriesA

List all repositories currently indexed in the knowledge base with file counts.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the burden of behavior disclosure. 'List' clearly implies a read-only operation, and 'currently indexed' adds statefulness, but the description does not explicitly mention lack of side effects, ordering, pagination, or access requirements.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single, well-structured sentence that states the action, scope, and result in one breath. No filler or repetition; every word contributes to the agent's understanding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a parameterless list tool with no output schema, the description covers the core behavior and return content ('repositories' with 'file counts'). It lacks explicit notes on default ordering, empty results, or read-only guarantees, but these are minor for the apparent simplicity of the operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, so the schema is trivially complete. The description appropriately avoids inventing unnecessary parameter details; baseline 4 applies because there is nothing for the description to add.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('List') with a clear resource ('repositories currently indexed in the knowledge base') and adds output detail ('with file counts'). It is immediately distinguishable from sibling tools like search_knowledge_base or update_knowledge_base.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The intended use is implied: call this when you need an inventory of indexed repositories and their file counts. However, it does not explicitly contrast with alternatives or state when not to use it, leaving the agent to infer the right scenario.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_knowledge_baseA

Search the MCP knowledge base for documentation, examples, and best practices. Searches across official MCP repos, community servers, and your repositories with .claude/ directories.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query for MCP documentation
maxResultsNoMaximum number of results to return

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden of behavioral disclosure. It communicates the search scope across multiple repository types and implies a read-only operation, but it does not mention result behavior, external network access, or any side effects. The cross-repository scope is useful, though the broader behavioral profile is incomplete.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences with no wasted words. The primary action and object are front-loaded in the first sentence, and the second sentence expands the search scope with concrete source categories. Every clause earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simple two-parameter schema and read-only search nature, the description is largely complete: it states purpose, content types, and sources. It does not describe the result format, which would be needed if there were no output schema, but the overall information is sufficient for an agent to decide to call this tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so both query and maxResults are already well documented with types, defaults, and constraints. The description adds no additional meaning about query syntax or result limits beyond what the schema provides, so it meets the baseline but does not improve on it.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific action ('Search') and a clear resource ('the MCP knowledge base'), then narrows the scope with content types ('documentation, examples, and best practices') and sources ('official MCP repos, community servers, and your repositories with .claude/ directories'). This differentiates it from siblings like get_mcp_specification and update_knowledge_base.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use the tool — when looking for documentation, examples, or best practices — but it does not explicitly state when not to use it or which sibling alternative to prefer. There is no exclusion for 'use get_mcp_specification instead', leaving the agent to infer routing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

update_knowledge_baseA

Manually trigger a knowledge base update from GitHub. Normally happens automatically every 30 minutes.

ParametersJSON Schema
NameRequiredDescriptionDefault
forceNoForce update even if recently synced

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full behavioral disclosure burden. It does reveal that the tool is a manual trigger and that automation runs every 30 minutes, but it does not discuss side effects, async behavior, required permissions, or what happens after the update is triggered.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences deliver the core action and the relevant automation context without waste. The description is front-loaded with the imperative action and the automatic cadence immediately follows.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple one-parameter trigger with no output schema, the description covers the essential what and when. It could be more complete by noting whether the update is synchronous or asynchronous, but it is adequate for tool selection and invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema fully documents the single 'force' parameter with a clear description, so the description does not need to repeat it. Baseline 3 applies because schema coverage is high and the tool description adds no additional parameter-level meaning.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action: manually triggering a knowledge base update from GitHub. It uses an unambiguous verb and resource, and it is easily distinguished from the sibling tools like search_knowledge_base or list_repositories.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The mention that updates normally happen automatically every 30 minutes gives clear context that this tool is for out-of-band manual refreshes. It does not explicitly name alternatives or exclusion conditions, but the intended usage is reasonably inferable.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 6 tool updatesv0.1.0
    • First observedadd_blocklist_entry
    • First observedcheck_blocklist
    • First observedget_mcp_specification
    • First observedlist_repositories
    • First observedsearch_knowledge_base
    • First observedupdate_knowledge_base

TDQS

A3.7/5.0

Scored across 6 tools

Disambiguation4/5

Most tools target distinct resource-action pairs, but search_knowledge_base and get_mcp_specification both cover MCP documentation and best practices and could be confused. The descriptions help by distinguishing broad search from canonical spec retrieval, so the ambiguity is limited.

Naming Consistency5/5

All tool names consistently follow a verb_noun pattern: search, list, get, add, check, update. Multiword objects like blocklist_entry and knowledge_base do not break the predictability of the naming convention.

Tool Count5/5

Six tools is a well-scoped count for a knowledge base MCP server. Each tool covers an essential workflow: searching, listing indexed content, retrieving the spec, managing blocklist entries, and triggering updates.

Completeness3/5

The core search, listing, spec retrieval, and update workflows are covered, but the blocklist lifecycle is incomplete—there is no way to remove an entry or list all blocked entries. An accidental blocklist addition becomes a dead end for the agent.

Related MCP Connectors

Related MCP Servers

  • F
    license
    B
    quality
    D
    maintenance
    An MCP server that enables interaction with Markdown knowledge bases, allowing users to search and retrieve content by tags, text, URL, or date range from their local markdown files.
    7
    92
    -
  • F
    license
    C
    quality
    D
    maintenance
    Git-backed MCP server for creating and maintaining an Obsidian-style markdown knowledge base with full CRUD, search, and git sync.
    7
    -
  • F
    license
    A
    quality
    B
    maintenance
    An MCP server that acts as a knowledge engine for software projects, delivering relevant context at the start of a task and accumulating knowledge at its end through tools like start_task, context, finish_task, remember, and search, with a file-based source of truth and optional semantic retrieval via Graphiti/Neo4j.
    5
    -