-
Notifications
You must be signed in to change notification settings - Fork 13
Update project #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update project #10
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,7 +1,7 @@ | ||||||||||||||||||||||
| # MCP Trino Server | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| [](https://smithery.ai/server/@alaturqua/mcp-trino-python) | ||||||||||||||||||||||
| [](https://www.python.org/downloads/) | ||||||||||||||||||||||
| [](https://www.python.org/downloads/) | ||||||||||||||||||||||
| [](https://code.visualstudio.com/) | ||||||||||||||||||||||
| [](https://github.com/alaturqua/mcp-trino-python/pkgs/container/mcp-trino-python) | ||||||||||||||||||||||
| [](https://opensource.org/licenses/Apache-2.0) | ||||||||||||||||||||||
|
|
@@ -20,9 +20,38 @@ data exploration, querying, and table maintenance capabilities through a standar | |||||||||||||||||||||
| ## Prerequisites | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| 1. A running Trino server (or Docker Compose for local development) | ||||||||||||||||||||||
| 2. Python 3.11 or higher | ||||||||||||||||||||||
| 2. Python 3.12 or higher | ||||||||||||||||||||||
| 3. Docker (optional, for containerized deployment) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ## Quick Start | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ### 1. Clone the Repository | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||
| git clone https://github.com/alaturqua/mcp-trino-python.git | ||||||||||||||||||||||
| cd mcp-trino-python | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ### 2. Create Environment File | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Create a `.env` file in the root directory: | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||
| TRINO_HOST=localhost | ||||||||||||||||||||||
| TRINO_PORT=8080 | ||||||||||||||||||||||
| TRINO_USER=trino | ||||||||||||||||||||||
| TRINO_CATALOG=tpch | ||||||||||||||||||||||
| TRINO_SCHEMA=tiny | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ### 3. Run Trino Locally (Optional) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||
| docker-compose up -d trino | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| This starts a Trino server on `localhost:8080` with sample TPC-H and TPC-DS data. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ## Installation | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ### Installing via Smithery | ||||||||||||||||||||||
|
|
@@ -33,49 +62,77 @@ To install MCP Trino Server for Claude Desktop automatically via [Smithery](http | |||||||||||||||||||||
| npx -y @smithery/cli install @alaturqua/mcp-trino-python --client claude | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ### Running Trino Locally | ||||||||||||||||||||||
| ### Using uv (Recommended) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||
| uv sync | ||||||||||||||||||||||
| uv run src/server.py | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| The easiest way to get started is to use the included Docker Compose configuration to run Trino locally: | ||||||||||||||||||||||
| ### Using pip | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||
| docker-compose up -d | ||||||||||||||||||||||
| pip install -e . | ||||||||||||||||||||||
| python src/server.py | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| This will start a Trino server on `localhost:8080`. You can now proceed with configuring the MCP server. | ||||||||||||||||||||||
| ## Transport Modes | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| The server supports three transport modes: | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| | Transport | Description | Use Case | | ||||||||||||||||||||||
| | ----------------- | ---------------------- | ------------------------------------------ | | ||||||||||||||||||||||
| | `stdio` | Standard I/O (default) | VS Code, Claude Desktop, local MCP clients | | ||||||||||||||||||||||
| | `streamable-http` | HTTP with streaming | Remote access, web clients, Docker | | ||||||||||||||||||||||
| | `sse` | Server-Sent Events | Legacy HTTP transport | | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ### Usage with VS Code | ||||||||||||||||||||||
| ### Running with Different Transports | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| For quick installation, you can add the following configuration to your VS Code settings. You can do this by pressing `Ctrl + Shift + P` and typing `Preferences: Open User Settings (JSON)`. | ||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||
| # stdio (default) - for VS Code and Claude Desktop | ||||||||||||||||||||||
| python src/server.py | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # Streamable HTTP - for remote/web access | ||||||||||||||||||||||
| python src/server.py --transport streamable-http --host 0.0.0.0 --port 8000 | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Optionally, you can add it to a file called `.vscode/mcp.json` in your workspace. This will allow you to share the configuration with others. | ||||||||||||||||||||||
| # SSE - legacy HTTP transport | ||||||||||||||||||||||
| python src/server.py --transport sse --host 0.0.0.0 --port 8000 | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| > Note that the `mcp` key is not needed in the `.vscode/mcp.json` file. | ||||||||||||||||||||||
| ## Usage with VS Code | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Add to your VS Code settings (`Ctrl+Shift+P` → `Preferences: Open User Settings (JSON)`): | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ```json | ||||||||||||||||||||||
| { | ||||||||||||||||||||||
| "mcp": { | ||||||||||||||||||||||
| "servers": { | ||||||||||||||||||||||
| "trino": { | ||||||||||||||||||||||
| "command": "docker", | ||||||||||||||||||||||
| "args": ["run", "--rm", "ghcr.io/alaturqua/mcp-trino-python:latest"], | ||||||||||||||||||||||
| "env": { | ||||||||||||||||||||||
| "TRINO_HOST": "${input:trino_host}", | ||||||||||||||||||||||
| "TRINO_PORT": "${input:trino_port}", | ||||||||||||||||||||||
| "TRINO_USER": "${input:trino_user}", | ||||||||||||||||||||||
| "TRINO_PASSWORD": "${input:trino_password}", | ||||||||||||||||||||||
| "TRINO_HTTP_SCHEME": "${input:trino_http_scheme}", | ||||||||||||||||||||||
| "TRINO_CATALOG": "${input:trino_catalog}", | ||||||||||||||||||||||
| "TRINO_SCHEMA": "${input:trino_schema}" | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| "mcp-trino-python": { | ||||||||||||||||||||||
| "command": "uv", | ||||||||||||||||||||||
| "args": [ | ||||||||||||||||||||||
| "run", | ||||||||||||||||||||||
| "--with", | ||||||||||||||||||||||
| "mcp[cli]", | ||||||||||||||||||||||
| "--with", | ||||||||||||||||||||||
| "trino", | ||||||||||||||||||||||
| "--with", | ||||||||||||||||||||||
| "loguru", | ||||||||||||||||||||||
| "mcp", | ||||||||||||||||||||||
| "run", | ||||||||||||||||||||||
| "/path/to/mcp-trino-python/src/server.py" | ||||||||||||||||||||||
|
Comment on lines
+114
to
+122
|
||||||||||||||||||||||
| "--with", | |
| "mcp[cli]", | |
| "--with", | |
| "trino", | |
| "--with", | |
| "loguru", | |
| "mcp", | |
| "run", | |
| "/path/to/mcp-trino-python/src/server.py" | |
| "src/server.py" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The environment file example uses bash syntax highlighting (line 39) but contains environment variable assignments, not bash commands. This should use a different code fence language identifier or none at all:
Or use
envorpropertiesfor syntax highlighting instead ofbash.