Skip to main content
Glama
Company KB MCP
by yunusb

Company KB MCP

Company KB MCP is a local-first Model Context Protocol server that lets AI coding assistants search company Markdown knowledge stored in GitLab repositories.

It is designed for GitHub Copilot and Claude Code. The server clones selected GitLab repositories into a local cache, indexes Markdown and MDX files into a local SQLite database, and exposes MCP tools for search, cited answers, document opening, repository sync, and repository removal.

The server is read-only. It does not write to GitLab, push commits, create branches, or update source files.

What It Does

  • Adds GitLab repositories by URL.

  • Clones or refreshes shallow local repository mirrors.

  • Indexes Markdown, MDX, README, docs, ADR, runbook, and playbook content.

  • Stores repository, document, chunk, and keyword-search data in SQLite.

  • Optionally stores local vector embeddings with sqlite-vec and FastEmbed.

  • Returns snippets with GitLab source metadata and canonical source URLs.

  • Redacts secret-looking values from logs and tool responses.

Related MCP server: Qurio MCP Server

How It Works

  1. A user installs the MCP from the private marketplace.

  2. GitHub Copilot or Claude Code starts the MCP server over stdio.

  3. The user asks the assistant to add a GitLab repository.

  4. The MCP server resolves the GitLab project, clones it locally, and indexes Markdown files.

  5. Later questions use local keyword search, optional semantic search, or both.

  6. The assistant receives cited evidence and uses it to answer the user.

The local index stays on the user's machine. Private repositories require the user to provide a GitLab token through an environment variable.

Install From Private Marketplace

The exact marketplace URL and package registry details are placeholders for now.

GitHub Copilot

  1. Open the private plugin marketplace.

  2. Search for Company KB.

  3. Install the GitHub Copilot target.

  4. If prompted, provide a GitLab token secret named GITLAB_TOKEN.

  5. Restart or reload the IDE MCP tools.

Expected MCP configuration shape:

{
  "servers": {
    "company-kb": {
      "type": "stdio",
      "command": "uvx",
      "args": ["--from", "company-kb-mcp==0.1.0", "company-kb-mcp", "serve"]
    }
  }
}

Claude Code

  1. Open the private plugin marketplace.

  2. Search for Company KB.

  3. Install the Claude Code target, or run the marketplace-generated install command.

  4. Set GITLAB_TOKEN in your shell if you need private repository access.

  5. Start or reload Claude Code and run /mcp to confirm the server is connected.

Expected Claude Code command shape:

claude mcp add-json --scope user company-kb \
  '{"type":"stdio","command":"uvx","args":["--from","company-kb-mcp==0.1.0","company-kb-mcp","serve"],"env":{"GITLAB_TOKEN":"${GITLAB_TOKEN:-}"}}'

Basic Usage

After installation, ask your assistant to add a repository:

Use company-kb to sync https://gitlab.com/gitlab-org/cli

Then ask questions that need company documentation:

Search company-kb for the deployment runbook for the billing service.
Use company-kb to answer with citations: how do we rotate production credentials?

Useful actions:

  • Add a repository: call company_kb_sync_repository with a GitLab URL.

  • Refresh known repositories: call company_kb_sync.

  • List indexed repositories: call company_kb_list_repositories.

  • Search documentation: call company_kb_search.

  • Open exact source context: call company_kb_open_doc.

  • Build a cited evidence pack: call company_kb_answer.

  • Remove a repository from the local index: call company_kb_remove_repository.

Configuration

Configuration is optional for ad hoc usage. Without a config file, repositories can still be added by URL.

Common environment variables:

  • GITLAB_TOKEN: optional token for private GitLab repositories.

  • COMPANY_KB_CONFIG: optional path to a YAML config file.

  • COMPANY_KB_CACHE_DIR: optional local repository cache directory.

  • COMPANY_KB_DATA_DIR: optional local SQLite index directory.

  • COMPANY_KB_LOG_FILE: optional JSONL log file path.

  • COMPANY_KB_AUTO_SYNC_ON_STARTUP: set to 1 to refresh indexed repositories when the server starts.

For private GitLab repositories, the token needs:

  • read_api

  • read_repository

Do not put token values in marketplace metadata, MCP config files, plugin manifests, or checked-in YAML files.

Local Development

Requirements:

  • Python 3.11 or newer.

  • uv.

  • Git 2.30 or newer.

Install dependencies:

