Integrates with Keycloak for OAuth 2.1 authentication and authorization, enabling JWT token validation, scope-based access control, and enterprise-grade security for database operations.
Enables secure database interaction with Teradata, providing tools for executing SQL queries, managing schemas (listing databases, tables, and column details), analyzing data (missing values, distinct categories, statistics), and workload management with OAuth 2.1 authentication.
Click on "Install 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., "@Teradata MCP Servershow me the top 10 customers by 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.
Teradata MCP Server with OAuth 2.1 Authentication
Overview
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.
๐ Security Features
OAuth 2.1 Authentication with Keycloak integration
JWT Token Validation using JWKS endpoints
Scope-based Authorization for fine-grained access control
Protected Resource Metadata (RFC 9728 compliant)
Token Introspection support for opaque tokens
Production-ready connection resilience and error handling
Automatic Connection Retry for improved reliability
Components
Tools
The server offers comprehensive database and workload management tools:
Query Tools
queryExecute SELECT queries to read data from the database
Required Scopes:
teradata:query,teradata:readInput:
query(string): The SELECT SQL query to execute
Returns: Query results as array of objects
Schema Tools
list_dbLists all databases in the Teradata system
Required Scopes:
teradata:readReturns: List of databases
list_tablesLists objects in a database
Required Scopes:
teradata:readInput:
db_name(string): Database name
Returns: List of database objects under provided or user default database
show_tables_detailsShow detailed information about a database tables
Required Scopes:
teradata:readInput:
table_name(string): Name of the tabledb_name(string): Name of the databaseReturns: Array of column names and data types
Analysis Tools
list_missing_valuesLists the top features with missing values in a table
Required Scopes:
teradata:read
list_negative_valuesLists how many features have negative values in a table
Required Scopes:
teradata:read
list_distinct_valuesLists how many distinct categories are there for column in the table
Required Scopes:
teradata:read
standard_deviationWhat is the mean and standard deviation for column in table?
Required Scopes:
teradata:read
๐ Quick Start
1. Basic Setup (No Authentication)
2. OAuth-Enabled Setup
Configuration
Database Connection
Connection Retry Settings
OAuth 2.1 Settings
Supported OAuth Scopes
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 operations
Transport Compatibility
OAuth 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 status
Transport Selection:
๐ณ Docker Deployment
Without OAuth (Development)
With OAuth (Production)
With Keycloak (Testing)
๐ Keycloak Setup
Automated Setup
Use the provided script to automatically configure Keycloak:
Manual Setup
See the comprehensive guide in docs/OAUTH.md for detailed Keycloak configuration instructions.
๐งช Testing OAuth
Test your OAuth configuration:
๐ API Endpoints
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
Usage with Claude Desktop
Basic Configuration
OAuth-Enabled Configuration
Usage as API container
Make sure to edit docker-compose.yml and update environment variable
๐ง Building
๐ Documentation
OAuth 2.1 Guide - Comprehensive OAuth setup and usage
Keycloak Configuration - Automated Keycloak setup
Environment Variables - Configuration reference
๐ Security Best Practices
Use HTTPS in production (
OAUTH_REQUIRE_HTTPS=true)Secure client secrets using environment variables or secret management
Implement proper token refresh for long-running applications
Follow principle of least privilege when assigning scopes
Regularly audit user permissions and access logs
๐ Troubleshooting
Common Issues
OAuth authentication fails:
Database connection issues:
Verify
DATABASE_URIformat:teradatasql://user:pass@host/databaseCheck network connectivity to Teradata server
Ensure database credentials are correct
Connection issues are automatically retried once by default
Connection retry configuration:
Set
TOOL_RETRY_MAX_ATTEMPTSto control retry behavior (0 = no retries)Set
TOOL_RETRY_DELAY_SECONDSto control delay between retriesMonitor logs for retry attempt messages
Permission denied errors:
Verify user has required OAuth scopes
Check Keycloak role assignments
Review scope mappings in client configuration
Debug Mode
Enable debug logging:
๐ค Contributing
Contributions are welcome! Please:
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Commit changes (
git commit -m 'Add amazing feature')Push to branch (
git push origin feature/amazing-feature)Open a Pull Request
๐ License
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.
๐ Acknowledgments
Model Context Protocol specification
Keycloak for OAuth 2.1 implementation
Teradata for the database platform
FastMCP for the MCP server framework