- Home
- MCP servers
- Trino
Trino
- python
0
GitHub Stars
python
Language
7 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"dreadew-trino-mcp": {
"command": "make",
"args": [
"run-server"
],
"env": {
"APP_NAME": "trino-mcp",
"LOG_LEVEL": "INFO"
}
}
}
}You are using the Trino MCP Server to analyze and document Trino database schemas, validate DDL, explore dependencies, and generate documentation. This server provides safe, on-demand inspection of database structures and supports multiple connections concurrently, making it useful for understanding complex Trino deployments without executing potentially disruptive operations.
How to use
You operate this MCP server through an MCP client. The server exposes capabilities to check connectivity, inspect catalogs, schemas, and tables, describe table structures, validate and analyze DDL statements, examine dependencies, generate documentation, and monitor usage. Use the client to invoke the available functions in practical workflows such as validating new DDL before execution, analyzing dependencies before creating objects, and generating up-to-date schema documentation for teams.
How to install
Prerequisites you need to prepare before running the MCP server:
Step by step setup
# 1. Clone the project repository
git clone <repository-url>
cd trino-mcp
# 2. Install Python dependencies (recommended via Poetry)
pip install poetry
poetry install
# 3. or install via requirements.txt (if Poetry is not used)
pip install -r requirements.txt
# 4. Configure environment variables (example)
cp .env.example .env
# 5. Start the MCP server (development workflow)
make run-server
# 5b. Alternative start command (development) using Poetry
poetry run python -m src.api.server
Additional setup options
If you prefer running the MCP server directly via a local command, you can use one of the following startup methods that are shown in the project setup:
Security and environment notes
Limit exposure of your Trino credentials by using dedicated service accounts where possible. Configure your MCP client and server with minimal necessary permissions and use environment variables to avoid hard-coding sensitive values in your code. Ensure network access is restricted to trusted hosts and enable logging at an appropriate level for your environment.
Examples and workflows
Typical workflows include verifying connectivity to Trino, listing catalogs and schemas, describing tables, validating DDL expressions before execution, analyzing dependencies, executing validated DDL, and generating documentation for a given catalog/schema pair.
Troubleshooting tips
If the MCP server fails to start, verify that Python and Poetry dependencies are installed, ensure the correct environment file is present, and check logs for any connection issues to the Trino servers. Confirm that your Trino server URLs, catalogs, and schemas referenced by your MCP client are accessible from the host where you run the MCP server.
Notes
The MCP server supports running in development and containerized environments. Use the appropriate startup method for your workflow, and keep the dependencies up to date to take advantage of new analysis and documentation features.
Configuration and hosting details
You can run the server in a development mode or build a container image for production. The development workflow provides a quick iteration loop, while a containerized setup helps with reproducibility and deployment in cloud or on-prem environments.
Monitoring and usage statistics
Monitor connection usage and other statistics via the provided monitoring endpoints to understand how clients interact with the MCP server and to identify potential bottlenecks or misconfigurations.
Workflow example
- Check connectivity to your Trino instance. 2. List catalogs and schemas to understand the target structure. 3. Describe a table to review its columns and types. 4. Validate DDL statements before applying changes. 5. Analyze dependencies to determine the correct creation order. 6. Generate documentation for the schema. 7. Optionally monitor usage statistics.
Available tools
connection_status
Checks the status of the connection to the Trino server.
list_catalogs
Returns the list of available catalogs.
list_schemas
Returns the list of schemas within a catalog.
describe_table
Describes the structure of a table including column details.
validate_ddl_statements
Analyzes a list of DDL expressions without executing them.
execute_ddl_statements
Executes DDL statements after pre-validation.
analyze_schema_dependencies
Analyzes dependencies between objects and suggests a creation order.
generate_schema_documentation
Generates documentation for a database schema.
connection_stats
Provides statistics about MCP connections and usage.