Teradata MCP Server

Teradata MCP Server

A server providing tools for querying and analyzing Teradata databases, including database management, data quality assessment, and SQL execution capabilities through an MCP interface.

Category
访问服务器

Tools

read_table_space

Get table space used for a table if table name is provided or get table space for all tables in a database if a database name is provided.

execute_read_query

Executes a SQL query to read from the database.

execute_write_query

Executes a SQL query to write to the database.

read_table_ddl

Display table DDL definition.

read_database_list

List all databases in the Teradata System.

read_table_list

List objects in a database.

read_column_description

Show detailed column information about a database table.

read_table_preview

Get data samples and structure overview from a database table.

read_table_affinity

Get tables commonly used together by database users, this is helpful to infer relationships between tables.

read_table_usage

Measure the usage of a table and views by users in a given schema, this is helpful to infer what database objects are most actively used or drive most value.

read_SQL_list

Get a list of SQL run by a user in the last number of days if a user name is provided, otherwise get list of all SQL in the last number of days.

read_database_space

Get database space if database name is provided, otherwise get all databases space allocations.

read_database_version

Get Teradata database version information.

read_resusage_summary

Get the Teradata system usage summary metrics by weekday and hour for each workload type and query complexity bucket.

read_missing_columns

Get the column names that having missing values in a table.

read_negative_columns

Get the column names that having negative values in a table.

read_destinct_categories

Get the destinct categories from column in a table.

read_standard_deviation

Get the standard deviation from column in a table.

README

Teradata MCP Server Template

Overview

The Teradata MCP server is a open source project, we welcome contributions via pull requests.

We are providing three sets of tools

  1. td_base_tools:

    • execute_read_query - runs a read query
    • execute_write_query - runs a write query
    • read_table_DDL - returns the show table results
    • read_database_list - returns a list of all databases
    • read_table_list - returns a list of tables in a database
    • read_column_description - returns description of columns in a table
    • read_table_preview - returns column information and 5 rows from the table
  2. td_dba_tools:

    • read_sql_list - returns a list of recently executed SQL for a user
    • read_table_space - returns CurrentPerm table space
    • read_database_space - returns Space allocated, space used and percentage used for a database
    • read_database_version - returns the database version information
  3. td_data_quality_tools:

    • missing_values - returns a list of column names with missing values
    • negative_values - returns a list of column names with negative values
    • distinct_categories - returns a list of categories within a column
    • standard_deviation - returns the mean and standard deviation for a column

We have also created a custom_tools section that will allow for the development of customer tools to be easily added.

The Test directory contains a simple ClientChatBot tool for testing tools.

Environment Set Up

Step 1 - The environment has been put together assuming you have the uv package installed on your local machine. Installation instructions for uv can be found at https://github.com/astral-sh/uv

Step 2 - Clone the mcp-server repository with

On Windows

mkdir MCP
cd MCP
git clone https://github.com/Teradata/teradata-mcp-server.git
cd teradata-mcp-server
uv sync
source .venv/Scripts/activate

On Mac

mkdir MCP
cd MCP
git clone https://github.com/Teradata/teradata-mcp-server.git
cd teradata-mcp-server
uv sync
source .venv/bin/activate

Step 3 - You need to update the .env file

  • Rename env file to .env

  • The database URI will have the following format teradata://username:password@host:1025/databasename, use a ClearScape Analytics Experience https://www.teradata.com/getting-started/demos/clearscape-analytics

    • the usename needs updating
    • the password needs updating
    • the Teradata host needs updating
    • the databasename needs updating
  • LLM Credentials need to be available for /test/pydanticaiBedrock.py code to work

  • SSE setting

    • SSE : Boolean to determine if your server will be using the SSE transport (SSE = True) or the stdio transport (SSE=False)
    • SSE_HOST: IP address that the server can be found at, default should be 127.0.0.1
    • SSE_PORT: Port address that the server can be fount at, default should be 8001

Example .env file

############################################
DATABASE_URI=teradata://username:password@host:1025/databasename
SSE=False
SSE_HOST=127.0.0.1
SSE_PORT=8001

############################################
aws_access_key_id=
aws_secret_access_key=
aws_session_token=
aws_region_name=

