by arturborycki
Provides SQL query execution, schema exploration, and built‑in data‑analysis tools for Teradata databases through a Model Context Protocol server.
Teradata MCP Server offers a set of MCP‑compatible tools that let users run SELECT statements, explore databases and tables, and perform common data‑quality and statistical analyses directly against a Teradata instance.
Add the server configuration to claude_desktop_config.json (or run it as a Docker container). The core command uses uv to start the MCP server and requires the DATABASE_URI environment variable pointing to the Teradata connection string. For Docker, update docker‑compose.yml with the same environment variables and launch with docker compose up.
query – execute arbitrary SELECT statements and receive results as JSON objects.list_db, list_tables, show_tables_details – discover databases, list objects, and retrieve column metadata.list_missing_values, list_negative_values, list_distinct_values, standard_deviation – quick data‑quality checks and basic statistics.Q: Which command starts the server?
A: Use uv run teradata-mcp (or the Docker compose workflow). The configuration expects a DATABASE_URI like teradata://user:passwd@host.
Q: Do I need to install anything manually?
A: Install the UV tool (pip install uv) and ensure the Python environment can reach the Teradata driver. Docker users only need Docker.
Q: How is authentication handled?
A: Set KEYCLOAK_ENABLED=true and provide the Keycloak server URL, realm, client ID, and secret as environment variables.
Q: Can I add custom tools?
A: Yes, MCP servers are extensible; additional Python modules can be added to the repository and referenced in the tools directory.
Q: What output format do the tools return? A: All tools return JSON‑serializable structures (arrays of objects, simple lists, or key‑value maps).
A Model Context Protocol (MCP) server implementation that provides secure database interaction and business intelligence capabilities through Teradata. This server enables running SQL queries, analyzing business data, and workload management with enterprise-grade OAuth 2.1 authentication.
The server offers comprehensive database and workload management tools:
query
teradata:query, teradata:readquery (string): The SELECT SQL query to executelist_db
teradata:readlist_tables
teradata:readdb_name (string): Database nameshow_tables_details
teradata:readtable_name (string): Name of the tabledb_name (string): Name of the databaselist_missing_values
teradata:readlist_negative_values
teradata:readlist_distinct_values
teradata:readstandard_deviation
teradata:read# Clone the repository
git clone https://github.com/arturborycki/mcp-teradata.git
cd mcp-teradata
# Install dependencies
uv install
# Run with database connection
uv run teradata-mcp "teradatasql://user:password@host/database"
# Copy environment configuration
cp .env.example .env
# Edit .env with your OAuth settings
OAUTH_ENABLED=true
KEYCLOAK_URL=https://your-keycloak.com
KEYCLOAK_REALM=teradata-realm
KEYCLOAK_CLIENT_ID=teradata-mcp
KEYCLOAK_CLIENT_SECRET=your-secret
OAUTH_RESOURCE_SERVER_URL=https://your-mcp-server.com
# Run with OAuth
uv run teradata-mcp "teradatasql://user:password@host/database"
DATABASE_URI=teradatasql://username:password@hostname/database
# Number of retry attempts for database connections (default: 1)
TOOL_RETRY_MAX_ATTEMPTS=1
# Delay between retry attempts in seconds (default: 1.0)
TOOL_RETRY_DELAY_SECONDS=1.0
# Enable OAuth authentication
OAUTH_ENABLED=true
# Keycloak configuration
KEYCLOAK_URL=https://keycloak.example.com
KEYCLOAK_REALM=teradata-realm
KEYCLOAK_CLIENT_ID=teradata-mcp
KEYCLOAK_CLIENT_SECRET=your-client-secret
# Resource server identification
OAUTH_RESOURCE_SERVER_URL=https://your-mcp-server.com
# Optional: Required scopes
OAUTH_REQUIRED_SCOPES=teradata:read,teradata:query
# Security settings
OAUTH_VALIDATE_AUDIENCE=true
OAUTH_VALIDATE_SCOPES=true
OAUTH_REQUIRE_HTTPS=true
teradata:read - Read access to database resourcesteradata:write - Write access to database resourcesteradata:query - Execute SQL queriesteradata:admin - Administrative access (TDWM, user management)teradata:schema - Schema management operationsOAuth 2.1 authentication is supported across all MCP transport methods:
| Transport | OAuth Support | Discovery Endpoints | Notes |
|---|---|---|---|
| SSE | ✅ Full Support | ✅ Available | OAuth endpoints integrated into Starlette app |
| Streamable HTTP | ✅ Full Support | ✅ Available | OAuth endpoints via FastMCP FastAPI integration |
| Stdio | ➖ N/A | ➖ N/A | No HTTP endpoints, authentication via environment |
Discovery Endpoints Available:
/.well-known/oauth-protected-resource - Protected resource metadata (RFC 9728)/.well-known/mcp-server-info - MCP server capabilities and OAuth configuration/health - Health check with OAuth statusTransport Selection:
# SSE (Server-Sent Events) - Recommended for web applications
export MCP_TRANSPORT=sse
export MCP_HOST=0.0.0.0
export MCP_PORT=8000
# Streamable HTTP - Recommended for API integrations
export MCP_TRANSPORT=streamable-http
export MCP_HOST=0.0.0.0
export MCP_PORT=8000
export MCP_PATH=/mcp/
# Stdio - For command-line clients (Claude Desktop)
export MCP_TRANSPORT=stdio
docker-compose up -d
# Edit environment variables in docker-compose.oauth.yml
docker-compose -f docker-compose.oauth.yml up -d
# Includes Keycloak server for testing
docker-compose -f docker-compose.oauth.yml up keycloak mcp-teradata
Use the provided script to automatically configure Keycloak:
# For local development
./scripts/setup-keycloak.sh http://localhost:8080 admin admin
# For remote Keycloak
./scripts/setup-keycloak.sh https://your-keycloak.com admin-user admin-pass
See the comprehensive guide in docs/OAUTH.md for detailed Keycloak configuration instructions.
Test your OAuth configuration:
# Run OAuth tests
./scripts/test-oauth.py
# Test with custom settings
./scripts/test-oauth.py --keycloak-url https://your-keycloak.com --realm your-realm
When OAuth is enabled, the server exposes discovery endpoints:
/.well-known/oauth-protected-resource - Protected resource metadata (RFC 9728)/.well-known/mcp-server-info - MCP server capabilities and OAuth info/health - Health check with OAuth status{
"mcpServers": {
"teradata": {
"command": "uv",
"args": [
"--directory",
"/Users/MCP/mcp-teradata",
"run",
"teradata-mcp"
],
"env": {
"DATABASE_URI": "teradatasql://user:passwd@host/database"
}
}
}
}
{
"mcpServers": {
"teradata": {
"command": "uv",
"args": [
"--directory",
"/Users/MCP/mcp-teradata",
"run",
"teradata-mcp"
],
"env": {
"DATABASE_URI": "teradatasql://user:passwd@host/database",
"OAUTH_ENABLED": "true",
"KEYCLOAK_URL": "https://your-keycloak.com",
"KEYCLOAK_REALM": "teradata-realm",
"KEYCLOAK_CLIENT_ID": "teradata-mcp",
"KEYCLOAK_CLIENT_SECRET": "your-secret",
"OAUTH_RESOURCE_SERVER_URL": "https://your-server.com"
}
}
}
}
# Add the server to your claude_desktop_config.json
{
"mcpServers": {
"teradata": {
"command": "uv",
"args": [
"--directory",
"/Users/MCP/mcp-teradata",
"run",
"teradata-mcp"
],
"env": {
"DATABASE_URI": "teradata://user:passwd@host"
}
}
}
}
Make sure to edit docker-compose.yml and update environment variable
docker compose build
docker compose up
uv build
OAUTH_REQUIRE_HTTPS=true)OAuth authentication fails:
# Test Keycloak connectivity
curl https://your-keycloak.com/auth/realms/master/.well-known/openid-configuration
# Check server health
curl https://your-mcp-server.com/health
Database connection issues:
DATABASE_URI format: teradatasql://user:pass@host/databaseConnection retry configuration:
TOOL_RETRY_MAX_ATTEMPTS to control retry behavior (0 = no retries)TOOL_RETRY_DELAY_SECONDS to control delay between retriesPermission denied errors:
Enable debug logging:
export LOG_LEVEL=DEBUG
export OAUTH_ENABLED=true
uv run teradata-mcp "teradatasql://user:pass@host/db"
Contributions are welcome! Please:
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.
Please log in to share your review and rating for this MCP.
Explore related MCPs that share similar capabilities and solve comparable challenges
by googleapis
An MCP server that streamlines database tool development by handling connection pooling, authentication, observability, and secure access, allowing agents to interact with databases via natural language.
by bytebase
Provides a universal gateway that lets MCP‑compatible clients explore and query MySQL, PostgreSQL, SQL Server, MariaDB, and SQLite databases through a single standardized interface.
by designcomputer
Enables secure interaction with MySQL databases via the Model Context Protocol, allowing AI applications to list tables, read contents, and execute queries safely.
by benborla
Provides read‑only access to MySQL databases for large language models, allowing schema inspection and safe execution of SQL queries.
by neo4j-contrib
Enables natural‑language interaction with Neo4j databases, allowing large language models to query, modify, and manage graph data through multiple transport modes.
by mongodb-js
Provides a Model Context Protocol server that enables interaction with MongoDB databases and MongoDB Atlas clusters through a unified API.
by ClickHouse
Enables AI assistants to run read‑only ClickHouse queries, list databases and tables, and execute embedded chDB queries through an MCP interface.
by neondatabase
Interact with Neon Postgres databases using natural language commands through the Model Context Protocol, enabling conversational database creation, migration, and query execution.
by domdomegg
Provides read and write access to Airtable bases for AI systems, enabling inspection of schemas and manipulation of records.
{
"mcpServers": {
"teradata": {
"command": "uv",
"args": [
"--directory",
"/path/to/mcp-teradata",
"run",
"teradata-mcp"
],
"env": {
"DATABASE_URI": "teradata://user:passwd@host",
"KEYCLOAK_ENABLED": "true",
"KEYCLOAK_SERVER_URL": "https://your-keycloak-server.com",
"KEYCLOAK_REALM": "mcp-realm",
"KEYCLOAK_CLIENT_ID": "teradata-mcp-client",
"KEYCLOAK_CLIENT_SECRET": "your-client-secret"
}
}
}
}claude mcp add teradata uv --directory /path/to/mcp-teradata run teradata-mcp