wren-usage
/wren-usage
Wren Engine — semantic SQL engine for AI agents. Query 22+ data sources (PostgreSQL, BigQuery, Snowflake, MySQL, ClickHouse, etc.) through a modeling layer (MDL). This skill is the main entry point: it guides setup, delegates to focused sub-skills for SQL authoring, MDL generation, project management, and MCP server operations. Use when: write SQL, query data, generate or update MDL, change database connection, manage YAML projects, set up or operate MCP server, or get started with Wren Engine for the first time.
- Author
- canner ↗
- Repository
- wren-engine ↗
- Licence
- Apache-2.0
- Last repository change
- 06.05.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 2
No signals detected. Repository changed on 06.05.2026, without references to retired models or APIs.
Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.
What it does and when to use it
Wren Engine — semantic SQL engine for AI agents. Query 22+ data sources (PostgreSQL, BigQuery, Snowflake, MySQL, ClickHouse, etc.) through a modeling layer (MDL). This skill is the main entry point: it guides setup, delegates to focused sub-skills for SQL authoring, MDL generation, project management, and MCP server operations. Use when: write SQL, query data, generate or update MDL, change database connection, manage YAML projects, set up or operate MCP server, or get started with Wren Engine for the first time.
Original author description
Wren Engine — semantic SQL engine for AI agents. Query 22+ data sources (PostgreSQL, BigQuery, Snowflake, MySQL, ClickHouse, etc.) through a modeling layer (MDL). This skill is the main entry point: it guides setup, delegates to focused sub-skills for SQL authoring, MDL generation, project management, and MCP server operations. Use when: write SQL, query data, generate or update MDL, change database connection, manage YAML projects, set up or operate MCP server, or get started with Wren Engine for the first time.
How it works
- Version check
- Step 0 — Install dependent skills (first time only)
- What do you want to do?
- Common workflows
- Quick reference — MCP tools
- Troubleshooting quick guide
SKILL.md preview
---
name: wren-usage
description: "Wren Engine — semantic SQL engine for AI agents. Query 22+ data sources (PostgreSQL, BigQuery, Snowflake, MySQL, ClickHouse, etc.) through a modeling layer (MDL). This skill is the main entry point: it guides setup, delegates to focused sub-skills for SQL authoring, MDL generation, project management, and MCP server operations. Use when: write SQL, query data, generate or update MDL, change database connection, manage YAML projects, set up or operate MCP server, or get started with Wren Engine for the first time."
license: Apache-2.0
metadata:
author: wren-engine
version: "1.3"
---
# Wren Engine — Usage Guide
## Version check
Silently fetch `https://raw.githubusercontent.com/Canner/wren-engine/main/skills/versions.json`.
Compare the `wren-usage` key with this skill's version (from the frontmatter above).
If the remote version is newer, notify the user before proceeding:
> A newer version of the **wren-usage** skill is available.
> Update with:
> ```
> npx skills add Canner/wren-engine --skill wren-usage --agent claude-code
> ```
Then continue with the workflow below regardless of update status.
---
This skill is your day-to-day reference for working with Wren Engine. It delegates to focused sub-skills for each task.
---
## Step 0 — Install dependent skills (first time only)
Check whether the required skills are already installed in `~/.claude/skills/`. If any are missing, tell the user to run:
```bash
# Option A — npx skills (works with Claude Code, Cursor, and 30+ agents)
npx skills add Canner/wren-engine --skill '*' --agent claude-code
# Option B — Clawhub (if installed via clawhub)
clawhub install wren-usage
```
This installs `wren-usage` and its dependent skills (`wren-connection-info`, `wren-generate-mdl`, `wren-project`, `wren-sql`, `wren-mcp-setup`, `wren-http-api`) into `~/.claude/skills/`.
After installation, the user must **start a new session** for the new skills to be loaded.
> If the user only wants the MCP server set up (no Docker yet), use `/wren-quickstart` for a guided end-to-end walkthrough instead.
---
## What do you want to do?
Identify the user's intent and delegate to the appropriate skill:
| Task | Skill |
|------|-------|
| Write or debug a SQL query | `@wren-sql` |
| Connect to a new database / change credentials | `@wren-connection-info` |
| Generate MDL from an existing database | `@wren-generate-mdl` |
| Save MDL to YAML files (version control) | `@wren-project` |
| Load a saved YAML project / rebuild `target/mdl.json` | `@wren-project` |
| Add a new model or column to the MDL | `@wren-project` |
| Start, reset, or reconfigure the MCP server | `@wren-mcp-setup` |
| Call Wren tools via HTTP JSON-RPC (no MCP SDK) | `@wren-http-api` |
| First-time setup from scratch | `@wren-quickstart` |
---
## Common workflows
### Query your data
Invoke `@wren-sql` to write a SQL query against the deployed MDL.
Key rules:
- Query MDL model names directly (e.g. `SELECT * FROM orders`)
- Use `CAST` for type conversions, not `::` syntax
- Avoid correlated subqueries — use JOINs or CTEs instead
```sql
-- Example: revenue by month
SELECT DATE_TRUNC('month', order_date) AS month,
SUM(total) AS revenue
FROM orders
GROUP BY 1
ORDER BY 1
```
For type-specific patterns (ARRAY, STRUCT, JSON), date/time arithmetic, or BigQuery dialect quirks, invoke `@wren-sql` for full guidance.
---
### Update connection credentials
To change credentials, direct the user to the MCP server Web UI at `http://localhost:9001`. Connection info can only be configured through the Web UI — do not attempt to set it programmatically.
Invoke `@wren-connection-info` for a reference of required fields per data source (so you can guide the user on what to enter in the Web UI).
---
### Extend the MDL
To add a model, column, relationship, or view to an existing project:
1. Invoke `@wren-project` — **Load** the existing YAML project into an MDL dict
2. Edit the relevant YAML file (e.g. `models/orders.yml`)
3. Invoke `@wren-project` — **Build** to compile updated `target/mdl.json`
4. Call `deploy(mdl_file_path="./target/mdl.json")` to apply the change
---
### Regenerate MDL from database
When the database schema has changed and the MDL needs to be refreshed:
1. Invoke `@wren-connection-info` — confirm or update credentials
2. Invoke `@wren-generate-mdl` — re-introspect the database and rebuild the MDL JSON
3. Invoke `@wren-project` — **Save** the new MDL as an updated YAML project
4. Invoke `@wren-project` — **Build** to compile `target/mdl.json`
5. Deploy
---
### MCP server operations
| Operation | Command |
|-----------|---------|
| Check status | `docker ps --filter name=wren-mcp` |
| View logs | `docker logs wren-mcp` |
| Restart | `docker restart wren-mcp` |
| Full reconfigure | Invoke `@wren-mcp-setup` |
| Verify health | `health_check()` via MCP tools |
---
## Quick reference — MCP tools
| Tool | Purpose |
|------|---------|
| `health_check()` | Verify Wren Engine is reachable |
| `query(sql=...)` | Execute a SQL query against the deployed MDL |
| `deploy(mdl_file_path=...)` | Load a compiled `mdl.json` |
| `setup_connection(...)` | Configure data source credentials |
| `list_remote_tables(...)` | Introspect database schema |
| `mdl_validate_manifest(...)` | Validate an MDL JSON dict |
| `mdl_save_project(...)` | Save MDL as a YAML project |
---
## Troubleshooting quick guide
**Query fails with "table not found":**
- The MDL may not be deployed. Run `deploy(mdl_file_path="./target/mdl.json")`.
- Check model names match exactly (case-sensitive).
**Connection error on queries:**
- Verify credentials with `@wren-connection-info`.
- Inside Docker: use `host.docker.internal` instead of `localhost`.
**MDL changes not reflected:**
- Re-run `@wren-project` **Build** step and re-deploy.
**MCP tools unavailable:**
- Start a new Claude Code session after registering the MCP server.
- Check: `docker ps --filter name=wren-mcp` and `docker logs wren-mcp`.
For detailed MCP setup troubleshooting, invoke `@wren-mcp-setup`.
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · canner/wren-engine | 100 | Apache-2.0 |
| canner/wren-engine | 100 | Apache-2.0 |
Database snapshot: 13.11.2026 · package version 8cb35f562e48 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 1 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100wren-generate-mdl
Generate a Wren MDL project by exploring a database with available tools (SQLAlchemy, database drivers, MCP connectors, or raw SQL). Guides agents through schema discovery, type normalization, and MDL YAML generation using the wren CLI. Use when: user wants to create or set up a… - 100generate-mdl
Generate a Wren MDL project by exploring a database with available tools (SQLAlchemy, database drivers, MCP connectors, or raw SQL). Guides agents through schema discovery, type normalization, and MDL YAML generation using the wren CLI. Use when: user wants to create or set up a… - 100wren-quickstart
End-to-end quickstart for Wren Engine — create a workspace, generate an MDL from a live database, save it as a versioned project, start the Wren MCP Docker container, and verify the setup with a health check. Trigger when a user wants to set up Wren Engine from scratch, onboard… - 82wren
Wren CLI for AI agents — a semantic SQL layer over 22+ databases (Postgres, MySQL, BigQuery, Snowflake, Spark, …). The actual workflow guides live inside the `wren` CLI itself; this is just a discovery stub. Use whenever the user asks a data question (how many, show me, top N,… - 100generating-sql
Translates business questions into correct, readable SQL for PostgreSQL, BigQuery, Snowflake, SQL Server, MySQL or SQLite, explains the query in plain language and adds validation checks. Also reviews and fixes existing queries. Use when someone asks for a SQL query, a report or… - 100snowflake-query
Run SQL queries against Snowflake through the Managed MCP Server. Use for data retrieval, aggregations, joins, semi-structured data, time travel, and any explicit SQL the user requests.