Skip to main content

A Model Context Protocol (MCP) server for Vertica database with connection pooling, schema management, and security features

Project description

MseeP.ai Security Assessment Badge

MCP Vertica

PyPI version License: MIT Downloads smithery badge MCP Community

🏆 First implementation of Vertica MCP Server

Listed in Model Context Protocol Official Registry

A Vertica MCP(model-context-protocol) Server

Example: MCP Server Setting

Create or edit the file your mcp client config file with the following content:

UVX

{
  "mcpServers": {
    "vertica": {
      "command": "uvx",
      "args": ["mcp-vertica"],
      "env": {
        "VERTICA_HOST": "localhost",
        "VERTICA_PORT": 5433,
        "VERTICA_DATABASE": "VMart",
        "VERTICA_USER": "dbadmin",
        "VERTICA_PASSWORD": "test_password",
        "VERTICA_CONNECTION_LIMIT": 10,
        "VERTICA_SSL": false,
        "VERTICA_SSL_REJECT_UNAUTHORIZED": true
      }
    }
  }
}

Or with args

{
  "mcpServers": {
    "vertica": {
      "command": "uvx",
      "args": [
        "mcp-vertica",
        "--host=localhost",
        "--db-port=5433",
        "--database=VMart",
        "--user=dbadmin",
        "--password=test_password",
        "--connection-limit=10"
      ]
    }
  }
}

Docker

{
  "mcpServers": {
    "vertica": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "nolleh/mcp-vertica"],
      "env": {
        "VERTICA_HOST": "localhost",
        "VERTICA_PORT": 5433,
        "VERTICA_DATABASE": "VMart",
        "VERTICA_USER": "dbadmin",
        "VERTICA_PASSWORD": "test_password",
        "VERTICA_CONNECTION_LIMIT": 10,
        "VERTICA_SSL": false,
        "VERTICA_SSL_REJECT_UNAUTHORIZED": true
      }
    }
  }
}

[!Note]

  • For boolean flags like --ssl or --ssl-reject-unauthorized, simply add the flag (e.g., "--ssl") to enable it, or omit it to disable.
  • For an empty password, use an empty string as shown above.

Features

Database Connection Management

  • Connection pooling with configurable limits
  • SSL/TLS support
  • Automatic connection cleanup
  • Connection timeout handling

Query Operations

  • Execute SQL queries
  • Stream large query results in batches
  • Copy data operations
  • Transaction management

Schema Management

  • Table structure inspection
  • Index management
  • View management
  • Constraint information
  • Column details

Security Features

  • Operation-level permissions (INSERT, UPDATE, DELETE, DDL)
  • Schema-specific permissions
  • SSL/TLS support
  • Password masking in logs

Tools

Database Operations

  1. execute_query

    • Execute SQL queries
    • Support for all SQL operations
  2. stream_query

    • Stream large query results in batches
    • Configurable batch size
  3. copy_data

    • Bulk data loading using COPY command
    • Efficient for large datasets

Schema Management

  1. get_table_structure

    • Get detailed table structure
    • Column information
    • Constraints
  2. list_indexes

    • List all indexes for a table
    • Index type and uniqueness
    • Column information
  3. list_views

    • List all views in a schema
    • View definitions

Configuration

Environment Variables

VERTICA_HOST=localhost
VERTICA_PORT=5433
VERTICA_DATABASE=VMart
VERTICA_USER=newdbadmin
VERTICA_PASSWORD=vertica
VERTICA_CONNECTION_LIMIT=10
VERTICA_SSL=false
VERTICA_SSL_REJECT_UNAUTHORIZED=true

Operation Permissions

ALLOW_INSERT_OPERATION=false
ALLOW_UPDATE_OPERATION=false
ALLOW_DELETE_OPERATION=false
ALLOW_DDL_OPERATION=false

Schema Permissions

SCHEMA_INSERT_PERMISSIONS=schema1:true,schema2:false
SCHEMA_UPDATE_PERMISSIONS=schema1:true,schema2:false
SCHEMA_DELETE_PERMISSIONS=schema1:true,schema2:false
SCHEMA_DDL_PERMISSIONS=schema1:true,schema2:false

Installation

