Mochow Vector Database MCP server

Provides direct access to Mochow vector database capabilities for managing databases, tables, and performing vector similarity and full-text searches with filtering options.
Back to servers
Setup instructions
Provider
Baidu
Release date
May 09, 2025
Language
TypeScript
Stats
3 stars

This MCP server provides access to Baidu Vector Database through the Model Context Protocol, allowing AI assistants to interact with vector databases when processing requests.

Installation Requirements

Before using the Baidu Vector Database MCP Server, ensure you have:

  • Python 3.10 or higher
  • uv installed for running the MCP Server

Setting Up the Server

To get started with the MCP server, clone the repository and run it using uv:

git clone https://github.com/baidu/mochow-mcp-server-python.git
cd mochow-mcp-server-python

You can run the server directly with custom endpoint and API key:

uv run src/mochow_mcp_server/server.py 
# Or with custom parameters
uv run src/mochow_mcp_server/server.py --endpoint http://127.0.0.1:8287 --api-key mochow

Alternatively, you can modify the .env file in the src/mochow_mcp_server/ directory to set environment variables, then run:

uv run src/mochow_mcp_server/server.py 

Integration with AI Applications

Claude Desktop Integration

  1. Download Claude Desktop from https://claude.ai
  2. Open the Claude Desktop configuration file (on macOS, located at ~/Library/Application Support/Claude/claude_desktop_config.json)
  3. Add the following configuration:
{
    "mcpServers": {
        "mochow": {
            "command": "/PATH/TO/uv",
            "args": [
                "--directory",
                "/path/to/mochow-mcp-server-python/src/mochow_mcp_server",
                "run",
                "server.py",
                "--endpoint",
                "http://127.0.0.1:8287",
                "--api-key",
                "mochow"
            ]
        }
    }
}
  1. Restart Claude Desktop

Cursor Integration

  1. Open Cursor settings > Features > MCP
  2. Click "+ Add New MCP Server"
  3. Add the following configuration to mcp.json:
{
    "mcpServers": {
        "mochow": {
            "command": "/PATH/TO/uv",
            "args": [
                "--directory",
                "/path/to/mochow-mcp-server-python/src/mochow_mcp_server",
                "run",
                "server.py",
                "--endpoint",
                "http://127.0.0.1:8287",
                "--api-key",
                "mochow"
            ]
        }
    }
}
  1. Restart Cursor or reload the window

Available Tools

Database Operations

  • list_databases: Lists all databases
  • create_database: Creates a new database
    • Parameters: database_name
  • use_database: Switches to an existing database
    • Parameters: database_name

Table Operations

  • list_tables: Lists all tables in the current database
  • describe_table: Gets detailed information about a specific table
    • Parameters: table_name
  • stats_table: Gets statistics about a specific table
    • Parameters: table_name

Data Operations

  • delete_table_rows: Deletes data using filter expressions
    • Parameters: table_name, filter_expr
  • select_table_rows: Queries data using filter expressions
    • Parameters: table_name, filter_expr, limit, output_fields

Index Operations

  • create_vector_index: Creates a vector index on the specified vector field
    • Parameters: table_name, index_name, field_name, index_type, metric_type, params
  • rebuild_vector_index: Rebuilds a specific vector index
    • Parameters: table_name, index_name
  • drop_vector_index: Deletes a specific vector index
    • Parameters: table_name, index_name
  • describe_index: Gets detailed information about a specific index
    • Parameters: table_name, index_name

Search Operations

  • vector_search: Performs vector similarity search with scalar filtering
    • Parameters: table_name, vector, vector_field, limit, filter_expr, output_fields
  • fulltext_search: Performs full-text search
    • Parameters: table_name, index_name, search_text, limit, filter_expr, output_fields

Environment Variables

  • MOCHOW_ENDPOINT: Baidu Vector Database connection instance URI
  • MOCHOW_API_KEY: Baidu Vector Database instance API key

Usage Examples

Example 1: Listing Databases

When asking Claude "How many databases do I have in the mochow db?", you'll get a response like:

You have 2 databases in your Mochow instance:

1. book
2. test

Example 2: Viewing Table Schema

When asking "I want to get the detail of table named book_segments in database book", Claude will respond with table details including:

  • Database and table name
  • Creation time and state
  • Schema details (fields, types, constraints)
  • Index information

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "mochow" '{"command":"/PATH/TO/uv","args":["--directory","/path/to/mochow-mcp-server-python/src/mochow_mcp_server","run","server.py","--endpoint","http://127.0.0.1:8287","--api-key","mochow"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "mochow": {
            "command": "/PATH/TO/uv",
            "args": [
                "--directory",
                "/path/to/mochow-mcp-server-python/src/mochow_mcp_server",
                "run",
                "server.py",
                "--endpoint",
                "http://127.0.0.1:8287",
                "--api-key",
                "mochow"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "mochow": {
            "command": "/PATH/TO/uv",
            "args": [
                "--directory",
                "/path/to/mochow-mcp-server-python/src/mochow_mcp_server",
                "run",
                "server.py",
                "--endpoint",
                "http://127.0.0.1:8287",
                "--api-key",
                "mochow"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later