mcp_mirror_jeanibarz_knowledge_base_mcp_server

mcp_mirror_jeanibarz_knowledge_base_mcp_server

by MCP-Mirror
An MCP server for listing and retrieving content from various knowledge bases using semantic search.

Knowledge Base MCP Server

Knowledge Base Server MCP server

Overview

The Knowledge Base MCP Server is a tool designed to list and retrieve content from various knowledge bases. It leverages the Hugging Face Inference API for generating embeddings and uses FAISS for efficient similarity search. This server is particularly useful for managing and querying structured knowledge bases in a scalable manner.

Setup Instructions

Prerequisites

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

Steps

  1. Clone the repository:
    shell git clone <repository_url> cd knowledge-base-mcp-server

  2. Install dependencies:
    shell npm install

  3. Configure environment variables:

  4. HUGGINGFACE_API_KEY: API key for Hugging Face Inference API.
  5. KNOWLEDGE_BASES_ROOT_DIR: Directory for knowledge base subdirectories (defaults to $HOME/knowledge_bases).
  6. FAISS_INDEX_PATH: Path to the FAISS index (defaults to $HOME/knowledge_bases/.faiss).
  7. HUGGINGFACE_MODEL_NAME: Hugging Face model for embeddings (defaults to sentence-transformers/all-MiniLM-L6-v2).

  8. Build the server:
    shell npm run build

  9. Add the server to the MCP settings:

  10. Edit cline_mcp_settings.json and add the following configuration:
    json "knowledge-base-mcp": { "command": "node", "args": ["/path/to/knowledge-base-mcp-server/build/index.js"], "disabled": false, "autoApprove": [], "env": { "KNOWLEDGE_BASES_ROOT_DIR": "/path/to/knowledge_bases", "HUGGINGFACE_API_KEY": "YOUR_HUGGINGFACE_API_KEY" }, "description": "Retrieves similar chunks from the knowledge base based on a query." }

  11. Create knowledge base directories:

  12. Create subdirectories within KNOWLEDGE_BASES_ROOT_DIR for each knowledge base (e.g., company, it_support, onboarding).
  13. Place text files (e.g., .txt, .md) containing the knowledge base content within these subdirectories.

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.

Example Output of retrieve_knowledge:

## 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:

{
  "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.
```

About

This repository is a mirror of https://github.com/jeanibarz/knowledge-base-mcp-server.

Resources

License

Unlicense license

Contributors

Languages

Features & Capabilities

Categories
mcp_server model_context_protocol typescript javascript huggingface faiss semantic_search api_integration

Implementation Details

Stats

0 Views
1 GitHub Stars

Repository Info

MCP-Mirror Organization

Similar MCP Servers

continuedev_continue by continuedev
25049
21423
9300