TE

Teradata MCP Server Data Analytics Tools

Streamline multi-task data analytics on Teradata with MCP server tools and smart prompts to accelerate insights and operational efficiency.

Quick Install
npx -y @Teradata/teradata-mcp-server

Overview

Teradata MCP Server is an implementation of the Model Context Protocol (MCP) that centralizes and exposes a set of data-analysis “tools” for automated or model-driven workflows against Teradata systems. It provides a small HTTP/MCP server that lets language models, agents, and developer scripts orchestrate common analytics tasks—like schema introspection, SQL generation and execution, result retrieval, and simple transformations—without embedding database credentials or business logic inside the model itself.

For developers, the server simplifies multi-step analytics by offering stable tool endpoints and a prompt-friendly interface. That reduces friction when you want to combine LLM-guided SQL generation, validation (EXPLAIN plans), execution and post-processing into repeatable flows for exploration, reporting, or automation.

Features

  • Exposes MCP-compatible tool endpoints for analytics workflows
  • Connects to Teradata with configurable credentials and secure access patterns
  • SQL generation and execution pipeline (generate → explain → run → fetch results)
  • Schema and metadata introspection (list databases, tables, columns)
  • Prompt/assistant-friendly interfaces for multi-step tasks
  • Simple HTTP API and optional Docker deployment for easy integration
  • Audit and query logging for reproducibility and governance

Installation / Configuration

Clone the repository and run with Python or Docker. Below are example steps for both methods.

Using Git + Python (development)

git clone https://github.com/Teradata/teradata-mcp-server.git
cd teradata-mcp-server
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# run the server (example)
python mcp_server/app.py --config config.yaml

Using Docker

# build (if you need to build locally)
docker build -t teradata-mcp-server .

# run with environment variables
docker run -d \
  -p 3000:3000 \
  -e TERADATA_HOST=td.example.com \
  -e TERADATA_USER=your_user \
  -e TERADATA_PASSWORD=your_password \
  --name teradata-mcp-server \
  teradata-mcp-server:latest

Docker Compose example

version: "3.8"
services:
  mcp:
    image: teradata/mcp-server:latest
    ports:
      - "3000:3000"
    environment:
      TERADATA_HOST: td.example.com
      TERADATA_USER: analytics_user
      TERADATA_PASSWORD: supersecret
      MCP_PORT: "3000"

Example minimal configuration (config.yaml)

teradata:
  host: td.example.com
  user: analytics_user
  password: supersecret
mcp:
  port: 3000
  enable_ui: true
logging:
  level: INFO

Security tips

  • Use secrets manager or environment injection for credentials; avoid committing passwords.
  • Run the server inside a trusted network or enable TLS/HTTP authentication for public deployments.
  • Enable audit logging for query provenance.

Available Tools / Resources

The server exposes a small set of tools (via MCP endpoints). Typical tools and endpoints include:

Tool namePurposeExample endpoint
sql_executorGenerate and execute SQL, return resultsPOST /api/v1/run-tool (tool=sql_executor)
schema_inspectorList databases, tables, columnsGET /api/v1/tools/schema
explain_planReturn EXPLAIN output for a SQL statementPOST /api/v1/tools/explain
prompt_libraryReusable prompts/templates for SQL/tasksGET /api/v1/tools/prompts
audit_logFetch recent query/audit eventsGET /api/v1/tools/audit

Sample API call (run SQL via the SQL executor)

curl -s -X POST "http://localhost:3000/api/v1/run-tool" \
  -H "Content-Type: application/json" \
  -d '{
    "tool": "sql_executor",
    "input": "SELECT region, SUM(sales) AS total_sales FROM sales_table WHERE sale_date >= DATE '''2025-01-01''' GROUP BY region ORDER BY total_sales DESC LIMIT 10"
  }'

Use Cases

  1. Exploratory analytics (ad-hoc)
  • Scenario: A data analyst asks for top regions by recent sales.
  • Flow: Call schema_inspector to find table names → Ask LLM to generate SQL using table/column metadata → Call explain_plan to validate performance → Use sql_executor to run and fetch results.
  • Benefit: Rapid iteration with safe validation before execution.
  1. Report automation (reproducible pipelines)
  • Scenario: Produce a weekly CSV summarizing key KPIs.
  • Flow: Store a prompt template in prompt_library, trigger MCP server via scheduler (cron/airflow), run sql_executor, and output CSV.
  • Benefit: Encapsulates query logic and execution in a stable service, simplifying orchestration.
  1. Query tuning and governance
  • Scenario: Improve long-running queries or examine resource usage.
  • Flow: Use explain_plan to get EXPLAIN output, then apply a review prompt to have the LLM suggest index/materialized view options. Log decisions via audit_log.
  • Benefit: Helps standardize review and capture rationale.
  1. App/agent integration
  • Scenario: Integrate analytics capability into customer-facing chatbot or internal agent.
  • Flow: Agent sends user intent to MCP server; server uses internal tools to fetch schema, generate safe SQL, run the query and return