Knowledge Base

Provides semantic search and document management using your Supabase and OpenAI keys.
  • javascript

0

GitHub Stars

javascript

Language

6 months ago

First Indexed

3 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "maxsmosarski-mcp-knowledge-base": {
      "command": "node",
      "args": [
        "/path/to/mcp-server/start-stdio.js"
      ],
      "env": {
        "MCP_PORT": "3000",
        "SUPABASE_URL": "your-supabase-url",
        "OPENAI_API_KEY": "your-openai-key",
        "SUPABASE_SERVICE_KEY": "your-supabase-key"
      }
    }
  }
}

You set up an MCP server to manage and semantically search your knowledge base, powered by your own Supabase and OpenAI accounts. It lets you upload documents, describe images, perform semantic search, and run either locally or in Cloudflare Workers with multi-tenant credentials per request.

How to use

You interact with the MCP server through a client that initializes a session, sends search queries, and retrieves documents. Start a session once, then perform searches against your uploaded content. You can list documents, upload new files, and fetch specific documents as needed. The server accepts your own Supabase and OpenAI keys, so there are no shared credentials.

Key usage patterns you can apply after you have a running MCP server include: initialize a session, search across your documents with semantic reasoning, upload new files (text, PDFs, or images), and list or retrieve documents. If you are using a local or remote client, pass your credentials in the request headers to authenticate and route requests to the correct tenant. For multi-tenant usage, each request carries its own credential headers.

How to install

Prerequisites you need before installing:
- Node.js 18+ for local development
- npm for package management
- A Supabase account with a configured database and storage bucket for images
- An OpenAI API key
- Optional: Cloudflare account for Workers deployment and Wrangler CLI for easy deployment

Step-by-step setup to run the MCP server locally (HTTP option):

  • Clone the project repository
  • Install dependencies
  • Start the HTTP server
  • Access the server at http://localhost:3000
# Clone the repository
git clone <your-repo-url>
cd mcp-server

# Install dependencies
npm install

# Option: Run HTTP server locally
export SUPABASE_URL="your-supabase-url"
export SUPABASE_SERVICE_KEY="your-supabase-key"
export OPENAI_API_KEY="your-openai-key"
export MCP_PORT=3000
npm start
# Server runs on http://localhost:3000

# Option: Run STDIO server locally (Claude Desktop integration)
export SUPABASE_URL="your-supabase-url"
export SUPABASE_SERVICE_KEY="your-supabase-key"
export OPENAI_API_KEY="your-openai-key"
npm run start:stdio

If you prefer Cloudflare Workers, you can deploy the MCP server to the edge. The multitenant approach uses credentials passed in request headers, so each user supplies their own keys when calling the worker. The worker exposes endpoints for health checks, server communication, and streaming data.

# Deploy to Cloudflare Workers (after configuring wrangler and bindings)
wrangler login
wrangler deploy

# Development testing (local dev workflow)
npm run deploy:dev

Additional setup and notes

Configuration is designed to keep credentials in the request headers for the Cloudflare Workers implementation, enabling multi-tenant usage where each tenant provides their own Supabase and OpenAI keys. Local runs use environment variables to supply credentials.

If you are using the STDIO path, the typical workflow involves providing a path to the startup script for the MCP server and the required environment variables. You can integrate this with a client like Claude Desktop by adding a configuration entry that points to the node process and supplies the necessary keys.

Common initialization steps and endpoints to be aware of when using the Cloudflare Workers implementation include the MCP endpoint, SSE endpoint, and health checks. Credentials are passed via request headers on every call.

Security and multi-tenant usage

Your own keys stay with you. The design relies on request headers to carry credentials, so multiple tenants can share the same deployment without exposing each other’s keys.

Always include the required headers with every request: the Supabase URL, the Supabase service key, and the OpenAI key. Ensure these values are correct and kept secret in your client configuration.

Troubleshooting and notes

If you encounter issues during deployment, verify that Durable Objects are properly configured in your Cloudflare setup and that you are using the correct bindings. Ensure you are passing all required headers in each request and that the MCP server is reachable at the configured URL.

Available tools

upload_document

Upload text or PDF documents to the MCP server for processing and storage in Supabase.

upload_image

Upload and analyze images, enabling image description and search within the knowledge base.

search_chunks

Perform semantic search across document chunks to retrieve relevant results with similarity scoring.

get_files

List all documents stored in the knowledge base.

get_document

Retrieve a specific document by its identifier.

delete_document

Delete a single document from the knowledge base.

delete_documents

Bulk delete documents from the knowledge base.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational