Track MCP LogoTrack MCP
Track MCP LogoTrack MCP

The world's largest repository of Model Context Protocol servers. Discover, explore, and submit MCP tools.

Product

  • Categories
  • Top MCP
  • New & Updated
  • Submit MCP

Company

  • About

Legal

  • Privacy Policy
  • Terms of Service
  • Cookie Policy

© 2026 TrackMCP. All rights reserved.

Built with ❤️ by Krishna Goyal

    Knowledge Base Mcp Server

    This MCP server provides tools for listing and retrieving content from different knowledge bases.

    31 stars
    TypeScript
    Updated Oct 30, 2025

    Table of Contents

    • Setup Instructions
    • Installing via Smithery
    • Manual Installation
    • Usage
    • Semantic Search Results
    • Troubleshooting & Logging

    Table of Contents

    • Setup Instructions
    • Installing via Smithery
    • Manual Installation
    • Usage
    • Semantic Search Results
    • Troubleshooting & Logging

    Documentation

    Knowledge Base MCP Server

    smithery badge

    This MCP server provides tools for listing and retrieving content from different knowledge bases.

    Setup Instructions

    These instructions assume you have Node.js and npm installed on your system.

    Installing via Smithery

    To install Knowledge Base Server for Claude Desktop automatically via Smithery:

    bash
    npx -y @smithery/cli install @jeanibarz/knowledge-base-mcp-server --client claude

    Manual Installation

    Prerequisites

    • Node.js (version 16 or higher)
    • npm (Node Package Manager)

    1. Clone the repository:

    bash
    git clone 
        cd knowledge-base-mcp-server

    2. Install dependencies:

    bash
    npm install

    3. Configure environment variables:

    This server supports three embedding providers: Ollama (recommended for reliability), OpenAI and HuggingFace (fallback option).

    ### Option 1: Ollama Configuration (Recommended)

    • Set EMBEDDING_PROVIDER=ollama to use local Ollama embeddings
    • Install Ollama and pull an embedding model: ollama pull dengcao/Qwen3-Embedding-0.6B:Q8_0
    • Configure the following environment variables:
    bash
    EMBEDDING_PROVIDER=ollama
            OLLAMA_BASE_URL=http://localhost:11434  # Default Ollama URL
            OLLAMA_MODEL=dengcao/Qwen3-Embedding-0.6B:Q8_0          # Default embedding model
            KNOWLEDGE_BASES_ROOT_DIR=$HOME/knowledge_bases

    ### Option 2: OpenAI Configuration

    • Set EMBEDDING_PROVIDER=openai to use OpenAI API for embeddings
    • Configure the following environment variables:
    bash
    EMBEDDING_PROVIDER=openai
            OPENAI_API_KEY=your_api_key_here
            OPENAI_MODEL_NAME=text-embedding-ada-002
            KNOWLEDGE_BASES_ROOT_DIR=$HOME/knowledge_bases

    ### Option 3: HuggingFace Configuration (Fallback)

    • Set EMBEDDING_PROVIDER=huggingface or leave unset (default)
    • Obtain a free API key from HuggingFace
    • Configure the following environment variables:
    bash
    EMBEDDING_PROVIDER=huggingface          # Optional, this is the default
            HUGGINGFACE_API_KEY=your_api_key_here
            HUGGINGFACE_MODEL_NAME=sentence-transformers/all-MiniLM-L6-v2
            KNOWLEDGE_BASES_ROOT_DIR=$HOME/knowledge_bases

    ### Additional Configuration

    • The server supports the FAISS_INDEX_PATH environment variable to specify the path to the FAISS index. If not set, it will default to $HOME/knowledge_bases/.faiss.
    • Logging can be routed to a file by setting LOG_FILE=/path/to/logs/knowledge-base.log. Log verbosity defaults to info and can be adjusted with LOG_LEVEL=debug|info|warn|error.
    • You can set these environment variables in your .bashrc or .zshrc file, or directly in the MCP settings.

    4. Build the server:

    bash
    npm run build

    5. Add the server to the MCP settings:

    • Edit the cline_mcp_settings.json file located at /home/jean/.vscode-server/data/User/globalStorage/saoudrizwan.claude-dev/settings/.
    • Add the following configuration to the mcpServers object:
    • Option 1: Ollama Configuration
    json
    "knowledge-base-mcp-ollama": {
          "command": "node",
          "args": [
            "/path/to/knowledge-base-mcp-server/build/index.js"
          ],
          "disabled": false,
          "autoApprove": [],
          "env": {
            "KNOWLEDGE_BASES_ROOT_DIR": "/path/to/knowledge_bases",
            "EMBEDDING_PROVIDER": "ollama",
            "OLLAMA_BASE_URL": "http://localhost:11434",
            "OLLAMA_MODEL": "dengcao/Qwen3-Embedding-0.6B:Q8_0"
          },
          "description": "Retrieves similar chunks from the knowledge base based on a query using Ollama."
        },
    • Option 2: OpenAI Configuration
    json
    "knowledge-base-mcp-openai": {
          "command": "node",
          "args": [
            "/path/to/knowledge-base-mcp-server/build/index.js"
          ],
          "disabled": false,
          "autoApprove": [],
          "env": {
            "KNOWLEDGE_BASES_ROOT_DIR": "/path/to/knowledge_bases",
            "EMBEDDING_PROVIDER": "openai",
            "OPENAI_API_KEY": "YOUR_OPENAI_API_KEY",
            "OPENAI_MODEL_NAME": "text-embedding-ada-002"
          },
          "description": "Retrieves similar chunks from the knowledge base based on a query using OpenAI."
        },
    • Option 3: HuggingFace Configuration
    json
    "knowledge-base-mcp-huggingface": {
          "command": "node",
          "args": [
            "/path/to/knowledge-base-mcp-server/build/index.js"
          ],
          "disabled": false,
          "autoApprove": [],
          "env": {
            "KNOWLEDGE_BASES_ROOT_DIR": "/path/to/knowledge_bases",
            "EMBEDDING_PROVIDER": "huggingface",
            "HUGGINGFACE_API_KEY": "YOUR_HUGGINGFACE_API_KEY",
            "HUGGINGFACE_MODEL_NAME": "sentence-transformers/all-MiniLM-L6-v2"
          },
          "description": "Retrieves similar chunks from the knowledge base based on a query using HuggingFace."
        },
    • Note: You only need to add one of the above configurations (either Ollama, OpenAI or HuggingFace) to your cline_mcp_settings.json file, depending on your preferred embedding provider.
    code
    *   Replace `/path/to/knowledge-base-mcp-server` with the actual path to the server directory.
        *   Replace `/path/to/knowledge_bases` with the actual path to the knowledge bases directory.
    
    6.  **Create knowledge base directories:**
    
        *   Create subdirectories within the `KNOWLEDGE_BASES_ROOT_DIR` for each knowledge base (e.g., `company`, `it_support`, `onboarding`).
        *   Place text files (e.g., `.txt`, `.md`) containing the knowledge base content within these subdirectories.
    
    *   The server recursively reads all text files (e.g., `.txt`, `.md`) within the specified knowledge base subdirectories.
    *   The server skips hidden files and directories (those starting with a `.`).
    *   For each file, the server calculates the SHA256 hash and stores it in a file with the same name in a hidden `.index` subdirectory. This hash is used to determine if the file has been modified since the last indexing.
    *   The file content is splitted into chunks using the `MarkdownTextSplitter` from `langchain/text_splitter`.
    *   The content of each chunk is then added to a FAISS index, which is used for similarity search.
    *   The FAISS index is automatically initialized when the server starts. It checks for changes in the knowledge base files and updates the index accordingly.
    
    ## Usage
    
    The server exposes two tools:
    
    *   `list_knowledge_bases`: Lists the available knowledge bases.
    *   `retrieve_knowledge`: Retrieves similar chunks from the knowledge base based on a query. Optionally, if a knowledge base is specified, only that one is searched; otherwise, all available knowledge bases are considered. By default, at most 10 document chunks are returned with a score below a threshold of 2. A different threshold can optionally be provided using the `threshold` parameter.
    
    You can use these tools through the MCP interface.
    
    The `retrieve_knowledge` tool performs a semantic search using a FAISS index. The index is automatically updated when the server starts or when a file in a knowledge base is modified.
    
    The output of the `retrieve_knowledge` tool is a markdown formatted string with the following structure:

    Semantic Search Results

    Result 1:

    [Content of the most similar chunk]

    Source:

    json
    {
      "source": "[Path to the file containing the chunk]"
    }

    ---

    Result 2:

    [Content of the second most similar chunk]

    Source:

    json
    {
      "source": "[Path to the file containing the chunk]"
    }

    Disclaimer: The provided results might not all be relevant. Please cross-check the relevance of the information.

    `
    Each result includes the content of the most similar chunk, the source file, and a similarity score.
    
    ## Troubleshooting & Logging
    
    - Set `LOG_FILE` to capture structured logs (JSON-RPC traffic continues to use stdout). This is especially helpful when diagnosing MCP handshake errors because all diagnostic messages are written to stderr and the optional log file.
    - Permission errors when creating or updating the FAISS index are surfaced with explicit messages in both the console and the log file. Verify that the process can write to `FAISS_INDEX_PATH` and the `.index` directories inside each knowledge base.
    - Run `npm test` to execute the Jest suite (serialised with `--runInBand`) that covers logger fallback behaviour and FAISS permission handling.

    Similar MCP

    Based on tags & features

    • MC

      Mcp Open Library

      TypeScript·
      42
    • DI

      Discogs Mcp Server

      TypeScript·
      59
    • QU

      Quran Mcp Server

      TypeScript·
      50
    • AN

      Anilist Mcp

      TypeScript·
      57

    Trending MCP

    Most active this week

    • PL

      Playwright Mcp

      TypeScript·
      22.1k
    • SE

      Serena

      Python·
      14.5k
    • MC

      Mcp Playwright

      TypeScript·
      4.9k
    • MC

      Mcp Server Cloudflare

      TypeScript·
      3.0k
    View All MCP Servers

    Similar MCP

    Based on tags & features

    • MC

      Mcp Open Library

      TypeScript·
      42
    • DI

      Discogs Mcp Server

      TypeScript·
      59
    • QU

      Quran Mcp Server

      TypeScript·
      50
    • AN

      Anilist Mcp

      TypeScript·
      57

    Trending MCP

    Most active this week

    • PL

      Playwright Mcp

      TypeScript·
      22.1k
    • SE

      Serena

      Python·
      14.5k
    • MC

      Mcp Playwright

      TypeScript·
      4.9k
    • MC

      Mcp Server Cloudflare

      TypeScript·
      3.0k