MCP Vertica
The MCP Vertica server provides a local NLP-to-SQL interface for Vertica databases, running entirely locally with no authentication required. Key capabilities include:
• Execute SQL queries directly against Vertica with streaming results and batching options
• Natural language to SQL conversion using a local LLM (Ollama) for both data queries and DDL operations like table creation
• Data loading via bulk COPY operations into Vertica tables
• Database introspection to retrieve table structures, columns, types, constraints, indexes, and views
• Similar incident analysis to find incidents based on ID or text description
• Multiple access methods: REST API at http://127.0.0.1:8001/api/, terminal commands via uvx mcp-vertica nlp, and SSE MCP server on port 8000
• Dry-run capabilities to preview generated SQL without execution
• Local deployment using Docker and Ollama for the complete stack
Runs Vertica CE database via Docker containers for local development and testing environments
Integrates with Ollama's local LLM service to provide natural language to SQL query translation capabilities for Vertica databases
Provides Python-based tools for executing SQL queries, managing database schemas, copying data, and streaming query results from Vertica databases
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Vertica show me the top 10 customers by total sales this month"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Vertica MCP on AWS — Two-stack CI/CD
This repository provisions two isolated stacks on AWS:
DB stack (
deploy/db/**) — Spott3.xlargeAmazon Linux 2023 instance running Vertica CE via Docker (port 5433).MCP stack (
deploy/mcp/**,src/**,tests/**,Dockerfile.mcp) — Spott3.smallinstance that pulls the MCP FastAPI server image from ECR and exposes port 8000.
Each stack has its own GitHub Actions workflow with dedicated remote Terraform state, fail-fast credential checks, and post-deploy smoke tests via AWS Systems Manager. Pushes scoped to one stack never trigger the other.
Repository layout
.
├─ deploy/
│ ├─ db/
│ │ ├─ README.md
│ │ └─ terraform/
│ │ ├─ backend-bootstrap.sh
│ │ ├─ main.tf
│ │ ├─ outputs.tf
│ │ ├─ user_data_db.sh
│ │ └─ variables.tf
│ └─ mcp/
│ ├─ README.md
│ └─ terraform/
│ ├─ backend-bootstrap.sh
│ ├─ main.tf
│ ├─ outputs.tf
│ ├─ user_data_mcp.sh
│ └─ variables.tf
├─ .github/workflows/
│ ├─ db-apply-destroy.yml
│ └─ mcp-apply-destroy.yml
├─ src/mcp_vertica/
│ ├─ __init__.py
│ └─ server.py
├─ Dockerfile.mcp
├─ tests/
│ ├─ test_health.py
│ └─ test_sql_rendering.py
├─ PROMPTS.md
├─ pyproject.toml
├─ uv.lock
└─ docker-compose.ymlRelated MCP server: Teradata MCP Server
Required repository secrets
Set these under Settings → Secrets and variables → Actions before running any workflow:
AWS_REGION(defaultap-south-1)AWS_ACCOUNT_IDEither OIDC:
AWS_ROLE_TO_ASSUMEandAWS_OIDC_ROLE_SESSION_NAME, or static keys:AWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEY
Optional:
ALLOWED_CIDRS— comma-separated IPv4 CIDRs (e.g."49.37.x.x/32","122.166.x.x/32") to open ports 5433/8000 only to those networksMCP_HTTP_TOKEN— if set, the MCP HTTP server requiresAuthorization: Bearer <token>
Workflows
DB Stack (apply/destroy)
Triggered by pushes to
deploy/db/**or manualworkflow_dispatch.Bootstraps the Terraform backend (
vertica-mcp-tf-<account>-<region>bucket + DynamoDB lock table).Applies Terraform with defaults: Spot
t3.xlarge, 50 GiB gp3 volume, Vertica CE image957650740525.dkr.ecr.ap-south-1.amazonaws.com/vertica-ce:v1.0.Runs
/usr/local/bin/db-smoke.shthrough SSM (executesSELECT NOW();viavsql).Job summary prints the public IP and a copy/paste connection string (
HOST=<ip> PORT=5433 USER=dbadmin DB=VMart).
Destroy by dispatching the workflow with action=destroy.
MCP Stack (apply/destroy + build/push)
Triggered by pushes to
deploy/mcp/**,src/**,tests/**, orDockerfile.mcp.Runs
uv sync --frozen,ruff, andpytestbefore touching AWS.Builds
Dockerfile.mcp, pushes tomcp-verticaECR repo, then applies Terraform for the MCP EC2 instance.Terraform reads the DB stack’s remote state to populate
DB_HOSTand writes/opt/mcp.envfor the container.Smoke test hits
GET /healthzvia SSM; summary prints the MCP URL (http://<ip>:8000).
Destroy by dispatching with action=destroy.
MCP server
The MCP FastAPI server (src/mcp_vertica/server.py) supports both stdio and HTTP transports. Environment variables at startup:
DB_HOST,DB_PORT(default5433),DB_USER,DB_PASSWORD,DB_NAMEOptional
MCP_HTTP_TOKENenabling bearer-token auth
Endpoints:
GET /healthzPOST /api/renderPOST /api/query
For Claude Desktop (local stdio):
{
"mcpServers": {
"vertica-local": {
"command": "uvx",
"args": ["mcp-vertica", "--transport", "stdio"]
}
}
}For remote HTTP (beta):
{
"mcpServers": {
"vertica-remote": {
"command": "npx",
"args": ["-y", "mcp-remote", "http://<MCP-PUBLIC-IP>:8000/sse"],
"env": {
"AUTH_HEADER": "Authorization: Bearer <MCP_HTTP_TOKEN>"
}
}
}
}Local development
uv sync --frozen
uv run ruff check
uv run pytest -q
MCP_HTTP_TOKEN=local DB_HOST=localhost DB_PORT=5433 DB_USER=dbadmin DB_NAME=VMart \
docker compose up --build
./scripts/wait-for-port.py localhost 8000 --timeout 120
curl -H "Authorization: Bearer local" http://127.0.0.1:8000/healthzDestroy AWS resources when idle to minimize costs; both stacks default to Spot instances with security-group ingress restricted to ALLOWED_CIDRS.
Available Tools
6 toolscopy_dataC
Copy data into a Vertica table using COPY command.
Args:
ctx: FastMCP context for progress reporting and logging
schema: vertica schema to execute the copy against
table: Target table name
data: List of rows to insert
Returns:
Status message indicating success or failure
Inputs: data (required), schema (required), table (required).
execute_queryC
Execute a SQL query and return the results.
Args:
ctx: FastMCP context for progress reporting and logging
query: SQL query to execute
database: Optional database name to execute the query against
Returns:
Query results as a string
Inputs: query (required).
get_table_structureB
Get the structure of a table including columns, data types, and constraints.
Args:
ctx: FastMCP context for progress reporting and logging
table_name: Name of the table to inspect
schema: Schema name (default: public)
Returns:
Table structure information as a string
Inputs: table_name (required), schema.
list_indexesB
List all indexes for a specific table.
Args:
ctx: FastMCP context for progress reporting and logging
table_name: Name of the table to inspect
schema: Schema name (default: public)
Returns:
Index information as a string
Inputs: table_name (required), schema.
list_viewsB
List all views in a schema.
Args:
ctx: FastMCP context for progress reporting and logging
schema: Schema name (default: public)
Returns:
View information as a string
Inputs: schema.
stream_queryC
Execute a SQL query and return the results in batches as a single string.
Args:
ctx: FastMCP context for progress reporting and logging
query: SQL query to execute
batch_size: Number of rows to fetch at once
Returns:
Query results as a concatenated string
Inputs: query (required), batch_size.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a clearly distinct purpose with no ambiguity: copy_data handles data insertion, execute_query and stream_query handle query execution with different output methods, get_table_structure inspects table schema, list_indexes lists indexes, and list_views lists views. The descriptions clearly differentiate their functions, making misselection unlikely.
All tools follow a consistent verb_noun naming pattern (copy_data, execute_query, get_table_structure, list_indexes, list_views, stream_query). The naming is uniform throughout, using snake_case and clear action-object pairs, making the tool set predictable and easy to understand.
With 6 tools, the count is well-scoped for a database server, covering core operations like querying, data insertion, and schema inspection. It feels slightly lean but reasonable, as it includes essential functions without being overwhelming. A few more tools for updates or deletions might enhance coverage, but it's not a significant gap.
The tool set covers query execution, data copying, and schema inspection well, but there are notable gaps in CRUD operations. It lacks tools for updating or deleting data, creating or modifying tables, or managing users/roles. This could cause agent failures for common database workflows beyond basic querying and insertion.
Related MCP Connectors
Query Postgres, MySQL, SQL Server, Oracle, BigQuery, ClickHouse and Redshift from your AI client.
Query, explore, and manage your databases through natural conversation.
SQL validation, formatting, parsing, metadata extraction, linting, and security analysis.
Governed SQL access to your databases: redaction, query review and an audit log.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables secure database interactions with MySQL, PostgreSQL, and SQLite through granular permissions, multi-database support, and cloud-ready SSL/TLS connections. Supports read-only modes, schema-specific permissions, and transaction management for safe database operations.12 npm1MIT
- FlicenseBqualityDmaintenanceEnables secure interaction with Teradata databases through SQL queries, schema exploration, and business intelligence analysis with enterprise-grade OAuth 2.1 authentication and workload management capabilities.89-
- AlicenseAqualityBmaintenanceEnables AI assistants to query and explore Vertica databases through natural language with readonly protection by default. Supports SQL execution, schema discovery, large dataset streaming, and Vertica-specific optimizations like projection awareness.692 npm8MIT
- AlicenseAqualityCmaintenanceEnables interaction with Microsoft SQL Server and Azure SQL databases through natural language, supporting queries, schema exploration, stored procedures, and complete database operations with connection pooling and security features.14686 npm16MIT