weaviate-mcp
Weaviate MCP server and document upload API for RAG.
Setup
cp .env.example .env
# Fill in your OPENAI_API_KEY
uv sync
Start Weaviate (from workspace root)
cd ..
OPENAI_API_KEY=sk-... docker compose up -d
Run the MCP stdio server (for rag-agent)
uv run python server.py
Run the upload API (for upload-ui)
uv run python api.py
# Listens on http://localhost:8001
Collections
All three collections share the same schema:
| Field | Type | Required |
|---|---|---|
title | text | yes |
content | text | yes (vectorized) |
source | text | yes |
chunk_index | int | yes |
total_chunks | int | yes |
account_id | text | no (filter field) |
salesforce_account_id | text | no (filter field) |
- AccountNotes — internal account notes
- ProductPromos — product promotional documents
- Contracts — account contracts and agreements
MCP Tools
search(query, collection, limit, alpha, account_id, salesforce_account_id)retrieve(doc_id, collection)list_documents(collection, limit, offset, account_id, salesforce_account_id)get_stats(collection)— pass"all"for totals
Upload API Endpoints
POST /upload— multipart:file,collection,account_id?,salesforce_account_id?GET /documents?collection=...&account_id=...— list with optional filtersDELETE /documents/{id}?collection=...— delete a chunkGET /stats— counts per collection