MCP Serverο
The strata MCP server exposes workspace operations as Model Context Protocol tools so AI assistants (VS Code Copilot, Claude, ChatGPT) can query and act on a workspace without parsing CLI text output. The server is launched by strata mcp serve and communicates over stdio (default) or SSE.
Installationο
The MCP server requires an optional extra that pulls in the mcp SDK:
pip install xyz-strata[mcp]
# or with uv
uv add xyz-strata[mcp]
Verify the server starts:
strata mcp serve --help
Quick Startο
VS Code (GitHub Copilot)ο
Add a .vscode/mcp.json (or workspace-level mcp.json) to your repository:
{
"servers": {
"strata": {
"type": "stdio",
"command": "uv",
"args": ["run", "strata", "mcp", "serve"],
"cwd": "${workspaceFolder}"
}
}
}
If you installed with
pipxreplace"uv", "run", "strata"with"strata".
Claude Desktopο
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"strata": {
"command": "uv",
"args": ["run", "strata", "mcp", "serve"],
"cwd": "/path/to/your/workspace"
}
}
}
Transport Optionsο
Flag |
Description |
|---|---|
|
Default. Used by VS Code and Claude Desktop β the MCP host spawns the process. |
|
Server-Sent Events over HTTP. Useful for shared / remote deployments. |
# stdio (default)
strata mcp serve
# SSE on port 8000
strata mcp serve --transport sse
SSE security: When exposing the SSE transport over a network, place it behind a reverse proxy (nginx, Traefik, API Gateway) that handles authentication. Do not expose the port directly.
Server Instructionsο
The server injects the following rules into every AI session automatically:
Call
workspace_statusfirst to understand the current state.Always validate files before building.
Always call
build_planbeforebuild_run.Use
deploy_planto preview changes β actual deployments must be confirmed by the user and executed via the CLI.
Tool Referenceο
workspace_statusο
Return full workspace state: readiness phases, active profile, repos, and integration health.
workspace_status(work_path?)
Arg |
Type |
Default |
Description |
|---|---|---|---|
|
string |
CWD |
Workspace root |
Returns: {success, data: {readiness, profiles, repos, integrations}, errors, messages}
The data.readiness.next_step.hint field tells the AI exactly what command the user should run next.
validate_fileο
Validate a strata YAML file against its kind-specific schema.
validate_file(file_path, work_path?, deep?)
Arg |
Type |
Default |
Description |
|---|---|---|---|
|
string |
β |
Path to the YAML file (absolute or relative to |
|
string |
CWD |
Workspace root |
|
bool |
false |
Enable Phase 2 cross-reference validation (requires an active profile) |
Returns: {success, data: {valid, kind, name, errors[]}, errors, messages}
list_schemasο
List all supported strata document kinds.
list_schemas()
Returns: {kinds: ["configuration", "deployment", "environment", ...]}
get_schemaο
Return the full JSON Schema for a document kind.
get_schema(kind)
Arg |
Type |
Description |
|---|---|---|
|
string |
Document kind (e.g. |
Returns: JSON Schema object, or {error: "..."} for unknown kinds.
scaffold_fileο
Generate a strata YAML file from its template and return the content as a string. Does not write to disk β the AI should show the content to the user and write only after confirmation.
scaffold_file(kind, name, extra_vars?)
Arg |
Type |
Default |
Description |
|---|---|---|---|
|
string |
β |
Document kind to scaffold (e.g. |
|
string |
β |
Value used for |
|
object |
|
Additional template variables (e.g. |
Returns: {kind, name, content, suggested_path}, or {error: "..."} when no template exists.
build_planο
Dry-run the build pipeline β validate and plan without writing artifacts.
build_plan(file, work_path?)
Arg |
Type |
Default |
Description |
|---|---|---|---|
|
string |
β |
Path to the deployment YAML file |
|
string |
CWD |
Workspace root |
Returns: {success, data, errors, messages}
build_runο
Run the full build pipeline and generate platform artifacts.
build_run(file, work_path?)
Arg |
Type |
Default |
Description |
|---|---|---|---|
|
string |
β |
Path to the deployment YAML file |
|
string |
CWD |
Workspace root |
Returns: {success, data, errors, messages}
build_sbomο
Generate an SBOM or dependency inventory for a deployment.
build_sbom(file?, work_path?, scan?, report?)
Arg |
Type |
Default |
Description |
|---|---|---|---|
|
string |
β |
Deployment YAML (standard mode β requires a prior |
|
string |
CWD |
Workspace root |
|
string |
β |
Directory to scan directly (scan mode β no deployment file needed) |
|
string |
|
|
Returns: {success, data, errors, messages}
deploy_planο
Preview what a deployment would do without applying any changes (dry-run).
Deployments must always be confirmed by the user and run via the CLI β never trigger a deploy via MCP without the user reviewing the plan output first.
deploy_plan(file, work_path?, stage?)
Arg |
Type |
Default |
Description |
|---|---|---|---|
|
string |
β |
Path to the deployment YAML file |
|
string |
CWD |
Workspace root |
|
string |
β |
Limit the plan to a specific stage name |
Returns: {success, data, errors, messages}
deploy_historyο
Return recent deployment execution history from workspace logs. Does not require a deployment YAML file.
deploy_history(work_path?, lines?, operation?)
Arg |
Type |
Default |
Description |
|---|---|---|---|
|
string |
CWD |
Workspace root |
|
int |
20 |
Maximum number of history entries to return |
|
string |
β |
Filter by operation type: |
Returns: {success, data: {history[]}, errors, messages}
deploy_statusο
Return live infrastructure outputs (Terraform) for a deployment. Runs terraform output -json for each stage β requires the infrastructure to be provisioned.
deploy_status(file, work_path?, stage?)
Arg |
Type |
Default |
Description |
|---|---|---|---|
|
string |
β |
Path to the deployment YAML file |
|
string |
CWD |
Workspace root |
|
string |
β |
Limit output to a specific stage name |
Returns: {success, data: {stages[]}, errors, messages}
deploy_healthο
Run health checks against provisioned deployment stages. For each stage with health_checks defined, resolves the target (URL / host:port) from Terraform outputs and executes HTTP GET or TCP connect checks.
deploy_health(file, work_path?, stage?)
Arg |
Type |
Default |
Description |
|---|---|---|---|
|
string |
β |
Path to the deployment YAML file |
|
string |
CWD |
Workspace root |
|
string |
β |
Limit checks to a specific stage name |
Returns: {success, data: {stages[]}, errors, messages} β success is false if any check fails.
audit_queryο
Query deploy-log entries from workspace audit logs.
audit_query(work_path?, last?, since?, stage?)
Arg |
Type |
Default |
Description |
|---|---|---|---|
|
string |
CWD |
Workspace root |
|
int |
20 |
Maximum number of entries to return |
|
string |
β |
ISO timestamp β return only entries after this time (e.g. |
|
string |
β |
Filter to entries that executed a specific stage name |
Returns: {success: true, entries[], count}
Each entry includes: timestamp, deployment, success, duration_seconds, stages[].
MCP Resourcesο
Two resources are registered and loaded automatically into the AIβs context:
URI |
Content |
|---|---|
|
Current workspace state (same as |
|
JSON Schema for the given document kind |
Response Envelopeο
All tool responses use a consistent structure:
{
"success": true,
"data": { ... },
"errors": [],
"messages": ["optional informational strings"]
}
When success is false, the errors array contains human-readable descriptions. The AI should surface these to the user and suggest corrective action.
Example: AI-Assisted Deployment Workflowο
The following shows a typical interaction between an AI assistant and the strata MCP server:
Understand the workspace
β workspace_status() β {data: {readiness: {phase: 3, next_step: {hint: "Run strata build run -f deploy/prd.yaml"}}}}Validate before building
β validate_file("deploy/prd.yaml") β {success: true, data: {valid: true, kind: "deployment", name: "prd"}}Preview the build
β build_plan("deploy/prd.yaml") β {success: true, data: {stages: [...]}}Run the build (after showing the plan to the user)
β build_run("deploy/prd.yaml") β {success: true, data: {artifact: "platform.json", stages: [...]}}Preview the deployment
β deploy_plan("deploy/prd.yaml") β {success: true, data: {changes: {add: 3, change: 0, destroy: 0}}}User confirms β deploy via CLI
strata deploy run -f deploy/prd.yaml --force
Check health after deploy
β deploy_health("deploy/prd.yaml") β {success: true, data: {stages: [{name: "app", checks: [{name: "api", passed: true}]}]}}Review audit log
β audit_query(last=1) β {entries: [{deployment: "prd", success: true, duration_seconds: 142.3}], count: 1}