############################################
OPENAI_API_KEY=

Testing your server with MCP Inspector

Step 1 - Start the server, typer the following in your terminal

uv run mcp dev ./src/teradata_mcp_server/server.py

NOTE: If you are running this on a Windows machine and get npx, npm or node.js errors, install the required node.js software from here: https://github.com/nodists/nodist

Step 2 - Open the MCP Inspector

  • You should open the inspector tool, go to http://127.0.0.1:6274
  • Click on tools
  • Click on list tools
  • Click on read_database_list
  • Click on run

Test the other tools, each should have a successful outcome

Control+c to stop the server in the terminal

Adding your sever to an Agent using stdio

step 1 - confirm the SSE flag in .env file has been set to False

SSE=False

Step 2 - Modify the ./test/ClientChatBot.py script to point to where you installed the server, you will need to modify the following line

    td_mcp_server = MCPServerStdio('uv', ["--directory", "/Users/Daniel.Tehan/Code/MCP/teradata-mcp-server/src/teradata_mcp_server", "run", "server.py"])

Step 2 - run the ./test/ClientChatBot.py script, this will create an interactive session with the agent who has access to the MCP server.

From a terminal.

uv run ./test/ClientChatBot.py
  • Ask the agent to list the databases
  • Ask the agent to list the table in a database
  • Ask the agent to show all the objects in a database
  • Ask the agent a question that requires SQL to run against a table
  • Type "quit" to exit.

Adding tools using stdio to Visual Studio Code Co-pilot

  • confirm the SSE flag in .env file has been set to False
SSE=False
  • In VS Code, "Show and Run Commands"
  • select "MCP: Add Server"
  • select "Command Stdio"
  • enter "uv" at command to run
  • enter name of the server for the id
  • the settings.json file should open
  • modify the directory path and ensure it is pointing to where you have the server installed
  • add the args so that it looks like:
    "mcp": {
        "servers": {
            "TeradataStdio": {
                "type": "stdio",
                "command": "uv",
                "args": [
                    "--directory",
                    "/Users/Daniel.Tehan/Code/MCP/teradata-mcp-server/src/teradata_mcp_server/,
                    "run",
                    "server.py"
                ]
            }
        }
    }
  • you can start the server from within the settings.json file or you can "MCP: Start Server"

Adding tools using SSE to Visual Studio Code Co-pilot

  • confirm the SSE flag in .env file has been set to False
SSE=True
SSE_HOST=127.0.0.1
SSE_PORT=8001
  • you need to start the server from a terminal
uv run ./src/teradata_mcp_server/server.py
  • In VS Code, "Show and Run Commands"
  • select "MCP: Add Server"
  • select "HTTP Server Sent Events"
  • enter URL for the location of the server e.g. http://127.0.0.1:8001/sse
  • enter name of the server for the id
  • select user space
  • the settings.json file should open
  • add the args so that it looks like:
   "mcp": {
        "servers": {
            "TeradataSSE": {
                "type": "sse",
                "url": "http://127.0.0.1:8001/sse"
            }
        }
    }
  • within the settings.json file or you can "MCP: Start Server"

Exposing tools as REST endpoints with mcpo

You can use mcpo to expose this MCP tool as an OpenAPI-compatible HTTP server.

For example, using uv: uvx mcpo --port 8001 --api-key "top-secret" -- uv run src/teradata_mcp_server/server.py

Your Teradata tools are now available as local REST endpoints, view documentation and test it at http://localhost:8001/docs

Using the server with Open WebUI

Open WebUI is user-friendly self-hosted AI platform designed to operate entirely offline, supporting various LLM runners like Ollama. It provides a convenient way to interact with LLMs and MCP servers from an intuitive GUI. It can be integrated with this MCP server using the mcpo component.

First run mcpo as specified in the section above.

python -m venv ./env
source ./env/bin/activate
pip install open-webui   
open-webui serve

Access the UI at http://localhost:8080. To add the MCP tools, navigate to Settings > Tools > Add Connection, and enter your mcpo server connection details (eg. localhost:8001, password = top-secret if you have executed the command line in the mcpo section).

You should be able to see the tools in the Chat Control Valves section on the right and get your models to use it.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选