Natural language CI/CD execution: Claude Desktop → Apollo MCP Server → Dagger GraphQL API
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Claude Desktop │────▶│ Apollo MCP │────▶│ Dagger GraphQL │
│ (Natural Lang) │ │ Server │ │ Server │
└─────────────────┘ └──────────────────┘ └─────────────────┘
│ │ │
"Run tests" MCP Tool Calls GraphQL Queries
"Check coverage" + Introspection to Dagger API
- Dagger replaces complex CI/CD YAML with code (Go, Python, TypeScript)
- Apollo MCP Server exposes any GraphQL API as Claude-compatible tools
- Result: Ask Claude to run your CI/CD pipelines in natural language
- Dagger CLI installed (
brew install dagger/tap/dagger) - Node.js (for Apollo MCP Server)
- Claude Desktop with MCP support
# Start Dagger listening on port 8080 with session token "FU"
DAGGER_SESSION_TOKEN=FU dagger listen --allow-cors --listen 127.0.0.1:8080The session token becomes the Basic Auth username (base64 encoded).
# Introspect and export the GraphQL schema
dagger query --doc schema.graphql > schema.graphqlThis creates the full Dagger API schema that Apollo MCP Server will use.
supergraph.yaml:
federation_version: =2.10.0
subgraphs:
dagger:
routing_url: http://127.0.0.1:8080/query
schema:
file: ./schema.graphqlrouter.yaml:
headers:
subgraphs:
dagger:
request:
- insert:
name: "Authorization"
value: "Basic RlU6" # Base64 of "FU:"The RlU6 is base64 encoding of FU: (username:password format, empty password).
npx @anthropic/apollo-mcp-server \
--supergraph supergraph.yaml \
--router router.yaml# Use MCP remote connection
npx @anthropic/mcp-remote --server apollo-mcpOr add to Claude Desktop's MCP config directly.
dagger/main.go:
package main
import (
"context"
"dagger/hello-go/internal/dagger"
)
type HelloGo struct{}
// Test runs all unit tests with coverage
func (m *HelloGo) Test(ctx context.Context, source *dagger.Directory) (string, error) {
return dag.Container().
From("golang:1.22").
WithDirectory("/src", source).
WithWorkdir("/src").
WithExec([]string{"go", "test", "-cover", "./..."}).
Stdout(ctx)
}
// Build compiles the project
func (m *HelloGo) Build(ctx context.Context, source *dagger.Directory) *dagger.File {
return dag.Container().
From("golang:1.22").
WithDirectory("/src", source).
WithWorkdir("/src").
WithExec([]string{"go", "build", "-o", "app", "."}).
File("/src/app")
}
// Lint runs golangci-lint
func (m *HelloGo) Lint(ctx context.Context, source *dagger.Directory) (string, error) {
return dag.Container().
From("golangci/golangci-lint:latest").
WithDirectory("/src", source).
WithWorkdir("/src").
WithExec([]string{"golangci-lint", "run"}).
Stdout(ctx)
}Once connected, you can use natural language:
User: Please use the Dagger MCP to run the test function and
let me know how much code coverage I have.
Claude: I'll run the test function using Dagger...
[Executes GraphQL introspection]
[Gets directory ID for current project]
[Runs test function with directory ID]
The tests passed with 63.4% code coverage.
Other example prompts:
- "Build my Go project and show me any errors"
- "Run the linter on my codebase"
- "What Dagger functions are available in this project?"
- Claude receives natural language request
- Apollo MCP Server introspects the Dagger GraphQL schema
- Finds matching operations (test, build, lint functions)
- Executes GraphQL mutations against Dagger server
- Returns results to Claude for natural language response
Replace complex workflow steps with single Dagger call:
.github/workflows/ci.yml:
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dagger/dagger-for-github@v6
with:
verb: call
args: test --source=.| Traditional CI/CD | Dagger + MCP |
|---|---|
| YAML configs per platform | Code once, run anywhere |
| Platform-specific syntax | Portable GraphQL API |
| Manual debugging | Natural language queries |
| Separate local/CI testing | Same Dagger functions locally |
- AI-powered CI/CD debugging: "Why did my build fail?"
- Automatic fix suggestions: "The test failed because X, here's the fix"
- Pipeline generation: "Create a Dagger function to deploy to Kubernetes"
- Cross-project orchestration: "Run tests on all my Go projects"
Created: 2026-01-18 Source: YouTube tutorial on Dagger + Apollo MCP integration