> For the complete documentation index, see [llms.txt](https://docs.tuannvm.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tuannvm.com/mcp-trino/docs/installation.md). Agents can also search and read this documentation through its [MCP server](https://docs.tuannvm.com/~gitbook/mcp).

# Installation Guide

## Quick Install (One-liner)

For macOS and Linux, install with a single command:

```bash
curl -fsSL https://raw.githubusercontent.com/tuannvm/mcp-trino/main/install.sh -o install.sh && chmod +x install.sh && ./install.sh
```

## Homebrew (macOS and Linux)

The easiest way to install mcp-trino is using Homebrew:

```bash
# Install mcp-trino
brew install tuannvm/mcp/mcp-trino
```

To update to the latest version:

```bash
brew update && brew upgrade mcp-trino
```

## Alternative Installation Methods

### Manual Download

1. Download the appropriate binary for your platform from the [GitHub Releases](https://github.com/tuannvm/mcp-trino/releases) page.
2. Place the binary in a directory included in your PATH (e.g., `/usr/local/bin` on Linux/macOS)
3. Make it executable (`chmod +x mcp-trino` on Linux/macOS)

### From Source

```bash
git clone https://github.com/tuannvm/mcp-trino.git
cd mcp-trino
make build
# Binary will be in ./bin/
```

## Downloads

You can download pre-built binaries for your platform:

| Platform | Architecture          | Download Link                                                                                         |
| -------- | --------------------- | ----------------------------------------------------------------------------------------------------- |
| macOS    | x86\_64 (Intel)       | [Download](https://github.com/tuannvm/mcp-trino/releases/latest/download/mcp-trino-darwin-amd64)      |
| macOS    | ARM64 (Apple Silicon) | [Download](https://github.com/tuannvm/mcp-trino/releases/latest/download/mcp-trino-darwin-arm64)      |
| Linux    | x86\_64               | [Download](https://github.com/tuannvm/mcp-trino/releases/latest/download/mcp-trino-linux-amd64)       |
| Linux    | ARM64                 | [Download](https://github.com/tuannvm/mcp-trino/releases/latest/download/mcp-trino-linux-arm64)       |
| Windows  | x86\_64               | [Download](https://github.com/tuannvm/mcp-trino/releases/latest/download/mcp-trino-windows-amd64.exe) |

Or see all available downloads on the [GitHub Releases](https://github.com/tuannvm/mcp-trino/releases) page.

## Installation Troubleshooting

If you encounter issues during installation:

**Common Issues:**

* **Binary not found in PATH**: The install script installs to `~/.local/bin` by default. Make sure this directory is in your PATH:

  ```bash
  export PATH="$HOME/.local/bin:$PATH"
  ```

  Add this to your shell profile (`.bashrc`, `.zshrc`, etc.) to make it permanent.
* **Permission denied**: If you get permission errors, ensure the install directory is writable:

  ```bash
  mkdir -p ~/.local/bin
  chmod 755 ~/.local/bin
  ```
* **Claude configuration not found**: If the install script doesn't detect your Claude installation:
  * For Claude Desktop: Check if the config file exists at the expected location
  * For Claude Code: Verify the `claude` command is available in PATH
  * Use the manual configuration instructions provided by the script
* **GitHub API rate limiting**: If you're hitting GitHub API rate limits:

  ```bash
  export GITHUB_TOKEN=your_github_token
  curl -fsSL https://raw.githubusercontent.com/tuannvm/mcp-trino/main/install.sh | bash
  ```

**Getting Help:**

* Check the [GitHub Issues](https://github.com/tuannvm/mcp-trino/issues) for similar problems
* Run the install script with `--help` for usage information
* Use manual installation methods if the automated script fails

## Testing Your Installation

After installation, verify mcp-trino works correctly:

### Test CLI Mode

```bash
# Verify binary is installed
mcp-trino --version

# Test with a local Trino instance (if available)
export TRINO_HOST=localhost TRINO_PORT=8080 TRINO_USER=trino
mcp-trino catalogs

# Or use config file (YAML or JSON)
mkdir -p ~/.config/trino
cat > ~/.config/trino/config.yaml << EOF
current: default
profiles:
  default:
    host: localhost
    port: 8080
    user: trino
    catalog: memory
    schema: default
EOF

mcp-trino catalogs
```

### Test Interactive REPL

```bash
# Start interactive mode
mcp-trino --interactive

# In the REPL, try:
trino> \help
trino> \catalogs
trino> \quit
```

### Test MCP Mode

```bash
# Should start MCP server (no args, no TTY)
echo "" | mcp-trino

# Should show "Starting Trino MCP Server" in output
```

For more CLI usage examples, see the [CLI Mode](https://docs.tuannvm.com/mcp-trino/readme.md#cli-mode) section in the main README.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.tuannvm.com/mcp-trino/docs/installation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
