Trino MCP Server
Provides access to query and explore Presto/Trino-compatible databases, with schema discovery, query execution, data profiling, and result export capabilities.
Provides tools for querying and exploring Trino databases, including schema discovery, table exploration, data profiling, safe query testing, query execution, result export, encryption checks, and query history.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
🚀 Trino MCP Server
A Model Context Protocol (MCP) server that gives AI assistants (like Claude in Cursor) direct access to query and explore Trino/Presto databases.
💡 No installation required! Just configure and run with
uvx.
✨ Features
🔍 Schema Discovery - Explore schemas, tables, and columns
📊 Smart Exploration - Get schema + sample data in one call
⚡ Safe Query Testing - Automatic LIMIT for exploration queries
📈 Data Profiling - Null %, distinct counts, top values
💾 Export Results - Save to CSV, Excel, JSON, or Parquet
🔐 Encryption Check - Detect encrypted columns
📋 Query History - Find frequently used queries
Related MCP server: Trino MCP Server
🚀 Quick Start (3 minutes)
Prerequisites
Cursor IDE or Claude Desktop
Trino database credentials
Step 1: Install uv (One-time, 30 seconds)
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"💡
uvis a fast Python package manager. Theuvxcommand lets you run Python tools without installing them permanently.
Step 2: Find your uvx path
which uvx
# Usually: ~/.local/bin/uvx (macOS/Linux) or %USERPROFILE%\.local\bin\uvx (Windows)Step 3: Configure Cursor
Open your Cursor MCP settings:
macOS: ~/.cursor/mcp.json
Windows: %APPDATA%\Cursor\mcp.json
Add this config (replace the uvx path with YOUR path from Step 2):
{
"mcpServers": {
"trino": {
"command": "/Users/YOUR_USERNAME/.local/bin/uvx",
"args": ["trino-mcp-navi"],
"env": {
"TRINO_HOST": "your-trino-host.company.com",
"TRINO_PORT": "443",
"TRINO_USER": "your.email@company.com",
"TRINO_CATALOG": "awsdatacatalog",
"TRINO_DEFAULT_SCHEMA": "default"
}
}
}
}⚠️ Important: Use the full path to
uvx(not just"uvx"). Cursor doesn't inherit your shell's PATH.
Step 4: Restart Cursor
Restart Cursor completely (close and reopen) to load the MCP server.
Step 5: Test Connection
In Cursor's AI chat, type:
Test my Trino connectionThe AI will use mcp_trino_test_connection and confirm the connection.
That's it! 🎉 No pip install, no cloning repos.
🔧 Configuration Options
Environment Variable | Required | Default | Description |
| ✅ | - | Trino server hostname |
| ✅ |
| Server port (usually 443 for HTTPS) |
| ✅ | - | Your username (usually email) |
| ❌ | - | Password (if using basic auth) |
| ✅ |
| Default catalog |
| ❌ |
| Default schema |
| ❌ |
|
|
| ❌ | - | Backup host if primary fails |
📋 Available Tools (18 Total)
🔍 Discovery Tools
Tool | Description |
| Verify Trino connectivity |
| List all schemas in catalog |
| List tables in a schema |
| Get column definitions |
| Recommended: Schema + sample data in one call |
| Search for tables/columns by name |
📊 Data Quality & Analytics
Tool | Description |
| Null %, distinct values, top 5 values |
| Row count, null analysis per column |
| Partitions, distinct values, distribution |
| Find how others query this table |
| Check for encrypted columns |
⚡ Query Execution
Tool | Description |
| Quick test with auto-LIMIT (safe) |
| Execute query, return results |
| Execute + export to CSV/Excel/JSON/Parquet |
| Run SQL from a file |
🚀 Performance & Schema
Tool | Description |
| Get execution plan |
| Recent queries from session |
| SHOW CREATE TABLE |
| Compare schemas of two tables |
🎯 Example Usage
Explore a Table
Show me the schema and sample data from the users table in analytics schema→ AI uses explore_table(table_name="users", schema_name="analytics")
Run a Query
Get the top 10 customers by revenue from last month→ AI uses run_trino_query with appropriate SQL
Profile Data Quality
What's the null rate for email column in customers table?→ AI uses profile_column(table_name="customers", column_name="email", schema_name="...")
Search for Tables
Find all tables with "order" in the name→ AI uses search_catalog(search_term="order", object_type="table")
☁️ Cloud Hosting (Zero Install for Users)
Deploy the server to the cloud so users don't need to install anything!
Deploy to Railway (Recommended)
Click the button above or go to railway.app
Connect your GitHub repo
Set environment variables:
TRINO_HOST,TRINO_PORT,TRINO_USER,TRINO_CATALOG
Deploy! You'll get a URL like
https://trino-mcp-navi.up.railway.app
Deploy to Render
Go to render.com
Create new Web Service → Connect GitHub repo
Use the
render.yamlblueprintSet environment variables
Deploy!
After Deployment - User Config
Users add this to their Cursor mcp.json - no installation needed!
{
"mcpServers": {
"trino": {
"url": "https://your-deployment-url.railway.app/sse"
}
}
}That's it! The server handles everything remotely.
🐍 Alternative: Run with Python
If you prefer not to use uvx:
# Install
pip install trino-mcp-navi
# Configure Cursor with python instead of uvx
{
"mcpServers": {
"trino": {
"command": "python",
"args": ["-m", "trino_mcp_navi"],
"env": { ... }
}
}
}🔧 Troubleshooting
"Connection refused" Error
Check
TRINO_HOSTis correctVerify
TRINO_PORT(usually 443 for HTTPS, 8080 for HTTP)Ensure network/VPN access to Trino server
"Authentication failed"
Verify
TRINO_USERandTRINO_PASSWORDSome Trino setups use SSO - check with your admin
MCP Not Loading in Cursor
Check you have
uvinstalled:uv --versionVerify the JSON syntax in
mcp.jsonis validCheck Cursor logs:
Help → Toggle Developer Tools → ConsoleRestart Cursor completely
"uvx: command not found"
Install uv first:
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"🔐 Security Notes
Never commit credentials to version control
Use environment variables for sensitive data
The server connects via HTTPS by default
All queries go directly to your Trino - no external services
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Fork the repository
Create your feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add some amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
📝 License
MIT License - see the LICENSE file for details.
🆘 Support
If you encounter issues:
Check the troubleshooting section above
Verify your Trino credentials work outside of Cursor
Test with a simple query:
SELECT 1Open an issue on GitHub
Made with ❤️ for data analysts and engineers
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Work with your database from AI tools: ask, export, approved changes, and scheduled jobs.
Connect AI assistants to Preset to explore data, charts, and dashboards in authorized workspaces.
Query Postgres, MySQL, SQL Server, Oracle, BigQuery, ClickHouse and Redshift from your AI client.
Query, explore, and manage your databases through natural conversation.
Related MCP Servers
- AlicenseAqualityBmaintenanceAllows AI assistants to list tables, read data, and execute SQL queries through a controlled interface, making database exploration and analysis safer and more structured.31,418MIT
- AlicenseBqualityDmaintenanceProvides AI models with structured access to Trino's distributed SQL query engine, enabling LLMs to directly query and analyze data stored in Trino databases.310MIT
- FlicenseNot gradedqualityDmaintenanceEnables natural-language queries on Trino big data platforms, generating validated, schema-aware SQL via RAG and local LLM inference, and exposes metadata, query, and profiling tools through MCP.1-
- FlicenseNot gradedqualityAmaintenanceEnables AI assistants to execute SQL, explore database schemas and sample data, inspect system metrics, and generate Plotly charts from query results.-