mcp-trino CLI Release Notes v1.0
Release Date: 2025-03-25 Status: Production-Ready ✅
Overview
This release transforms mcp-trino from MCP-only to a dual-purpose tool that works both as an MCP server for AI assistants AND as an interactive CLI for human users.
What's New
CLI Mode
Interactive REPL with SQL query execution
Subcommands:
query,catalogs,schemas,tables,describe,explainOutput formats:
table,json,csvConfig file support:
~/.config/trino/config.yamlAuto-completion: Meta-commands (
\help,\quit,\history,\format, etc.)
Dual-Mode Operation
The binary automatically detects which mode to use:
MCP mode: Default when no args or
MCP_PROTOCOL_VERSIONis setCLI mode: Activated by CLI commands or
--cliflagExplicit control: Use
--mcpor--cliflags to force mode
Important Behavioral Changes
⚠️ Column Order Now Deterministic
Before: Table and CSV output had non-deterministic column order (due to Go map iteration)
After: Columns are sorted alphabetically for consistent output
Impact:
✅ Improved: Automated scripts get predictable output
⚠️ Breaking: Scripts parsing by column position may break
Recommendation: Parse by column name instead of position
Example:
Before: zebra | apple | banana (random order) After: apple | banana | zebra (alphabetically sorted)
Configuration Precedence
Values are applied in this order (later overrides earlier):
CLI flags (
--host,--port, etc.) - highest priority--profileflag (select named profile)TRINO_PROFILEenvironment variablecurrentfield in config filedefaultprofile fallbackEnvironment variables (
TRINO_HOST, etc.) - lowest priority
Example:
Mode Selection Logic
Usage Examples
Basic CLI Usage
Interactive REPL
Config File
Output Formats
Mode Selection
REPL Meta-Commands
\help
Show help
\quit, \exit, \q
Exit REPL
\history
Show command history
\catalogs
List all catalogs
\schemas [catalog]
List schemas (optional catalog)
\tables [catalog schema]
List tables (optional catalog.schema)
\describe <table>
Describe table structure
\format <fmt>
Set output format (table, json, csv)
Testing Summary
Test Coverage
Unit Tests: 100+ tests across 6 test files
Integration Tests: End-to-end binary execution tests
All Tests: Passing ✅
Linting: 0 issues ✅
Test Files
cmd/main_test.go- Mode detection, argument parsingcmd/integration_test.go- Binary execution, precedenceinternal/cli/config_test.go- Config loading, SSL handlinginternal/cli/commands_test.go- CLI commandsinternal/cli/repl_test.go- REPL behaviorinternal/cli/output_test.go- Output determinism
Known Limitations
Shell completions not yet implemented (bash/zsh)
REPL multiline queries require TTY for full testing
Tests conducted without live Trino server (structural testing)
Backward Compatibility
✅ Fully backward compatible with existing MCP integrations:
No-arg startup defaults to MCP mode
Unknown positional arguments preserve MCP behavior
MCP_PROTOCOL_VERSIONenvironment variable respectedSTDIO transport mode unchanged
Deployment Recommendations
Before Release
✅ All tests passing
✅ Linting clean
✅ Documentation complete
⚠️ Test with real Trino server if possible
Post-Release Monitoring
User feedback on column order change
Reports of MCP compatibility issues
Performance with large result sets
Rollback Plan
If critical issues arise:
Previous version available via git tags
Config file allows disabling CLI features
MCP mode fully backward compatible
Support
Documentation: See README.md and docs/ directory
Issues: Report via GitHub issues
Contributing: Pull requests welcome
Acknowledgments
Built with:
Go 1.24.11+
Trino Go Client v0.328.0
MCP Go SDK v0.41.1
Last updated
Was this helpful?