Skip to main content

MCP server for Weaviate vector database

Project description

Weaviate MCP Server

Weaviate vector database integration for AI assistants via Model Context Protocol (MCP)

Python 3.10+ License: MIT

Developed and maintained by Arclio - Secure MCP service management for AI applications


🚀 Quick Start

Test the server immediately using the Model Context Protocol (MCP) Inspector, or install and run it directly.

Option 1: Instant Setup with MCP Inspector (Recommended for Testing)

# First, start a local Weaviate instance
docker-compose -f docker-compose.weaviate.yml up -d

# Then test with MCP Inspector
npx @modelcontextprotocol/inspector \
  -e WEAVIATE_URL="localhost" \
  -e WEAVIATE_HTTP_PORT="8080" \
  -e WEAVIATE_GRPC_PORT="50051" \
  -e WEAVIATE_OPENAI_API_KEY="your-openai-api-key" \
  -- \
  uvx --from weaviate-mcp weaviate-mcp

Replace your-openai-api-key with your actual OpenAI API key.

Option 2: Direct Installation & Usage

  1. Install the package:

    pip install weaviate-mcp
    
  2. Set Environment Variables:

    export WEAVIATE_URL="localhost"
    export WEAVIATE_HTTP_PORT="8080"
    export WEAVIATE_GRPC_PORT="50051"
    export WEAVIATE_OPENAI_API_KEY="your-openai-api-key"
    
  3. Run the MCP Server:

    python -m weaviate_mcp
    

Option 3: Using uvx (Run without full installation)

# Ensure WEAVIATE_* environment variables are set as shown above
uvx --from weaviate-mcp weaviate-mcp

📋 Overview

weaviate-mcp is a Python package that enables AI models to interact with Weaviate vector databases through the Model Context Protocol (MCP). It acts as a secure and standardized bridge, allowing AI assistants to leverage Weaviate's powerful vector search and storage capabilities without direct database credential exposure.

What is MCP?

The Model Context Protocol (MCP) provides a standardized interface for AI models to discover and utilize external tools and services. This package implements an MCP server that exposes Weaviate capabilities as discrete, callable "tools."

Key Benefits

  • AI-Ready Integration: Purpose-built for AI assistants to naturally interact with vector databases.
  • Standardized Protocol: Ensures seamless integration with MCP-compatible AI systems and hubs.
  • Enhanced Security: Database credentials remain on the server, isolated from the AI models.
  • Comprehensive Vector Operations: Offers semantic search, hybrid search, and full CRUD operations.
  • Dynamic Schema Management: Create and manage collections on-the-fly without predefined schemas.
  • Robust Error Handling: Provides consistent error patterns for reliable operation.
  • Extensive Testing: Underpinned by a comprehensive test suite for correctness and stability.

🏗️ Prerequisites & Setup

Step 1: Weaviate Instance Setup

You need a running Weaviate instance. Choose one of these options:

Option A: Local Development with Docker (Recommended)

  1. Download the Docker Compose file:

    curl -O https://raw.githubusercontent.com/your-repo/arclio-mcp-tooling/main/docker-compose.weaviate.yml
    
  2. Create environment file:

    cp weaviate-mcp.env.example .env
    # Edit .env and add your OpenAI API key
    
  3. Start Weaviate:

    docker-compose -f docker-compose.weaviate.yml up -d
    
  4. Verify Weaviate is running:

    curl http://localhost:8080/v1/.well-known/ready
    

Option B: Weaviate Cloud Services (WCS)

  1. Sign up at Weaviate Cloud Services
  2. Create a new cluster
  3. Note your cluster URL and API key
  4. Set environment variables accordingly

Step 2: OpenAI API Key

This MCP server uses OpenAI's text embedding models for vectorization:

  1. Get your API key from OpenAI Platform
  2. Set the WEAVIATE_OPENAI_API_KEY environment variable

⚙️ Configuration

Environment Variables

The MCP server requires the following environment variables:

# Essential connection settings
export WEAVIATE_URL="localhost"                    # Weaviate host (without http/https)
export WEAVIATE_HTTP_PORT="8080"                  # HTTP port
export WEAVIATE_GRPC_PORT="50051"                 # gRPC port (for better performance)

