Overview
The MCP Server acts as a bridge between your local development environment and AI assistants. By running the server, you give AI assistants the ability to:- Discover your local workflows and tools
- Compile DSL code into executable workflows
- Execute workflows directly from the chat interface
- Access documentation and templates
Installation
To use the MCP server features, install the SDK with themcp extra:
Running the Server
You can start the MCP server using the CLI:Configuration
The server can be configured using environment variables or CLI flags:| Variable | Flag | Description |
|---|---|---|
KUBIYA_API_KEY | --api-key | Your Kubiya Platform API Key |
KUBIYA_BASE_URL | --base-url | API Base URL (default: https://api.kubiya.ai) |
Connecting to Clients
Claude Desktop
To use Kubiya with Claude Desktop, add the following configuration to yourclaude_desktop_config.json:
Cursor
To use Kubiya with Cursor:- Open Cursor Settings > Features > MCP
- Click Add New MCP Server
- Enter the following details:
- Name: Kubiya
- Type: stdio
- Command:
kubiya mcp server - Environment Variables: Add
KUBIYA_API_KEY=your-key
Available Tools
Once connected, the following tools will be available to the AI assistant:compile_workflow
Validates and compiles Python DSL code into a JSON workflow definition. This is useful for checking syntax and structure before execution.
execute_workflow
Executes a workflow on the Kubiya platform. Accepts either a compiled JSON definition or raw DSL code.
get_workflow_runners
Lists available runners in your Kubiya organization.
get_integrations
Lists available integrations (AWS, Slack, etc.) that can be used in workflows.
get_workflow_secrets
Lists available secrets that can be injected into workflows.
Secrets & the compile_workflow flow
The MCPcompile_workflow tool performs an analysis of DSL code to detect references to secrets (for example, placeholders like {{secret:NAME}} used in environment variables or step configuration). The tool’s behavior around secrets is:
- If missing secrets are detected and no
provide_missing_secretsvalue is provided,compile_workflowwill add parameter placeholders to the generated manifest. These parameters are marked as secret and required; the tool will also add environment mappings so runners can receive secret values at execution time. - If you supply
provide_missing_secrets(either a JSON string or a dictionary) tocompile_workflow, the tool will inject those values into the workflow manifest’senvmapping for immediate validation and compilation.
provide_missing_secrets usage examples (accepted as a dict or JSON string):
- AI or developer writes DSL referencing secrets (e.g.
wf.env(AWS_KEY="{{secret:AWS_ACCESS_KEY_ID}}")). compile_workflowvalidates the DSL and either prompts for missing secrets or injects provided secret values.- If missing secrets remain,
compile_workflowwill add secret parameters to the manifest; the agent or caller must provide them at execution time viaexecute_workflow(..., params=...)or via runner environment configuration.
get_workflow_secrets tool and use that information to decide which secrets to provide to compile_workflow or execute_workflow.
Example Usage
User: “Create a workflow that lists all S3 buckets in us-east-1” Claude/Cursor:- Uses
get_integrationsto check for AWS integration. - Writes Python DSL code for the workflow.
- Uses
compile_workflowto validate the code. - Uses
execute_workflowto run it. - Returns the execution results to you.