uv sync --dev

Start the MCP server:

uv run company-kb-mcp serve

Run tests:

uv run pytest

Run a local sync from the CLI:

uv run company-kb-mcp sync-url --url https://gitlab.com/gitlab-org/cli

Check status:

uv run company-kb-mcp status

Architecture

See ARCHITECTURE.md for the component map and sequence diagrams.

Current Limits

  • Group discovery is scaffolded, but explicit repository URL sync is the main path.

  • Production keychain and OAuth auth modes are not implemented in the Python MVP.

  • company_kb_open_doc reads the current local cache; it does not check out historical commits.

  • Semantic search is optional and may download local FastEmbed model files on first use.

Available Tools

9 tools
company_kb_answerB

Retrieve a focused evidence pack for a natural-language company documentation question. This tool does not invent final policy; it returns cited evidence and guidance for Copilot to synthesize from sources.

Inputs: question (required), limit, filters, requireCitations. Returns: object

company_kb_list_repositoriesA

List GitLab repositories that have been synchronized into the local RAG cache, including their local index counts and last sync metadata.

Inputs: no named parameters. Returns: object

company_kb_open_docA

Open an exact document excerpt or an indexed chunk by reference. Use this after search when more surrounding context or precise source lines are needed.

Inputs: path, commit, chunkId, lineEnd, +3 more. Returns: object

company_kb_recent_changesA

List recently changed indexed Markdown documents. Use this when the user asks what changed recently or wants documentation updates within a time window.

Inputs: days, limit, project. Returns: object

company_kb_remove_repositoryA

Remove one synchronized GitLab repository from the local RAG system. This deletes local index entries, vectors, and by default the local cached clone. It never writes to GitLab.

Inputs: url, project, deleteCache. Returns: object

company_kb_statusA

Check configuration, GitLab authentication, repository sync state, and index size for the company knowledge base. Use this when search looks stale or broken, or when the user asks whether the MCP server is healthy.

Inputs: no named parameters. Returns: object

company_kb_syncB

Synchronize repositories that have already been added to the local RAG cache and update the Markdown index. Use this before answering when the user asks for fresh docs; normal search does not require a full sync.

Inputs: force, scope, project. Returns: object

company_kb_sync_repositoryA

Synchronize one GitLab repository by URL. The repository is cloned into the local read-only cache, indexed, and made searchable. Auth defaults to env when GITLAB_TOKEN is set, otherwise anonymous. Pass authMode as anonymous, env, or ssh-agent when you need to override it; do not pass token values.

Inputs: url (required), force, authMode, tokenEnv. Returns: object

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 9 tools

    Disambiguation4/5

    Most tools are clearly distinct by action (sync vs search vs open vs answer), but company_kb_sync and company_kb_sync_repository could be confused: one syncs all cached repos, the other syncs a single new repo by URL. company_kb_answer vs company_kb_search also overlap somewhat, though the descriptions separate discovery from evidence-pack retrieval.

    Naming Consistency4/5

    All tools share the company_kb_ prefix and most use verb_noun structure (list_repositories, sync_repository, remove_repository, open_doc). Minor inconsistencies exist: recent_changes and answer are not as clearly verb_action as the rest, and sync vs sync_repository differ in level of detail.

    Tool Count5/5

    9 tools is well-scoped for a knowledge base MCP server covering lifecycle management (sync, add, remove), status/health, search/discovery, and document access. Each tool serves a distinct operational need without bloat, and the count feels complete for the stated purpose.

    Completeness4/5

    The surface covers core KB operations: repository sync/add/remove, status, search, recent changes, open doc, and a synthesized answer tool. Minor gaps exist: there is no explicit tool for listing all unsynced GitLab repositories or for clearing/resetting the cache, but agents can work around these using the provided status and sync tools.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI coding assistants to query a local knowledge base for persistent, searchable project context, reducing re-explanation and token usage.
      8
      Functional Source , Version 1.1, ALv2 Future
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI coding assistants to search and retrieve information from a locally ingested knowledge base using hybrid search, grounded in user-curated documentation.
      17
      MIT
    • F
      license
      A
      quality
      D
      maintenance
      Enables AI assistants to search, read, and retrieve context from local knowledge bases with full-text search, absolute paths, and section-level details.
      4
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI coding assistants to search and retrieve code from self-hosted Git repositories using semantic and lexical search with optional reranking, while keeping repository data under the operator's control.
      MIT