πŸ”Œ

SQLite-Vec MCP

Database‒⭐ 980

Vector database MCP server using SQLite with zero external dependencies.

Claude DesktopCursorLocal Agents

Overview

Vector database MCP server using SQLite with zero external dependencies.

Setup

Run with npx:

pip install mcp-sqlite-vec

Configuration

SQLITE_VEC_MODEL environment variable

Documentation

SQLite-Vec MCP

Overview

SQLite-Vec MCP is a Model Context Protocol server built on top of SQLite and the sqlite-vec extension, providing vector database capabilities directly within SQLite. Released in July 2026 with over 980 GitHub stars, this server enables AI agents to perform vector similarity search, hybrid keyword+vector queries, and automated schema inferenceβ€”all within a single-file, zero-dependency database.

This MCP server is particularly well-suited for edge deployments and resource-constrained environments where running separate vector databases (Pinecone, Qdrant, Chroma) is impractical. With SQLite-Vec, agents get vector search capabilities with the simplicity and portability of SQLite.

Features

  • Vector Index Creation: Create and manage vector indexes directly in SQLite
  • Similarity Search: Support for L2 distance, cosine similarity, and dot product
  • Hybrid Search: Combine keyword and vector searches in a single query
  • Zero External Dependencies: Single SQLite file with sqlite-vec extension
  • Auto Schema Inference: Automatically infer schema from JSON data and create vector tables
  • Incremental Indexing: Add vectors to existing indexes without rebuilding
  • Full-Text Search Integration: Combine with SQLite FTS5 for powerful hybrid queries
  • Multiple Vector Dimensions: Support for arbitrary vector dimensions

Installation

# Install via pip (Python MCP server)
pip install mcp-sqlite-vec

# Or via npm (Node.js MCP server)
npm install -g @mcp-sqlite-vec/server

# Launch via npx (no installation)
npx @mcp-sqlite-vec/server --database ./vectors.db

Configuration

{
  "mcpServers": {
    "sqlite-vec": {
      "command": "npx",
      "args": [
        "@mcp-sqlite-vec/server",
        "--database", "./vectors.db"
      ],
      "env": {
        "SQLITE_VEC_MODEL": "all-MiniLM-L6-v2"
      }
    }
  }
}

Environment Variables:

VariableDescriptionDefault
SQLITE_VEC_MODELEmbedding model for vector generationall-MiniLM-L6-v2
SQLITE_VEC_DIMENSIONSVector dimensions384
MCP_LOG_LEVELLogging verbosityinfo

Available Tools

ToolDescription
create_vector_tableCreate a table with vector columns
insert_vectorsInsert documents with their embeddings
vector_searchPerform similarity search on vectors
hybrid_searchCombine keyword and vector search
auto_schema_inferenceInfer schema from JSON data and create vector table
list_tablesList all vector tables in the database
table_infoGet information about a specific vector table
delete_vectorsRemove vectors from a table

Usage Examples

Example 1: Create Vector Table and Insert Documents

# Via MCP client
mcp_client.call_tool("sqlite-vec", "create_vector_table", {
    "table_name": "documents",
    "columns": {
        "id": "INTEGER PRIMARY KEY",
        "content": "TEXT",
        "embedding": "VECTOR(384)",
        "metadata": "TEXT"
    }
})

mcp_client.call_tool("sqlite-vec", "insert_vectors", {
    "table_name": "documents",
    "documents": [
        {"id": 1, "content": "AI agents are transforming software development", "metadata": '{"category": "tech"}'},
        {"id": 2, "content": "Vector databases enable semantic search", "metadata": '{"category": "data"}'},
        {"id": 3, "content": "SQLite is perfect for embedded applications", "metadata": '{"category": "database"}'}
    ]
})

Example 2: Vector Similarity Search

response = mcp_client.call_tool("sqlite-vec", "vector_search", {
    "table_name": "documents",
    "query": "What are AI agents?",
    "distance_metric": "cosine",  # "l2", "cosine", "dot_product"
    "top_k": 5
})

# Results sorted by similarity

Example 3: Hybrid Keyword + Vector Search

response = mcp_client.call_tool("sqlite-vec", "hybrid_search", {
    "table_name": "documents",
    "query": "AI agents development",
    "keyword_fields": ["content"],
    "vector_field": "embedding",
    "top_k": 10,
    "weight_vector": 0.7,  # Vector search weight
    "weight_keyword": 0.3  # Keyword search weight
})

Example 4: Auto Schema Inference

response = mcp_client.call_tool("sqlite-vec", "auto_schema_inference", {
    "json_file": "./documents.json",
    "table_name": "auto_documents",
    "vector_field": "content",
    "metadata_fields": ["title", "author", "date"]
})

Example 5: List Vector Tables

response = mcp_client.call_tool("sqlite-vec", "list_tables", {})
# Returns: {"tables": ["documents", "auto_documents", "embeddings"]}

Advanced Features

Custom Embedding Models

# Use different embedding models
mcp_client.call_tool("sqlite-vec", "set_embedding_model", {
    "model": "text-embedding-ada-002",
    "dimensions": 1536,
    "api_key": "sk-xxx"
})

Batch Processing

# Insert large batches efficiently
mcp_client.call_tool("sqlite-vec", "insert_vectors", {
    "table_name": "documents",
    "json_file": "./large_corpus.json",
    "batch_size": 1000
})

Index Optimization

# Rebuild vector index for better performance
mcp_client.call_tool("sqlite-vec", "rebuild_index", {
    "table_name": "documents"
})

Edge Deployment

SQLite-Vec MCP is ideal for edge deployments:

# Deploy on Raspberry Pi or embedded devices
import sqlite3
from miniagent7b import MiniAgent

# SQLite-Vec requires only ~100MB total
agent = MiniAgent(model_path="miniagent-7b-int4", device="cpu")
vector_db = sqlite3.connect("./vectors.db")

Pros

  • βœ… Zero Dependencies: Single SQLite file, no external services
  • βœ… Vector Search Native: Built-in vector similarity search
  • βœ… Hybrid Search: Combine keyword and vector queries
  • βœ… Auto Schema Inference: Automatically create vector tables from JSON
  • βœ… Edge-Ready: Perfect for resource-constrained deployments
  • βœ… SQLite Familiarity: Leverages existing SQLite knowledge

Cons

  • βœ… SQLite Limitations: Not suitable for high-concurrency scenarios
  • βœ… Embedding Quality: Depends on external embedding model choice
  • βœ… New Server: Limited production track record
  • βœ… Scaling Limits: SQLite has inherent scalability constraints

When to Use

  • Edge Deployments: Deploy vector search on devices without cloud access
  • Prototyping: Quick experimentation without infrastructure setup
  • Local Agent Workflows: Embed vector search in local agent applications
  • Resource-Constrained Environments: Limited memory or compute availability
  • Hybrid Search Needs: Combine keyword and semantic search capabilities
  • Single-File Databases: Need portable, backupable database solutions

Resources