Installing via Smithery

To install Vertica Database Connector for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @nolleh/mcp-vertica --client claude

Installing Manually

Open your favorite mcp client's config file, then configure with uvx mcp-vertica

Example: Mcp Server Setting

Development

Debug Mode

When running with Docker, you can enable debug logging by setting the DEBUG environment variable:

# Run with maximum verbosity (-vvv)
docker run -e DEBUG=3 -e VERTICA_HOST=localhost ... nolleh/mcp-vertica:latest

# Run with medium verbosity (-vv)
docker run -e DEBUG=2 -e VERTICA_HOST=localhost ... nolleh/mcp-vertica:latest

# Pass additional arguments
docker run -e EXTRA_ARGS="--connection-limit=20" -e VERTICA_HOST=localhost ... nolleh/mcp-vertica:latest

In docker-compose.yml:

environment:
  DEBUG: 3  # 0=none, 1=-v, 2=-vv, 3=-vvv
  EXTRA_ARGS: "--connection-limit=20"  # Optional additional arguments

Appendix: For Testing, VerticaDB Docker Compose Example

version: "3.8"

services:
  vertica:
    # image: vertica/vertica-ce:11.1.0-0
    image: vertica/vertica-ce:latest
    platform: linux/amd64
    container_name: vertica-ce
    environment:
      VERTICA_MEMDEBUG: 2
    ports:
      - "5433:5433"
      - "5444:5444"
    volumes:
      - vertica_data:/home/dbadmin/VMart
    healthcheck:
      test:
        [
          "CMD",
          "/opt/vertica/bin/vsql",
          "-h",
          "localhost",
          "-d",
          "VMart",
          "-U",
          "dbadmin",
          "-c",
          "SELECT 1",
        ]
      interval: 10s
      timeout: 5s
      retries: 5
      start_period: 30s
    restart: unless-stopped

  mcp-vertica:
    image: nolleh/mcp-vertica:latest
    container_name: mcp-vertica
    ports:
      - "8081:8081"
    environment:
      # Transport mode
      TRANSPORT: http
      PORT: 8081
      # Debug settings (0=none, 1=-v, 2=-vv, 3=-vvv)
      DEBUG: 3  # Set to 3 for maximum verbosity
      # Extra command line arguments (optional)
      # EXTRA_ARGS: "--some-flag"
      # Vertica connection settings
      VERTICA_HOST: vertica
      VERTICA_PORT: 5433
      VERTICA_DATABASE: VMart
      VERTICA_USER: dbadmin
      VERTICA_PASSWORD: ""
      VERTICA_CONNECTION_LIMIT: 10
      VERTICA_SSL: "false"
    depends_on:
      vertica:
        condition: service_healthy

volumes:
  vertica_data:
    driver: local

Then run server by following instruction Example: Mcp Server Setting, Then see everything works as fine

License

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

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

mcp_vertica-0.1.14.tar.gz (25.4 kB view details)

Uploaded Source

Built Distribution

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

mcp_vertica-0.1.14-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file mcp_vertica-0.1.14.tar.gz.

File metadata

  • Download URL: mcp_vertica-0.1.14.tar.gz
  • Upload date:
  • Size: 25.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for mcp_vertica-0.1.14.tar.gz
Algorithm Hash digest
SHA256 7ce97191e5557e30985f521a6ee127dd6bfadd39e4a863795ce2f1d8628dc2a2
MD5 68f759c1c0b6c12b31a2cc63f70dc001
BLAKE2b-256 a4187f7b9f51e6cc5ecec281993eae0d030347dce6eaf426124ac1c48831e315

See more details on using hashes here.

File details

Details for the file mcp_vertica-0.1.14-py3-none-any.whl.

File metadata

  • Download URL: mcp_vertica-0.1.14-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for mcp_vertica-0.1.14-py3-none-any.whl
Algorithm Hash digest
SHA256 998b9b0d782bf302b395e3ade17171a38a965a89dc6699bc681bb6b88d31bd5a
MD5 536cb26499841b75821a817aa53aa502
BLAKE2b-256 6df88c7a4fd0a109918e1a1fb46aac1588354a443b96997694de95a1789e5d68

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