MCP ExplorerExplorer

Lancedb Mcp

@RyanLisseon 10 months ago
5 MIT
FreeCommunity
AI Systems
LanceDB MCP Server enables efficient vector storage and similarity search.

Overview

What is Lancedb Mcp

lancedb_mcp is a Model Context Protocol (MCP) server implementation designed for managing vector database operations in LanceDB. It facilitates efficient storage, similarity search, and management of vector embeddings along with their associated metadata.

Use cases

Use cases for lancedb_mcp include storing and searching for document embeddings in NLP applications, managing user preferences in recommendation systems, and performing similarity searches in image or audio processing tasks.

How to use

To use lancedb_mcp, clone the repository from GitHub, install the necessary dependencies using ‘uv pip install -e .’, and configure it in your Claude Desktop settings. You can create tables, add vectors, and perform similarity searches through the provided API endpoints.

Key features

Key features of lancedb_mcp include configurable vector dimensions, support for text metadata, efficient similarity search capabilities, and a straightforward API for table management and vector operations.

Where to use

lancedb_mcp can be used in various fields such as machine learning, natural language processing, recommendation systems, and any application requiring efficient vector storage and retrieval.

Content

LanceDB MCP Server

Overview

A Model Context Protocol (MCP) server implementation for LanceDB vector database operations. This server enables efficient vector storage, similarity search, and management of vector embeddings with associated metadata.

Components

Resources

The server exposes vector database tables as resources:

  • table://{name}: A vector database table that stores embeddings and metadata
    • Configurable vector dimensions
    • Text metadata support
    • Efficient similarity search capabilities

API Endpoints

Table Management

  • POST /table
    • Create a new vector table
    • Input:
      {
        "name": "my_table",      # Table name
        "dimension": 768         # Vector dimension
      }
      

Vector Operations

  • POST /table/{table_name}/vector

    • Add vector data to a table
    • Input:
      {
        "vector": [0.1, 0.2, ...],  # Vector data
        "text": "associated text"    # Metadata
      }
      
  • POST /table/{table_name}/search

    • Search for similar vectors
    • Input:
      {
        "vector": [0.1, 0.2, ...],  # Query vector
        "limit": 10                  # Number of results
      }
      

Installation

# Clone the repository
git clone https://github.com/yourusername/lancedb_mcp.git
cd lancedb_mcp

# Install dependencies using uv
uv pip install -e .

Usage with Claude Desktop

# Add the server to your claude_desktop_config.json
"mcpServers": {
  "lancedb": {
    "command": "uv",
    "args": [
      "run",
      "python",
      "-m",
      "lancedb_mcp",
      "--db-path",
      "~/.lancedb"
    ]
  }
}

Development

# Install development dependencies
uv pip install -e ".[dev]"

# Run tests
pytest

# Format code
black .
ruff .

Environment Variables

  • LANCEDB_URI: Path to LanceDB storage (default: “.lancedb”)

License

This project is licensed under the MIT License. See the LICENSE file for details.

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers