Skip to content

Commit a724e6a

Browse files
committed
docs: update README with multi-transport guide and quick start
- Add Quick Start section with step-by-step instructions - Document all transport modes (stdio, streamable-http, sse) - Add Docker usage examples for all transports - Update VS Code and Claude Desktop configuration examples - Update Python version badge to 3.12+
1 parent 9d2b2a6 commit a724e6a

File tree

1 file changed

+134
-31
lines changed

1 file changed

+134
-31
lines changed

README.md

Lines changed: 134 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# MCP Trino Server
22

33
[![smithery badge](https://smithery.ai/badge/@alaturqua/mcp-trino-python)](https://smithery.ai/server/@alaturqua/mcp-trino-python)
4-
[![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg?style=flat-square&logo=python&logoColor=white)](https://www.python.org/downloads/)
4+
[![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg?style=flat-square&logo=python&logoColor=white)](https://www.python.org/downloads/)
55
[![VS Code](https://img.shields.io/badge/vscode-available-007ACC.svg?style=flat-square&logo=visual-studio-code&logoColor=white)](https://code.visualstudio.com/)
66
[![Docker](https://img.shields.io/badge/docker-available-2496ED.svg?style=flat-square&logo=docker&logoColor=white)](https://github.com/alaturqua/mcp-trino-python/pkgs/container/mcp-trino-python)
77
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg?style=flat-square)](https://opensource.org/licenses/Apache-2.0)
@@ -20,9 +20,38 @@ data exploration, querying, and table maintenance capabilities through a standar
2020
## Prerequisites
2121

2222
1. A running Trino server (or Docker Compose for local development)
23-
2. Python 3.11 or higher
23+
2. Python 3.12 or higher
2424
3. Docker (optional, for containerized deployment)
2525

26+
## Quick Start
27+
28+
### 1. Clone the Repository
29+
30+
```bash
31+
git clone https://github.com/alaturqua/mcp-trino-python.git
32+
cd mcp-trino-python
33+
```
34+
35+
### 2. Create Environment File
36+
37+
Create a `.env` file in the root directory:
38+
39+
```bash
40+
TRINO_HOST=localhost
41+
TRINO_PORT=8080
42+
TRINO_USER=trino
43+
TRINO_CATALOG=tpch
44+
TRINO_SCHEMA=tiny
45+
```
46+
47+
### 3. Run Trino Locally (Optional)
48+
49+
```bash
50+
docker-compose up -d trino
51+
```
52+
53+
This starts a Trino server on `localhost:8080` with sample TPC-H and TPC-DS data.
54+
2655
## Installation
2756

2857
### Installing via Smithery
@@ -33,49 +62,73 @@ To install MCP Trino Server for Claude Desktop automatically via [Smithery](http
3362
npx -y @smithery/cli install @alaturqua/mcp-trino-python --client claude
3463
```
3564

36-
### Running Trino Locally
65+
### Using uv (Recommended)
66+
67+
```bash
68+
uv sync
69+
uv run src/server.py
70+
```
3771

38-
The easiest way to get started is to use the included Docker Compose configuration to run Trino locally:
72+
### Using pip
3973

4074
```bash
41-
docker-compose up -d
75+
pip install -e .
76+
python src/server.py
4277
```
4378

44-
This will start a Trino server on `localhost:8080`. You can now proceed with configuring the MCP server.
79+
## Transport Modes
80+
81+
The server supports three transport modes:
82+
83+
| Transport | Description | Use Case |
84+
|-----------|-------------|----------|
85+
| `stdio` | Standard I/O (default) | VS Code, Claude Desktop, local MCP clients |
86+
| `streamable-http` | HTTP with streaming | Remote access, web clients, Docker |
87+
| `sse` | Server-Sent Events | Legacy HTTP transport |
4588

46-
### Usage with VS Code
89+
### Running with Different Transports
4790

48-
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)`.
91+
```bash
92+
# stdio (default) - for VS Code and Claude Desktop
93+
python src/server.py
94+
95+
# Streamable HTTP - for remote/web access
96+
python src/server.py --transport streamable-http --host 0.0.0.0 --port 8000
4997

50-
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.
98+
# SSE - legacy HTTP transport
99+
python src/server.py --transport sse --host 0.0.0.0 --port 8000
100+
```
51101

52-
> Note that the `mcp` key is not needed in the `.vscode/mcp.json` file.
102+
## Usage with VS Code
103+
104+
Add to your VS Code settings (`Ctrl+Shift+P``Preferences: Open User Settings (JSON)`):
53105

54106
```json
55107
{
56108
"mcp": {
57109
"servers": {
58-
"trino": {
59-
"command": "docker",
60-
"args": ["run", "--rm", "ghcr.io/alaturqua/mcp-trino-python:latest"],
61-
"env": {
62-
"TRINO_HOST": "${input:trino_host}",
63-
"TRINO_PORT": "${input:trino_port}",
64-
"TRINO_USER": "${input:trino_user}",
65-
"TRINO_PASSWORD": "${input:trino_password}",
66-
"TRINO_HTTP_SCHEME": "${input:trino_http_scheme}",
67-
"TRINO_CATALOG": "${input:trino_catalog}",
68-
"TRINO_SCHEMA": "${input:trino_schema}"
69-
}
110+
"mcp-trino-python": {
111+
"command": "uv",
112+
"args": [
113+
"run",
114+
"--with", "mcp[cli]",
115+
"--with", "trino",
116+
"--with", "loguru",
117+
"mcp", "run",
118+
"/path/to/mcp-trino-python/src/server.py"
119+
],
120+
"envFile": "/path/to/mcp-trino-python/.env"
70121
}
71122
}
72123
}
73124
}
74125
```
75126

76-
### Usage with Claude Desktop
127+
Or add to `.vscode/mcp.json` in your workspace (without the `mcp` wrapper key).
128+
129+
## Usage with Claude Desktop
77130

78-
Add the following configuration to your Claude Desktop settings:
131+
Add to your Claude Desktop configuration:
79132

80133
```json
81134
{
@@ -93,18 +146,68 @@ Add the following configuration to your Claude Desktop settings:
93146
}
94147
```
95148

96-
### Running as HTTP Server
149+
## Docker Usage
97150

98-
You can run the server with the `streamable-http` transport for HTTP-based access:
151+
### Build the Image
99152

100153
```bash
101-
python src/server.py --transport streamable-http --host 0.0.0.0 --port 8000
154+
docker build -t mcp-trino-python .
155+
```
156+
157+
### Run with stdio (for VS Code)
158+
159+
```bash
160+
docker run -i --rm \
161+
-e TRINO_HOST=host.docker.internal \
162+
-e TRINO_PORT=8080 \
163+
-e TRINO_USER=trino \
164+
mcp-trino-python
165+
```
166+
167+
### Run with Streamable HTTP
168+
169+
```bash
170+
docker run -p 8000:8000 \
171+
-e TRINO_HOST=host.docker.internal \
172+
-e TRINO_PORT=8080 \
173+
mcp-trino-python \
174+
--transport streamable-http --host 0.0.0.0 --port 8000
102175
```
103176

104-
Available transport options:
105-
- `stdio` (default): Standard input/output, recommended for Claude Desktop
106-
- `streamable-http`: HTTP-based transport with streaming support
107-
- `sse`: Server-Sent Events transport
177+
### Docker Compose
178+
179+
```bash
180+
# Start Trino + MCP server with Streamable HTTP
181+
docker-compose up -d
182+
183+
# Start with SSE transport
184+
docker-compose --profile sse up -d
185+
186+
# Run stdio for testing
187+
docker-compose --profile stdio run --rm mcp-trino-stdio
188+
```
189+
190+
### VS Code with Docker
191+
192+
```json
193+
{
194+
"mcp": {
195+
"servers": {
196+
"mcp-trino-python": {
197+
"command": "docker",
198+
"args": [
199+
"run", "-i", "--rm",
200+
"--network", "mcp-trino-python_trino-network",
201+
"-e", "TRINO_HOST=trino",
202+
"-e", "TRINO_PORT=8080",
203+
"-e", "TRINO_USER=trino",
204+
"mcp-trino-python"
205+
]
206+
}
207+
}
208+
}
209+
}
210+
```
108211

109212
## Configuration
110213

0 commit comments

Comments
 (0)