VAST DB MCP Server
@elementalcollision
An MCP server for agentic integration with the VAST Database and Catalog.
概览
What is VAST DB MCP Server?
An MCP server that provides a secure, structured interface between AI agents/LLMs and a VAST Data database. It exposes database schema, table metadata, sample data, and read-only SQL query execution through MCP resources and tools.
How to use VAST DB MCP Server?
Clone the repository, copy .env.example to .env, fill in your VAST DB endpoint, access key, and secret key, install dependencies, and run the server via uvicorn (using scripts/run_server.py). All resources and tools require HTTP headers X-Vast-Access-Key and X-Vast-Secret-Key for authentication, and requests are rate‑limited by client IP.
Key features of VAST DB MCP Server
- Resources:
vast://schemas,vast://tables,vast://metadata/tables/{table_name},vast://tables/{table_name} - Tool:
vast_sql_queryfor read‑only SQL execution (configurable statement types) - Header‑based authentication via
X-Vast-Access-KeyandX-Vast-Secret-Key - IP‑based rate limiting configurable via
MCP_DEFAULT_RATE_LIMITenvironment variable - Output formats: JSON or CSV/plain text, selectable per request
- Comprehensive error handling with status codes like 401, 404, 429, 500, 503
- Configurable SQL safety via
MCP_ALLOWED_SQL_TYPES(defaults toSELECT)
Use cases of VAST DB MCP Server
- AI agents exploring database schema and table metadata before generating queries
- Retrieving sample data from specific tables for quick analysis or context building
- Executing safe, read‑only SQL queries against a VAST DB from an LLM‑driven application
- Inspecting table column details (types, nullability, keys, defaults) for data understanding
FAQ from VAST DB MCP Server
How does this server differ from direct VAST DB access?
It acts as a controlled, read‑only gateway—enforcing authentication, rate limiting, and allowed SQL types while exposing structured schema/data via the MCP protocol, suitable for AI agent integration.
What are the runtime dependencies?
Python >=3.9, the MCP SDK (mcp-sdk), the VAST DB SDK (vastdb), uvicorn (ASGI server), slowapi (rate limiting), and python-dotenv for configuration.
How is authentication handled?
All requests must include X-Vast-Access-Key and X-Vast-Secret-Key HTTP headers. Failure to provide valid credentials returns a 401 UNAUTHENTICATED error. Credentials should be managed securely by the agent orchestrator, never exposed in LLM prompts.
Is rate limiting applied?
Yes, all resource and tool handlers are rate‑limited based on the client IP address. The default limit can be changed via the MCP_DEFAULT_RATE_LIMIT environment variable (e.g., "10/minute"). Exceeding the limit returns a 429 error.
What SQL operations are allowed?
Only statement types listed in the MCP_ALLOWED_SQL_TYPES environment variable are permitted. The default is SELECT alone, making the tool read‑only. This can be broadened (e.g., to allow EXPLAIN) by changing the variable.