coalesce-transform-mcp
Disclaimer: This is a sample project provided as-is for reference.
MCP server for the Coalesce Transform API. Lets MCP-compatible AI assistants handle supported Coalesce workflows such as managing environments, nodes, jobs, and subgraphs, triggering runs, and selected project, user, and git-account operations from an editor or CLI.
Requirements
- Node.js >= 18.0.0 (includes npm)
- A Coalesce account with at least one workspace
- A Coalesce access token (generated from the Deploy tab in your workspace; see Coalesce API docs)
- An MCP-compatible AI client (Claude Code, Claude Desktop, Cursor, Windsurf, etc.)
- For run tools only: A Snowflake account with key pair authentication configured
Installation
1. Set Environment Variables
Add your credentials to your shell profile (~/.zshrc or ~/.bashrc):
# Coalesce API (required)
export COALESCE_ACCESS_TOKEN="your-token-here"
export COALESCE_BASE_URL="https://app.coalescesoftware.io"
export COALESCE_ORG_ID="your-org-id" # Optional: used as fallback by cancel-run
export COALESCE_REPO_PATH="/path/to/local/coalesce-repo" # Optional: fallback for repo-backed node-type tools and pipeline planning
# Snowflake Key Pair Auth (required for `start-run`, `retry-run`, `run-and-wait`, and `retry-and-wait`)
export SNOWFLAKE_USERNAME="your-snowflake-username"
export SNOWFLAKE_KEY_PAIR_KEY="/path/to/your/snowflake_key.pem"
export SNOWFLAKE_KEY_PAIR_PASS="your-key-passphrase" # Only needed for encrypted keys
export SNOWFLAKE_WAREHOUSE="your-warehouse"
export SNOWFLAKE_ROLE="your-role"
Then reload your shell:
source ~/.zshrc
2. Add the MCP Server to Your Client
Add the following to your client's MCP configuration file:
| Client | Config file location |
|---|---|
| Claude Code | .mcp.json in your project root (or ~/.claude.json for global) |
| Claude Desktop (macOS) | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Cursor | .cursor/mcp.json in your project root |
| Windsurf | ~/.codeium/windsurf/mcp_config.json |
Claude Desktop, Cursor, Windsurf (mcpServers wrapper):
{
"mcpServers": {
"coalesce-transform": {
"command": "npx",
"args": ["coalesce-transform-mcp"],
"env": {
"COALESCE_ACCESS_TOKEN": "${COALESCE_ACCESS_TOKEN}",
"COALESCE_BASE_URL": "${COALESCE_BASE_URL}",
"COALESCE_REPO_PATH": "${COALESCE_REPO_PATH}",
"SNOWFLAKE_USERNAME": "${SNOWFLAKE_USERNAME}",
"SNOWFLAKE_KEY_PAIR_KEY": "${SNOWFLAKE_KEY_PAIR_KEY}",
"SNOWFLAKE_KEY_PAIR_PASS": "${SNOWFLAKE_KEY_PAIR_PASS}",
"SNOWFLAKE_WAREHOUSE": "${SNOWFLAKE_WAREHOUSE}",
"SNOWFLAKE_ROLE": "${SNOWFLAKE_ROLE}"
}
}
}
}
Claude Code (.mcp.json — no mcpServers wrapper):
{
"coalesce-transform": {
"command": "npx",
"args": ["coalesce-transform-mcp"],
"env": {
"COALESCE_ACCESS_TOKEN": "${COALESCE_ACCESS_TOKEN}",
"COALESCE_BASE_URL": "${COALESCE_BASE_URL}",
"COALESCE_REPO_PATH": "${COALESCE_REPO_PATH}",
"SNOWFLAKE_USERNAME": "${SNOWFLAKE_USERNAME}",
"SNOWFLAKE_KEY_PAIR_KEY": "${SNOWFLAKE_KEY_PAIR_KEY}",
"SNOWFLAKE_KEY_PAIR_PASS": "${SNOWFLAKE_KEY_PAIR_PASS}",
"SNOWFLAKE_WAREHOUSE": "${SNOWFLAKE_WAREHOUSE}",
"SNOWFLAKE_ROLE": "${SNOWFLAKE_ROLE}"
}
}
}
The ${VAR} syntax pulls values from your shell environment, keeping credentials out of your config files. Pass through COALESCE_ORG_ID if you want the cancel-run fallback, and COALESCE_REPO_PATH if you want repo-backed tools and pipeline planning to default to a local repo path.
Never hardcode credentials in config files that are tracked by git. Use environment variable references (
${VAR}) instead.
Environment Variable Reference
Coalesce (required at startup)
| Variable | Description | Example |
|---|---|---|
COALESCE_ACCESS_TOKEN | Bearer token from Coalesce Deploy tab | eyJhbG... |
COALESCE_BASE_URL | Region-specific base URL (see Region Base URLs) | https://app.coalescesoftware.io |
Coalesce (optional)
| Variable | Used By | Description |
|---|---|---|
COALESCE_ORG_ID | cancel-run | Optional fallback Org ID when orgID is not passed to the tool |
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/. |
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. |
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). |
Snowflake (required for run tools: start-run, retry-run, run-and-wait, retry-and-wait)
These are validated lazily: the server starts without them, but the run-triggering tools will error if they are missing.
| Variable | Required | Description |
|---|---|---|
SNOWFLAKE_USERNAME | Yes | Snowflake account username |
SNOWFLAKE_KEY_PAIR_KEY | Yes | File path to PEM-encoded private key for Snowflake auth |
SNOWFLAKE_KEY_PAIR_PASS | No | Password to decrypt an encrypted private key |
SNOWFLAKE_WAREHOUSE | Yes | Snowflake compute warehouse |
SNOWFLAKE_ROLE | Yes | Snowflake user role |
Region Base URLs
| Region | URL |
|---|---|
| US (default) | https://app.coalescesoftware.io |
| EU (west-3) | https://app.eu.coalescesoftware.io |
| EU (west-2) | https://app.eu-west-2.aws.coalescesoftware.io |
| Canada | https://app.northamerica-northeast1.gcp.coalescesoftware.io |
| Australia | https://app.australia-southeast1.gcp.coalescesoftware.io |
Tool Reference
⚠️ = Destructive operation
API Tools
Coalesce Platform Tools: manage workspaces, environments, projects, runs, and other platform resources.
Environments
list-environments- List all available environmentsget-environment- Get details of a specific environmentcreate-environment- Create a new environment within a projectdelete-environment- Delete an environment ⚠️
Nodes
list-environment-nodes- List nodes in an environmentlist-workspace-nodes- List nodes in a workspaceget-environment-node- Get a specific environment nodeget-workspace-node- Get a specific workspace nodeset-workspace-node- Replace a workspace node with a full bodyupdate-workspace-node- Safely update selected fields of a workspace nodedelete-workspace-node- Delete a node from a workspace ⚠️
Jobs
list-jobs- List all jobs for an environmentcreate-workspace-job- Create a job in a workspace with node include/exclude selectorsget-job- Get details of a specific job (via environment)update-workspace-job- Update a job's name and node selectorsdelete-workspace-job- Delete a job ⚠️
Subgraphs
get-workspace-subgraph- Get details of a specific subgraphcreate-workspace-subgraph- Create a subgraph to group nodes visuallyupdate-workspace-subgraph- Update a subgraph's name and node membershipdelete-workspace-subgraph- Delete a subgraph (nodes are NOT deleted) ⚠️
Runs
list-runs- List runs with optional filtersget-run- Get details of a specific runget-run-results- Get results of a completed runstart-run- Start a new run; requires Snowflake Key Pair auth (credentials from env vars)run-status- Check status of a running jobretry-run- Retry a failed run; requires Snowflake Key Pair auth (credentials from env vars)cancel-run- Cancel a running job (requiresrunIDandenvironmentID;orgIDmay come fromCOALESCE_ORG_ID) ⚠️
Projects
list-projects- List all projectsget-project- Get project detailscreate-project- Create a new projectupdate-project- Update a projectdelete-project- Delete a project ⚠️
Git Accounts
list-git-accounts- List all git accountsget-git-account- Get git account detailscreate-git-account- Create a new git accountupdate-git-account- Update a git accountdelete-git-account- Delete a git account ⚠️
Users
list-org-users- List all organization usersget-user-roles- Get roles for a specific userlist-user-roles- List all user rolesset-org-role- Set organization role for a userset-project-role- Set project role for a userdelete-project-role- Remove project role from a user ⚠️set-env-role- Set environment role for a userdelete-env-role- Remove environment role from a user ⚠️
Intelligent Tools
Custom logic built on top of the API: pipeline planning, config completion, join analysis, workspace analysis, and more.
Node Creation and Configuration
create-workspace-node-from-scratch- Create a workspace node with no predecessors, apply fields to the requested completion level, and run automatic config completioncreate-workspace-node-from-predecessor- Create a node from predecessor nodes, verify column coverage, suggest join columns, and run automatic config completionreplace-workspace-node-columns- Replacemetadata.columnswholesale and optionally apply additional changes for complex column rewritesconvert-join-to-aggregation- Convert a join-style node into an aggregated fact-style node with generated JOIN/GROUP BY analysisapply-join-condition- Auto-generate and write a FROM/JOIN/ON clause for a multi-predecessor nodecomplete-node-configuration- Intelligently complete a node's configuration by analyzing context and applying best-practice ruleslist-workspace-node-types- List distinct node types observed in current workspace nodesanalyze-workspace-patterns- Analyze workspace nodes to detect package adoption, pipeline layers, methodology, and generate recommendations
Pipeline Planning and Execution
plan-pipeline- Plan a pipeline from SQL or a natural-language goal without mutating the workspace; ranks best-fit node types from the local repocreate-pipeline-from-plan- Execute an approved pipeline plan using predecessor-based creationcreate-pipeline-from-sql- Plan and create a pipeline directly from SQL
Repo-Backed Node Types and Templates
list-repo-packages- Inspect a committed local Coalesce repo and list package aliases plus enabled node-type coverage frompackages/*.ymllist-repo-node-types- List exact resolvable committed node-type identifiers fromnodeTypes/, optionally scoped to one package alias or currently in-use typesget-repo-node-type-definition- Resolve one exact committed node type from a local repo and return its outer definition plus raw and parsedmetadata.nodeMetadataSpecgenerate-set-workspace-node-template- Generate a YAML-friendlyset-workspace-nodebody template from either a raw definition object or an exact committed repo definition resolved byrepoPathorCOALESCE_REPO_PATH
Node Type Corpus
search-node-type-variants- Search the committed node-type corpus snapshot by normalized family, package, primitive, or support statusget-node-type-variant- Load one exact node-type corpus variant by variant keygenerate-set-workspace-node-template-from-variant- Generate aset-workspace-nodebody template from a committed corpus variant without needing the original external source repo at runtime; partial variants are rejected unlessallowPartial=true
Cache and Snapshots
cache-workspace-nodes- Fetch every page of workspace nodes, write the full snapshot tocoalesce_transform_mcp_data_cache/nodes/, and return only cache metadatacache-environment-nodes- Fetch every page of environment nodes, write the full snapshot tocoalesce_transform_mcp_data_cache/nodes/, and return only cache metadatacache-runs- Fetch every page of run results, write the full snapshot tocoalesce_transform_mcp_data_cache/runs/, and return only cache metadatacache-org-users- Fetch every page of organization users, write the full snapshot tocoalesce_transform_mcp_data_cache/users/, and return only cache metadataclear_coalesce_transform_mcp_data_cache- Delete all cached snapshots, auto-cached responses, and plan summaries undercoalesce_transform_mcp_data_cache/⚠️
Workflows
run-and-wait- Start a run and poll until completion; requires Snowflake Key Pair authretry-and-wait- Retry a failed run and poll until completion; requires Snowflake Key Pair authget-run-details- Get run metadata and results in one callget-environment-overview- Get environment details with full node list
Automatic Large-Response Caching
Large JSON tool and workflow responses are auto-cached to coalesce_transform_mcp_data_cache/auto-cache/.
- If the pretty-printed JSON response is at or below the inline threshold, the full payload is returned inline.
- 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 MCPresourceUriplus aresource_linkyou can read through the client. - The default threshold is
32768bytes and can be overridden withCOALESCE_MCP_AUTO_CACHE_MAX_BYTES. - Explicit cache tools such as
cache-workspace-nodesare still the better choice when you already know you want a reusable snapshot undercoalesce_transform_mcp_data_cache/.
Prompt Surface
The server also exposes reusable MCP prompts for high-value workflows:
coalesce-start-here- ID discovery and safe first steps before mutationssafe-pipeline-planning- planner-first pipeline review and approval flowrun-operations-guide- choosing the right run helper and interpreting statuseslarge-result-handling- working with cached responses andcoalesce://cache/...resources
Repo-Backed Workflow
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.
Notes:
repoPathis supported on repo-backed discovery/template tools and pipeline planning.COALESCE_REPO_PATHis an optional fallback for those repo-backed tools whenrepoPathis omitted.- The MCP does not clone repos, fetch branches, or install packages.
- If the committed repo does not contain the definition, fall back to the corpus tools.
Large Collection Workflow
When a list response would be too large for chat context, or you want a reusable artifact on disk:
- Use the matching cache tool instead of the inline list result:
cache-workspace-nodescache-environment-nodescache-runscache-org-users
- Read the returned
fileUriormetaUriresource through MCP, or follow the returnedresource_linkcontent blocks. - Use inline list tools for smaller exploratory reads and targeted follow-up calls.
Operational Guardrails
- SQL override is intentionally disallowed in this project. Repo and corpus template generation strips
overrideSQLToggle, and node write helpers rejectoverrideSQLandoverride.*fields.
Helpful Coalesce Docs
- Coalesce Docs - General product documentation, concepts, and platform guidance.
- Coalesce API Docs - Authentication, endpoints, and request/response reference for the API.
- Coalesce Marketplace Docs - Packages, marketplace-managed node types, and template authoring context.
License
MIT