# Required for text vectorization
export WEAVIATE_OPENAI_API_KEY="your-api-key"     # OpenAI API key

# Optional authentication (if your Weaviate instance requires it)
# export WEAVIATE_API_KEY="your-weaviate-api-key"
# export WEAVIATE_USERNAME="username"
# export WEAVIATE_PASSWORD="password"

# Optional performance settings
# export WEAVIATE_TIMEOUT="60"                    # Connection timeout in seconds
# export WEAVIATE_USE_SSL="false"                 # Use SSL/TLS connection

Configuration File

For persistent configuration, create a .env file:

# Copy the example file
cp weaviate-mcp.env.example .env

# Edit with your actual values
nano .env

🛠️ Exposed Capabilities (Tools)

This package exposes comprehensive tools for AI interaction with Weaviate.

Collection Management Tools

  • weaviate_create_collection: Create new collections with custom schemas
  • weaviate_delete_collection: Delete existing collections
  • weaviate_get_schema: Retrieve current database schema

Data Management Tools

  • weaviate_insert_object: Insert single objects with duplicate checking
  • weaviate_batch_insert_objects: Batch insert multiple objects efficiently
  • weaviate_get_object: Retrieve objects by UUID
  • weaviate_get_objects: Query multiple objects with filtering and pagination
  • weaviate_update_object: Update existing objects
  • weaviate_delete_object: Delete objects by UUID

Search & Query Tools

  • weaviate_vector_search: Semantic vector search using embeddings
  • weaviate_hybrid_search: Combined semantic and keyword search

Analytics & Schema Tools

  • weaviate_aggregate: Perform aggregation operations
  • weaviate_get_schema_info: Get detailed schema information with statistics
  • weaviate_validate_collection_exists: Check if a collection exists
  • weaviate_get_collection_stats: Get statistics for a specific collection

🔍 Troubleshooting

Connection Issues

  • "Connection refused": Ensure Weaviate is running on the specified host and port

    curl http://localhost:8080/v1/.well-known/ready
    
  • "Authentication failed": Check your Weaviate credentials and API keys

  • "SSL/TLS errors": Verify WEAVIATE_USE_SSL setting matches your Weaviate configuration

OpenAI Integration Issues

  • "Invalid API key": Verify your WEAVIATE_OPENAI_API_KEY is correct and active
  • "Rate limit exceeded": OpenAI API has usage limits; check your quota

MCP Server Issues

  • "Tool not found": Verify the tool name matches exactly (case-sensitive)
  • "Invalid arguments": Check the tool's parameter requirements and types
  • "Server not responding": Check server logs for error messages

For detailed debugging, inspect the server's stdout/stderr logs.

📝 Contributing

Contributions are welcome! Please refer to the main README.md in the arclio-mcp-tooling monorepo for guidelines on contributing, setting up the development environment, and project-wide commands.

📄 License

This package is licensed under the MIT License. See the LICENSE file in the monorepo root for full details.

🏢 About Arclio

Arclio provides secure and robust Model Context Protocol (MCP) solutions, enabling AI applications to safely and effectively interact with enterprise systems and external services.


Built with ❤️ by the Arclio team

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

weaviate_mcp-0.1.0.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

weaviate_mcp-0.1.0-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

File details

Details for the file weaviate_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: weaviate_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.2

File hashes

Hashes for weaviate_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e321ee2dbf7f73c83ddeccfeefc23b2a2217d6ec2ae5d6126bef8d8fafbf3784
MD5 285a5e1d14fa9e9785bf94521110df28
BLAKE2b-256 2b4fcb6004d9fcc0df3c897bece37bb8a69b3fca6b5fce708a888910e3763e9b

See more details on using hashes here.

File details

Details for the file weaviate_mcp-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for weaviate_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e5c1330a25167a4a5be4b814fc7ff24d2733df9873eec26021ca9e14243fc7ef
MD5 b1a64d737cc500f4755617a2668c040a
BLAKE2b-256 0c0b5ffcd26a83b6643a842b5f1a2e5d28778681629064440676468a9ed0b2ce

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page