You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(skills,docs): reorder flow — register MCP before generate-mdl
The previous ordering had generate-mdl (Phase 2) before MCP
registration (Phase 3). This meant agents had no MCP tools available
and fell back to calling ibis-server API directly, bypassing
connection info and hitting confusing errors.
New order across all docs and skills:
1. Start Docker container
2. Configure connection (Web UI) + Register MCP + New session
3. Generate MDL (via MCP tools)
4. Verify and query
Affected files:
- wren-quickstart skill (1.2 → 1.3)
- docs/quickstart.md Option B
- docs/getting_started_with_claude_code.md manual setup
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/getting_started_with_claude_code.md
+25-21Lines changed: 25 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -156,23 +156,43 @@ docker logs wren-mcp
156
156
157
157
> **Database on localhost?** If your database runs on your host machine, replace `localhost` / `127.0.0.1` with `host.docker.internal` in your connection settings — the container cannot reach the host's `localhost` directly.
158
158
159
-
### Phase 3 — Generate the MDL
159
+
### Phase 3 — Configure connection and register MCP server
160
160
161
-
In Claude Code, run:
161
+
Configure connection info in the Web UI at `http://localhost:9001` — select the data source type and enter credentials. Use `/wren-connection-info` in Claude Code for field reference per data source.
162
+
163
+
> **Connection info can only be configured through the Web UI.** Do not attempt to set it programmatically.
164
+
165
+
Then register the MCP server with Claude Code:
166
+
167
+
```bash
168
+
claude mcp add --transport http wren http://localhost:9000/mcp
169
+
```
170
+
171
+
Verify it was added:
172
+
173
+
```bash
174
+
claude mcp list
175
+
```
176
+
177
+
**Start a new Claude Code session** — MCP servers are only loaded at session start.
178
+
179
+
### Phase 4 — Generate the MDL
180
+
181
+
In the new session, run:
162
182
163
183
```
164
184
/generate-mdl
165
185
```
166
186
167
187
The skill will:
168
188
169
-
1. Run `health_check()` to verify the connection is configured
189
+
1. Run `health_check()` to verify the connection is working
170
190
2. Ask for your data source type (PostgreSQL, BigQuery, Snowflake, etc.) and optional schema filter
171
-
3. Call `list_remote_tables()` and `list_remote_constraints()` via the MCP server to introspect your database schema
191
+
3. Call `list_remote_tables()` and `list_remote_constraints()` via MCP tools to introspect your database schema
172
192
4. Build the MDL JSON (models, columns, relationships)
173
193
5. Validate the manifest with `deploy_manifest()` + `dry_run()`
174
194
175
-
> **Connection info** must be configured in the Web UI (`http://localhost:9001`) before running `/generate-mdl`. Use `/wren-connection-info` in Claude Code for field reference per data source.
195
+
> **Prerequisite:**The MCP server must be registered and a new session started (Phase 3). The `/generate-mdl` skill uses MCP tools — do not call ibis-server API directly.
176
196
177
197
Then save the MDL as a versioned YAML project:
178
198
@@ -182,22 +202,6 @@ Then save the MDL as a versioned YAML project:
182
202
183
203
This writes human-readable YAML files to your workspace and compiles `target/mdl.json`.
184
204
185
-
### Phase 4 — Register the MCP server
186
-
187
-
Add Wren to Claude Code's MCP configuration:
188
-
189
-
```bash
190
-
claude mcp add --transport http wren http://localhost:9000/mcp
191
-
```
192
-
193
-
Verify it was added:
194
-
195
-
```bash
196
-
claude mcp list
197
-
```
198
-
199
-
**Start a new Claude Code session** — MCP servers are only loaded at session start.
#### Phase 2 — Configure the connection and generate the MDL
144
+
#### Phase 2 — Configure connection and register MCP server
145
145
146
-
Before generating the MDL, configure the DuckDB connection via the Web UI at `http://localhost:9001`:
146
+
Configure the DuckDB connection via the Web UI at `http://localhost:9001`:
147
147
148
148
1. Open `http://localhost:9001` in your browser
149
149
2. Select data source type: **DUCKDB**
@@ -161,33 +161,37 @@ The JSON looks like:
161
161
162
162
> **Common mistake:** Do not point `url` to the `.duckdb` file directly (e.g. `/data/jaffle_shop.duckdb`). The ibis-server expects a **directory** — it scans for all `.duckdb` files in that directory and attaches them automatically. Pointing to the binary file causes a UTF-8 decode error.
163
163
164
-
After saving the connection, run the skills in sequence in Claude Code:
164
+
Then register the MCP server with Claude Code:
165
165
166
-
```text
167
-
/generate-mdl
166
+
```bash
167
+
claude mcp add --transport http wren http://localhost:9000/mcp
168
168
```
169
169
170
-
Then save the MDL as a versioned YAML project:
170
+
Verify it was added:
171
171
172
-
```text
173
-
/wren-project
172
+
```bash
173
+
claude mcp list
174
174
```
175
175
176
-
This writes human-readable YAML files to `~/wren-workspace/` and compiles `target/mdl.json`.
176
+
**Start a new Claude Code session** — MCP servers are only loaded at session start.
177
177
178
-
#### Phase 3 — Register the MCP server
178
+
#### Phase 3 — Generate the MDL
179
179
180
-
```bash
181
-
claude mcp add --transport http wren http://localhost:9000/mcp
180
+
In the new session, run the skills in sequence:
181
+
182
+
```text
183
+
/generate-mdl
182
184
```
183
185
184
-
Verify it was added:
186
+
The skill uses MCP tools (`health_check()`, `list_remote_tables()`, etc.) to introspect the database — these tools are only available after the MCP server is registered and a new session is started.
185
187
186
-
```bash
187
-
claude mcp list
188
+
Then save the MDL as a versioned YAML project:
189
+
190
+
```text
191
+
/wren-project
188
192
```
189
193
190
-
**Start a new Claude Code session** — MCP servers are only loaded at session start.
194
+
This writes human-readable YAML files to `~/wren-workspace/` and compiles `target/mdl.json`.
@@ -74,86 +74,85 @@ Recommended workspace layout after the quickstart completes:
74
74
75
75
---
76
76
77
-
## Phase 2 — Generate MDL and save project
77
+
## Phase 2 — Start Docker container and register MCP server
78
78
79
-
### 2a — Generate MDL
80
-
81
-
Invoke the **generate-mdl** skill to introspect the user's database and build the MDL manifest:
79
+
Invoke the **wren-mcp-setup** skill to start the Docker container and register the MCP server with the AI client:
82
80
83
81
```
84
-
@generate-mdl
82
+
@wren-mcp-setup
85
83
```
86
84
87
-
The generate-mdl skill will:
88
-
1. Ask for data source type and connection credentials
89
-
2. Call ibis-server to fetch table schema and foreign key constraints
90
-
3. Build the MDL JSON (models, columns, relationships)
91
-
4. Validate the manifest with a dry-plan
85
+
Pass `<WORKSPACE_PATH>` as the workspace mount path when the skill asks.
92
86
93
-
> **Important:** At this stage ibis-server may not be running yet. If the user has not started a container, proceed to Phase 3 first (start the container), then come back to generate the MDL using the running ibis-server on port 8000.
94
-
>
95
-
> Alternatively, if the user already has a running ibis-server, run Phase 2 before Phase 3.
87
+
The wren-mcp-setup skill will:
88
+
1. Start the container with `-v <WORKSPACE_PATH>:/workspace`
89
+
2. Set `MDL_PATH=/workspace/target/mdl.json`
90
+
3. Register the MCP server with the AI client (`claude mcp add`)
91
+
4. Verify the container is running
96
92
97
-
### 2b — Save as YAML project
93
+
### 2b — Configure connection info via Web UI
98
94
99
-
After the MDL is generated, invoke the **wren-project** skill to save it as a versioned YAML project inside the workspace:
95
+
Once the container is running, open the MCP server Web UI to configure connection info:
100
96
101
-
```
102
-
@wren-project
97
+
```text
98
+
http://localhost:9001
103
99
```
104
100
105
-
Direct the skill to write the project files into `<WORKSPACE_PATH>`:
101
+
Enter the data source credentials (host, port, database, user, password, etc.) inthe UI form and save. The MCP server stores and applies the connection info without exposing credentials to this conversation.
106
102
107
-
- `<WORKSPACE_PATH>/wren_project.yml`
108
-
- `<WORKSPACE_PATH>/models/*.yml`
109
-
- `<WORKSPACE_PATH>/relationships.yml`
110
-
- `<WORKSPACE_PATH>/views.yml`
103
+
>**Tip:** If your database is running locally, use `host.docker.internal` instead of `localhost` as the host address.
111
104
112
-
Then build the compiled target:
105
+
### 2c — Start a new session
113
106
114
-
- `<WORKSPACE_PATH>/target/mdl.json`
107
+
The user must **start a new Claude Code session**for the Wren MCP tools to be loaded. Instruct the user to do this now and come back to continue with Phase 3.
115
108
116
-
The Docker container will auto-load this file at startup.
109
+
>**Important:** Do not proceed to Phase 3 until the new session is started. The `generate-mdl` skill requires MCP tools (`health_check()`, `list_remote_tables()`, etc.) which are only available after the MCP server is registered and a new session is started.
117
110
118
111
---
119
112
120
-
## Phase 3 — Start and register the MCP server
113
+
## Phase 3 — Generate MDL and save project
121
114
122
-
Invoke the **wren-mcp-setup** skill to start the Docker container and register the MCP server with the AI client:
115
+
>**Prerequisite:** The MCP server must be registered and a new session started (Phase 2c). The `generate-mdl` skill uses MCP tools — do not call ibis-server API directly.
116
+
117
+
### 3a — Generate MDL
118
+
119
+
Invoke the **generate-mdl** skill to introspect the user's database and build the MDL manifest:
123
120
124
121
```
125
-
@wren-mcp-setup
122
+
@generate-mdl
126
123
```
127
124
128
-
Pass `<WORKSPACE_PATH>` as the workspace mount path when the skill asks.
125
+
The generate-mdl skill will:
126
+
1. Run `health_check()` to verify the connection is working
127
+
2. Ask for data source type and optional schema filter
128
+
3. Call `list_remote_tables()` and `list_remote_constraints()` via MCP to fetch schema
129
+
4. Build the MDL JSON (models, columns, relationships)
130
+
5. Validate the manifest with `deploy_manifest()` + `dry_run()`
129
131
130
-
The wren-mcp-setup skill will:
131
-
1. Start the container with `-v <WORKSPACE_PATH>:/workspace`
132
-
2. Set `MDL_PATH=/workspace/target/mdl.json`
133
-
3. Register the MCP server with the AI client (`claude mcp add`)
134
-
4. Verify the container is running
132
+
### 3b — Save as YAML project
135
133
136
-
> If `<WORKSPACE_PATH>/target/mdl.json` already exists before the container starts, it is loaded automatically at boot. No separate `deploy` call is needed.
134
+
After the MDL is generated, invoke the **wren-project** skill to save it as a versioned YAML project inside the workspace:
137
135
138
-
### 3b — Configure connection info via Web UI
136
+
```
137
+
@wren-project
138
+
```
139
139
140
-
Once the container is running, open the MCP server Web UI to configure connection info:
140
+
Direct the skill to write the project files into `<WORKSPACE_PATH>`:
141
141
142
-
```text
143
-
http://localhost:9001
144
-
```
142
+
- `<WORKSPACE_PATH>/wren_project.yml`
143
+
- `<WORKSPACE_PATH>/models/*.yml`
144
+
- `<WORKSPACE_PATH>/relationships.yml`
145
+
- `<WORKSPACE_PATH>/views.yml`
145
146
146
-
Enter the data source credentials (host, port, database, user, password, etc.) in the UI form and save. The MCP server stores and applies the connection info without exposing credentials to this conversation.
147
+
Then build the compiled target:
147
148
148
-
> **Tip:** If your database is running locally, use `host.docker.internal` instead of `localhost` as the host address.
149
+
- `<WORKSPACE_PATH>/target/mdl.json`
149
150
150
151
---
151
152
152
-
## Phase 4 — Verify and confirm
153
-
154
-
Once the MCP server is registered, the user must **start a new session** for the Wren MCP tools to be loaded. Instruct the user to do this now.
153
+
## Phase 4 — Verify and start querying
155
154
156
-
In the new session, ask the AI agent to run a health check:
155
+
Run a health check to confirm everything is working:
157
156
158
157
```
159
158
Use health_check() to verify Wren Engine is reachable.
0 commit comments