sourcecraft-mcp
Public MCP server for SourceCraft CI/CD and deploy operations. It provides:
- run listing and run status inspection
- long
wait_run polling for deployments and pipelines
- cube logs and artifacts
- curated SourceCraft CI docs search
- live SourceCraft OpenAPI catalog and generic
call_api
stdio and streamable HTTP transports from one binary
The server is deploy-first: it is optimized for operating real SourceCraft runs, waiting for long-running workflows, inspecting logs, and pulling artifacts without inventing a private CI model.
Install
go install github.com/aacidov/sourcecraft-mcp/cmd/sourcecraft-mcp@latest
Build from source:
go build ./cmd/sourcecraft-mcp
Configuration
Required:
Optional:
SOURCECRAFT_ORG
SOURCECRAFT_REPO
SOURCECRAFT_REPO_HINT
SOURCECRAFT_ENV_FILE
SOURCECRAFT_API_BASE
SOURCECRAFT_DOCS_BASE
Resolution order matches the local sc-ci operator flow:
~/.config/sourcecraft/default.env
~/.config/sourcecraft/<repo-hint>.env
./.env.sourcecraft
$SOURCECRAFT_ENV_FILE
- explicit process env overrides all files
If SOURCECRAFT_ORG and SOURCECRAFT_REPO are missing, the server tries to detect them from the git remote named sourcecraft.
Run
STDIO:
sourcecraft-mcp
Streamable HTTP:
sourcecraft-mcp http --listen 127.0.0.1:8080 --path /mcp
Codex MCP Config
Add this to ~/.codex/config.toml:
[mcp_servers.sourcecraft]
command = "go"
args = ["run", "github.com/aacidov/sourcecraft-mcp/cmd/sourcecraft-mcp@latest"]
The server will read SOURCECRAFT_PAT plus the standard SourceCraft env files automatically.
Main Tools
list_runs
get_run
run_workflow
run_deploy_workflow
wait_run
get_cube_logs
list_cube_artifacts
download_artifact
search_ci_docs
list_api_operations
call_api
env
Resources
sourcecraft://docs/ci/index
sourcecraft://docs/ci/{lang}/{slug}
sourcecraft://openapi/sourcecraft.swagger.json
Documentation
Examples
Run a deploy workflow:
{
"workflow": "deploy-prod",
"target": "service-b",
"confirm": "deploy deploy-prod service-b",
"inputs": {
"DEPLOY_TAG": "sha-5922b01"
}
}
Wait for a run:
{
"run_slug": "46",
"poll_seconds": 10,
"timeout_seconds": 3600
}
Validation
Verified against a real SourceCraft repository:
- environment autodetection from
sourcecraft git remote
- live run inspection
wait_run on an existing completed run
- log retrieval
- artifact listing and text artifact download
- live OpenAPI discovery and generic API calls
License
MIT