coalesce-transform-mcp 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -1,56 +1,41 @@
|
|
|
1
1
|
# coalesce-transform-mcp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
MCP server for the [Coalesce](https://coalesce.io/) Transform API. Connect AI assistants like Claude, Cursor, or Windsurf to your Coalesce workspace to manage nodes, pipelines, environments, jobs, runs, and more.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Quick Start
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
- [Node.js](https://nodejs.org/) >= 18.0.0 (includes npm)
|
|
10
|
-
- A [Coalesce](https://coalesce.io/) account with at least one workspace
|
|
11
|
-
- A Coalesce access token (generated from the Deploy tab in your workspace; see [Coalesce API docs](https://docs.coalesce.io/docs/api/authentication))
|
|
12
|
-
- An MCP-compatible AI client (Claude Code, Claude Desktop, Cursor, Windsurf, etc.)
|
|
13
|
-
- **For run tools only:** A Snowflake account with key pair authentication configured
|
|
14
|
-
|
|
15
|
-
## Installation
|
|
16
|
-
|
|
17
|
-
### 1. Set Environment Variables
|
|
18
|
-
|
|
19
|
-
Add your credentials to your shell profile (`~/.zshrc` or `~/.bashrc`):
|
|
7
|
+
**1. Set your access token** in `~/.zshrc` or `~/.bashrc`:
|
|
20
8
|
|
|
21
9
|
```bash
|
|
22
|
-
# Coalesce API (required)
|
|
23
10
|
export COALESCE_ACCESS_TOKEN="your-token-here"
|
|
24
|
-
export COALESCE_BASE_URL="https://app.coalescesoftware.io"
|
|
25
|
-
export COALESCE_ORG_ID="your-org-id" # Optional: used as fallback by cancel-run
|
|
26
|
-
export COALESCE_REPO_PATH="/path/to/local/coalesce-repo" # Optional: fallback for repo-backed node-type tools and pipeline planning
|
|
27
|
-
|
|
28
|
-
# Snowflake Key Pair Auth (required for `start-run`, `retry-run`, `run-and-wait`, and `retry-and-wait`)
|
|
29
|
-
export SNOWFLAKE_USERNAME="your-snowflake-username"
|
|
30
|
-
export SNOWFLAKE_KEY_PAIR_KEY="/path/to/your/snowflake_key.pem"
|
|
31
|
-
export SNOWFLAKE_KEY_PAIR_PASS="your-key-passphrase" # Only needed for encrypted keys
|
|
32
|
-
export SNOWFLAKE_WAREHOUSE="your-warehouse"
|
|
33
|
-
export SNOWFLAKE_ROLE="your-role"
|
|
34
11
|
```
|
|
35
12
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
source ~/.zshrc
|
|
40
|
-
```
|
|
13
|
+
Generate a token from the Deploy tab in your Coalesce workspace ([docs](https://docs.coalesce.io/docs/api/authentication)).
|
|
41
14
|
|
|
42
|
-
|
|
15
|
+
**2. Add to your MCP client config:**
|
|
43
16
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
|
47
|
-
|--------|---------------------|
|
|
48
|
-
| Claude Code | `.mcp.json` in your project root (or `~/.claude.json` for global) |
|
|
17
|
+
| Client | Config file |
|
|
18
|
+
| ------ | ----------- |
|
|
19
|
+
| Claude Code | `.mcp.json` in project root (or `~/.claude.json` for global) |
|
|
49
20
|
| Claude Desktop (macOS) | `~/Library/Application Support/Claude/claude_desktop_config.json` |
|
|
50
|
-
| Cursor | `.cursor/mcp.json` in
|
|
21
|
+
| Cursor | `.cursor/mcp.json` in project root |
|
|
51
22
|
| Windsurf | `~/.codeium/windsurf/mcp_config.json` |
|
|
52
23
|
|
|
53
|
-
**Claude
|
|
24
|
+
**Claude Code** (`.mcp.json`):
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"coalesce-transform": {
|
|
29
|
+
"command": "npx",
|
|
30
|
+
"args": ["coalesce-transform-mcp"],
|
|
31
|
+
"env": {
|
|
32
|
+
"COALESCE_ACCESS_TOKEN": "${COALESCE_ACCESS_TOKEN}"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**Claude Desktop, Cursor, Windsurf** — same thing, wrapped in `"mcpServers"`:
|
|
54
39
|
|
|
55
40
|
```json
|
|
56
41
|
{
|
|
@@ -59,21 +44,65 @@ Add the following to your client's MCP configuration file:
|
|
|
59
44
|
"command": "npx",
|
|
60
45
|
"args": ["coalesce-transform-mcp"],
|
|
61
46
|
"env": {
|
|
62
|
-
"COALESCE_ACCESS_TOKEN": "${COALESCE_ACCESS_TOKEN}"
|
|
63
|
-
"COALESCE_BASE_URL": "${COALESCE_BASE_URL}",
|
|
64
|
-
"COALESCE_REPO_PATH": "${COALESCE_REPO_PATH}",
|
|
65
|
-
"SNOWFLAKE_USERNAME": "${SNOWFLAKE_USERNAME}",
|
|
66
|
-
"SNOWFLAKE_KEY_PAIR_KEY": "${SNOWFLAKE_KEY_PAIR_KEY}",
|
|
67
|
-
"SNOWFLAKE_KEY_PAIR_PASS": "${SNOWFLAKE_KEY_PAIR_PASS}",
|
|
68
|
-
"SNOWFLAKE_WAREHOUSE": "${SNOWFLAKE_WAREHOUSE}",
|
|
69
|
-
"SNOWFLAKE_ROLE": "${SNOWFLAKE_ROLE}"
|
|
47
|
+
"COALESCE_ACCESS_TOKEN": "${COALESCE_ACCESS_TOKEN}"
|
|
70
48
|
}
|
|
71
49
|
}
|
|
72
50
|
}
|
|
73
51
|
}
|
|
74
52
|
```
|
|
75
53
|
|
|
76
|
-
|
|
54
|
+
The server defaults to the US region. See [Environment Variables](#environment-variables) if you need to change the region, enable run tools, or configure repo-backed features.
|
|
55
|
+
|
|
56
|
+
> **Never hardcode credentials in config files tracked by git.** The `${VAR}` syntax pulls values from your shell environment.
|
|
57
|
+
|
|
58
|
+
## Requirements
|
|
59
|
+
|
|
60
|
+
- [Node.js](https://nodejs.org/) >= 22.0.0
|
|
61
|
+
- A [Coalesce](https://coalesce.io/) account with a workspace and access token
|
|
62
|
+
- An MCP-compatible AI client
|
|
63
|
+
- **For run tools only:** Snowflake key pair authentication (see below)
|
|
64
|
+
|
|
65
|
+
## Environment Variables
|
|
66
|
+
|
|
67
|
+
Only `COALESCE_ACCESS_TOKEN` is required. Everything else is optional.
|
|
68
|
+
|
|
69
|
+
| Variable | Description | Default |
|
|
70
|
+
| -------- | ----------- | ------- |
|
|
71
|
+
| `COALESCE_ACCESS_TOKEN` | **Required.** Bearer token from the Coalesce Deploy tab. | — |
|
|
72
|
+
| `COALESCE_BASE_URL` | Region-specific base URL. | `https://app.coalescesoftware.io` (US) |
|
|
73
|
+
| `COALESCE_ORG_ID` | Fallback org ID for `cancel-run`. | — |
|
|
74
|
+
| `COALESCE_REPO_PATH` | Local repo root for repo-backed tools and pipeline planning. | — |
|
|
75
|
+
| `COALESCE_MCP_AUTO_CACHE_MAX_BYTES` | JSON size threshold before auto-caching to disk. | `32768` |
|
|
76
|
+
| `COALESCE_MCP_MAX_REQUEST_BODY_BYTES` | Max outbound API request body size. | `524288` |
|
|
77
|
+
|
|
78
|
+
### Snowflake (for run tools only)
|
|
79
|
+
|
|
80
|
+
Required for `start-run`, `retry-run`, `run-and-wait`, and `retry-and-wait`. The server starts without them — they're validated when you first use a run tool.
|
|
81
|
+
|
|
82
|
+
| Variable | Required | Description |
|
|
83
|
+
| -------- | -------- | ----------- |
|
|
84
|
+
| `SNOWFLAKE_USERNAME` | Yes | Snowflake account username |
|
|
85
|
+
| `SNOWFLAKE_KEY_PAIR_KEY` | Yes | Path to PEM-encoded private key |
|
|
86
|
+
| `SNOWFLAKE_KEY_PAIR_PASS` | No | Passphrase for encrypted keys |
|
|
87
|
+
| `SNOWFLAKE_WAREHOUSE` | Yes | Snowflake compute warehouse |
|
|
88
|
+
| `SNOWFLAKE_ROLE` | Yes | Snowflake user role |
|
|
89
|
+
|
|
90
|
+
To use optional variables, add them to your shell profile and pass them through in your MCP config. Here's a full example with everything enabled:
|
|
91
|
+
|
|
92
|
+
**`~/.zshrc`:**
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
export COALESCE_ACCESS_TOKEN="your-token-here"
|
|
96
|
+
export COALESCE_BASE_URL="https://app.eu.coalescesoftware.io"
|
|
97
|
+
export COALESCE_REPO_PATH="/path/to/local/coalesce-repo"
|
|
98
|
+
export SNOWFLAKE_USERNAME="your-username"
|
|
99
|
+
export SNOWFLAKE_KEY_PAIR_KEY="/path/to/snowflake_key.pem"
|
|
100
|
+
export SNOWFLAKE_KEY_PAIR_PASS="your-passphrase"
|
|
101
|
+
export SNOWFLAKE_WAREHOUSE="your-warehouse"
|
|
102
|
+
export SNOWFLAKE_ROLE="your-role"
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**`.mcp.json`:**
|
|
77
106
|
|
|
78
107
|
```json
|
|
79
108
|
{
|
|
@@ -94,49 +123,7 @@ Add the following to your client's MCP configuration file:
|
|
|
94
123
|
}
|
|
95
124
|
```
|
|
96
125
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
> **Never hardcode credentials in config files that are tracked by git.** Use environment variable references (`${VAR}`) instead.
|
|
100
|
-
|
|
101
|
-
## Environment Variable Reference
|
|
102
|
-
|
|
103
|
-
### Coalesce (required at startup)
|
|
104
|
-
|
|
105
|
-
| Variable | Description | Example |
|
|
106
|
-
|----------|-------------|---------|
|
|
107
|
-
| `COALESCE_ACCESS_TOKEN` | Bearer token from Coalesce Deploy tab | `eyJhbG...` |
|
|
108
|
-
| `COALESCE_BASE_URL` | Region-specific base URL (see [Region Base URLs](#region-base-urls)) | `https://app.coalescesoftware.io` |
|
|
109
|
-
|
|
110
|
-
### Coalesce (optional)
|
|
111
|
-
|
|
112
|
-
| Variable | Used By | Description |
|
|
113
|
-
|----------|---------|-------------|
|
|
114
|
-
| `COALESCE_ORG_ID` | `cancel-run` | Optional fallback Org ID when `orgID` is not passed to the tool |
|
|
115
|
-
| `COALESCE_REPO_PATH` | Repo-backed node-type tools, `plan-pipeline`, `create-pipeline-from-sql` | Optional fallback local repo path when `repoPath` is not passed explicitly. Point this at the repo root that contains `nodeTypes/`, `nodes/`, and usually `packages/`. |
|
|
116
|
-
| `COALESCE_MCP_AUTO_CACHE_MAX_BYTES` | All JSON-returning tools/workflows | Pretty-printed JSON size threshold in bytes before the full response is automatically written to disk and only cache metadata is returned inline. Defaults to `32768`. |
|
|
117
|
-
| `COALESCE_MCP_MAX_REQUEST_BODY_BYTES` | All API-calling tools | Maximum serialized JSON body size in bytes for outbound API requests. Rejects oversized payloads before they leave the process. Defaults to `524288` (512 KB). |
|
|
118
|
-
|
|
119
|
-
### Snowflake (required for run tools: `start-run`, `retry-run`, `run-and-wait`, `retry-and-wait`)
|
|
120
|
-
|
|
121
|
-
These are validated lazily: the server starts without them, but the run-triggering tools will error if they are missing.
|
|
122
|
-
|
|
123
|
-
| Variable | Required | Description |
|
|
124
|
-
|----------|----------|-------------|
|
|
125
|
-
| `SNOWFLAKE_USERNAME` | Yes | Snowflake account username |
|
|
126
|
-
| `SNOWFLAKE_KEY_PAIR_KEY` | Yes | File path to PEM-encoded private key for Snowflake auth |
|
|
127
|
-
| `SNOWFLAKE_KEY_PAIR_PASS` | No | Password to decrypt an encrypted private key |
|
|
128
|
-
| `SNOWFLAKE_WAREHOUSE` | Yes | Snowflake compute warehouse |
|
|
129
|
-
| `SNOWFLAKE_ROLE` | Yes | Snowflake user role |
|
|
130
|
-
|
|
131
|
-
## Region Base URLs
|
|
132
|
-
|
|
133
|
-
| Region | URL |
|
|
134
|
-
|--------|-----|
|
|
135
|
-
| US (default) | `https://app.coalescesoftware.io` |
|
|
136
|
-
| EU (west-3) | `https://app.eu.coalescesoftware.io` |
|
|
137
|
-
| EU (west-2) | `https://app.eu-west-2.aws.coalescesoftware.io` |
|
|
138
|
-
| Canada | `https://app.northamerica-northeast1.gcp.coalescesoftware.io` |
|
|
139
|
-
| Australia | `https://app.australia-southeast1.gcp.coalescesoftware.io` |
|
|
126
|
+
Only include the variables you need — the Quick Start config with just `COALESCE_ACCESS_TOKEN` is enough to get started.
|
|
140
127
|
|
|
141
128
|
## Tool Reference
|
|
142
129
|
|
|
@@ -264,56 +251,17 @@ Custom logic built on top of the API: pipeline planning, config completion, join
|
|
|
264
251
|
- `get-run-details` - Get run metadata and results in one call
|
|
265
252
|
- `get-environment-overview` - Get environment details with full node list
|
|
266
253
|
|
|
267
|
-
##
|
|
268
|
-
|
|
269
|
-
Large JSON tool and workflow responses are auto-cached to `coalesce_transform_mcp_data_cache/auto-cache/`.
|
|
270
|
-
|
|
271
|
-
- If the pretty-printed JSON response is at or below the inline threshold, the full payload is returned inline.
|
|
272
|
-
- If it exceeds the threshold, the server writes the full JSON response to `coalesce_transform_mcp_data_cache/auto-cache/` and returns compact metadata with an MCP `resourceUri` plus a `resource_link` you can read through the client.
|
|
273
|
-
- The default threshold is `32768` bytes and can be overridden with `COALESCE_MCP_AUTO_CACHE_MAX_BYTES`.
|
|
274
|
-
- Explicit cache tools such as `cache-workspace-nodes` are still the better choice when you already know you want a reusable snapshot under `coalesce_transform_mcp_data_cache/`.
|
|
275
|
-
|
|
276
|
-
## Prompt Surface
|
|
277
|
-
|
|
278
|
-
The server also exposes reusable MCP prompts for high-value workflows:
|
|
279
|
-
|
|
280
|
-
- `coalesce-start-here` - ID discovery and safe first steps before mutations
|
|
281
|
-
- `safe-pipeline-planning` - planner-first pipeline review and approval flow
|
|
282
|
-
- `run-operations-guide` - choosing the right run helper and interpreting statuses
|
|
283
|
-
- `large-result-handling` - working with cached responses and `coalesce://cache/...` resources
|
|
284
|
-
|
|
285
|
-
## Repo-Backed Workflow
|
|
286
|
-
|
|
287
|
-
Use repo-backed discovery, template generation, and pipeline planning when you have a local clone of your Coalesce repo. Set `COALESCE_REPO_PATH` to the repo root (the directory containing `nodeTypes/`, `nodes/`, and usually `packages/`) or pass `repoPath` explicitly on individual tool calls.
|
|
288
|
-
|
|
289
|
-
Notes:
|
|
290
|
-
|
|
291
|
-
- `repoPath` is supported on repo-backed discovery/template tools and pipeline planning.
|
|
292
|
-
- `COALESCE_REPO_PATH` is an optional fallback for those repo-backed tools when `repoPath` is omitted.
|
|
293
|
-
- The MCP does not clone repos, fetch branches, or install packages.
|
|
294
|
-
- If the committed repo does not contain the definition, fall back to the corpus tools.
|
|
295
|
-
|
|
296
|
-
## Large Collection Workflow
|
|
297
|
-
|
|
298
|
-
When a list response would be too large for chat context, or you want a reusable artifact on disk:
|
|
299
|
-
|
|
300
|
-
1. Use the matching cache tool instead of the inline list result:
|
|
301
|
-
- `cache-workspace-nodes`
|
|
302
|
-
- `cache-environment-nodes`
|
|
303
|
-
- `cache-runs`
|
|
304
|
-
- `cache-org-users`
|
|
305
|
-
2. Read the returned `fileUri` or `metaUri` resource through MCP, or follow the returned `resource_link` content blocks.
|
|
306
|
-
3. Use inline list tools for smaller exploratory reads and targeted follow-up calls.
|
|
307
|
-
|
|
308
|
-
## Operational Guardrails
|
|
254
|
+
## Notes
|
|
309
255
|
|
|
310
|
-
-
|
|
256
|
+
- **Caching:** Large responses are auto-cached to disk. Use `cache-workspace-nodes` and similar tools when you want a reusable snapshot. Configure the threshold with `COALESCE_MCP_AUTO_CACHE_MAX_BYTES`.
|
|
257
|
+
- **Repo-backed tools:** Set `COALESCE_REPO_PATH` to your local Coalesce repo root (containing `nodeTypes/`, `nodes/`, `packages/`) or pass `repoPath` on individual tool calls. The server does not clone repos or install packages.
|
|
258
|
+
- **SQL override is disallowed.** Nodes are built via YAML/config (columns, transforms, join conditions), not raw SQL. Template generation strips `overrideSQLToggle`, and write helpers reject `overrideSQL` fields.
|
|
311
259
|
|
|
312
|
-
##
|
|
260
|
+
## Links
|
|
313
261
|
|
|
314
|
-
- [Coalesce Docs](https://docs.coalesce.io/docs)
|
|
315
|
-
- [Coalesce API Docs](https://docs.coalesce.io/docs/api/authentication)
|
|
316
|
-
- [Coalesce Marketplace Docs](https://docs.coalesce.io/docs/marketplace)
|
|
262
|
+
- [Coalesce Docs](https://docs.coalesce.io/docs)
|
|
263
|
+
- [Coalesce API Docs](https://docs.coalesce.io/docs/api/authentication)
|
|
264
|
+
- [Coalesce Marketplace Docs](https://docs.coalesce.io/docs/marketplace)
|
|
317
265
|
|
|
318
266
|
## License
|
|
319
267
|
|
package/dist/client.js
CHANGED
|
@@ -9,21 +9,18 @@ function getMaxRequestBodyBytes() {
|
|
|
9
9
|
return DEFAULT_MAX_REQUEST_BODY_BYTES;
|
|
10
10
|
return parsed;
|
|
11
11
|
}
|
|
12
|
+
const DEFAULT_BASE_URL = "https://app.coalescesoftware.io";
|
|
12
13
|
const MAX_RETRY_ATTEMPTS = 5;
|
|
13
14
|
const RETRY_BASE_DELAY_MS = 1_000;
|
|
14
15
|
const RETRY_MAX_DELAY_MS = 30_000;
|
|
15
16
|
const RETRYABLE_RATE_LIMIT_METHODS = new Set(["GET"]);
|
|
16
17
|
export function validateConfig() {
|
|
17
18
|
const accessToken = process.env.COALESCE_ACCESS_TOKEN;
|
|
18
|
-
const baseUrl = process.env.COALESCE_BASE_URL;
|
|
19
|
+
const baseUrl = process.env.COALESCE_BASE_URL || DEFAULT_BASE_URL;
|
|
19
20
|
if (!accessToken) {
|
|
20
21
|
throw new Error("COALESCE_ACCESS_TOKEN environment variable is required. " +
|
|
21
22
|
"Generate a token from the Deploy tab in Coalesce.");
|
|
22
23
|
}
|
|
23
|
-
if (!baseUrl) {
|
|
24
|
-
throw new Error("COALESCE_BASE_URL environment variable is required. " +
|
|
25
|
-
"Example: https://app.coalescesoftware.io");
|
|
26
|
-
}
|
|
27
24
|
return {
|
|
28
25
|
accessToken,
|
|
29
26
|
baseUrl: baseUrl.replace(/\/+$/, ""),
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { NodeTypeCorpusSnapshot, NodeTypeCorpusVariant, NodeTypeCorpusSupportStatus } from "./loader.js";
|
|
2
2
|
export declare function summarizeNodeTypeCorpus(snapshot: NodeTypeCorpusSnapshot): {
|
|
3
3
|
generatedAt: string;
|
|
4
|
-
sourceRoot: string;
|
|
5
4
|
packageCount: number;
|
|
6
5
|
definitionCount: number;
|
|
7
6
|
uniqueVariantCount: number;
|
|
@@ -15,7 +15,6 @@ export function summarizeNodeTypeCorpus(snapshot) {
|
|
|
15
15
|
}));
|
|
16
16
|
return {
|
|
17
17
|
generatedAt: snapshot.generatedAt,
|
|
18
|
-
sourceRoot: snapshot.sourceRoot,
|
|
19
18
|
packageCount: snapshot.packageCount,
|
|
20
19
|
definitionCount: snapshot.definitionCount,
|
|
21
20
|
uniqueVariantCount: snapshot.uniqueVariantCount,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coalesce-transform-mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"mcpName": "io.github.jessemarshall/coalesce-transform",
|
|
5
5
|
"description": "MCP server for the Coalesce Transform API; run tools support Snowflake Key Pair auth only",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"type": "module",
|
|
11
11
|
"engines": {
|
|
12
|
-
"node": ">=
|
|
12
|
+
"node": ">=22.0.0"
|
|
13
13
|
},
|
|
14
14
|
"scripts": {
|
|
15
15
|
"build": "node scripts/build.mjs",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"import:node-type-corpus": "node scripts/import-node-type-corpus.mjs",
|
|
18
18
|
"test": "vitest run",
|
|
19
19
|
"test:watch": "vitest",
|
|
20
|
-
"preversion": "node scripts/sync-version.mjs",
|
|
20
|
+
"preversion": "npm run build && npm test && npm audit --omit=dev && node scripts/sync-version.mjs",
|
|
21
21
|
"postversion": "node scripts/sync-version.mjs && git add server.json && git commit --amend --no-edit",
|
|
22
22
|
"prepublishOnly": "npm run build",
|
|
23
23
|
"prepare": "husky"
|