How to Use the Dagger (Programmable CI) MCP in Mastra AI
Build resilient Dagger CI workflows with Mastra AI. Handle container failures and retry build steps automatically.
Works with every AI agent you already use
…and any MCP-compatible client
Connect Dagger (Programmable CI) MCP to Mastra AI
Create your Vinkius account to connect Dagger (Programmable CI) to Mastra AI and route execution through our secure gateway. The platform manages server hosting, runtime updates, and security layers. Configuration requires no manual server provisioning.
Conditional CI branching via MCP Server
`execute_graphql_query` lets your workflow engine construct complex Dagger graphs on the fly. If a build step fails, Mastra catches the error and branches the logic. The agent can automatically retry the query with different parameters or fall back to a previous known-good state. `query_container` spins up scratch environments for testing. Container allocation becomes fully programmatic. When those tests crash, the framework's exponential backoff kicks in, requesting a fresh container ID until the suite passes or hits the max attempt limit.
Persistent caching across workflow runs
Calling `query_cache_volume` constructs a persistent layer for your dependencies. Rebuilding from zero wastes compute time and delays deployments. Your agent attaches this volume to subsequent tasks, cutting execution time down to seconds. `query_directory` generates empty folders and returns their IDs for the workflow to populate. Directory structures need mapping before execution. Mastra sequences these operations perfectly, ensuring the filesystem exists before the compiler tries to write to it.
External resource resolution
`query_git` fetches repository data right when the workflow needs it. Pulling specific code versions requires exact timing in the pipeline. If the Git provider rate-limits the request, the built-in retry mechanism waits and tries again automatically. `query_http` grabs files from URLs. Downloading binaries from third parties breaks builds constantly. The workflow engine verifies the download, and if it gets a 502 Bad Gateway, it pauses and retries instead of failing the entire deployment.
Set up Dagger (Programmable CI) MCP in Mastra AI
Prerequisites
- Node.js 18+ and a TypeScript project
-
@mastra/mcp+@mastra/corepackages - Active Vinkius subscription with a valid endpoint token
- 1
Install dependencies
Run
npm install @mastra/mcp @mastra/coreplus your preferred model provider (e.g.@ai-sdk/openai). - 2
Configure the MCPClient
Create an
MCPClientwith your Vinkius endpoint as aURLobject. Replace[YOUR_TOKEN_HERE]with your token from cloud.vinkius.com. - 3
Discover and inject tools
Call
mcpClient.listTools()and spread the result into your agent'stoolsobject. All Dagger (Programmable CI) tools become native Mastra tools. - 4
Run with any model
Swap
openai("gpt-4o")for any AI SDK-compatible provider. Callagent.generate()and the agent routes tool calls through MCP automatically.
import { MCPClient } from "@mastra/mcp";
import { Agent } from "@mastra/core/agent";
import { openai } from "@ai-sdk/openai";
const mcpClient = new MCPClient({
id: "dagger-programmable-ci-mcp-client",
servers: {
"dagger-programmable-ci-mcp": {
url: new URL(
"https://edge.vinkius.com/[YOUR_TOKEN_HERE]/mcp"
),
},
},
});
const agent = new Agent({
name: "Dagger (Programmable CI) Agent",
model: openai("gpt-4o"),
instructions: "You have access to Dagger (Programmable CI) tools.",
tools: {
...(await mcpClient.listTools()),
},
});
const result = await agent.generate(
"List recent Dagger (Programmable CI) transactions"
);
console.log(result.text); Independent Platform Disclaimer: Vinkius is an independent platform and is not affiliated with, endorsed by, sponsored by, verified by, or otherwise authorized by Dagger. All third-party trademarks, logos, and brand names are the property of their respective owners. Their use on this website is strictly for informational purposes to identify service compatibility and interoperability.
Why Choose Vinkius
Vinkius connects your tools to AI with real-time monitoring and automatic cost savings — all from one dashboard.
Real-time monitoring
Live
visibility into every interaction
Connect your favorite tools to your AI and see exactly what's happening — every request, every response, in real time.
Built-in savings
60%
lower AI costs
Vinkius compresses data between your apps and your AI automatically. Lower bills every month — no configuration required.
Single dashboard
One
place for every integration
Every tool your AI connects to, managed from a single screen. One account, complete control.
Common questions about Dagger (Programmable CI) MCP in Mastra AI
Use it with your favorite AI tools
Connect this server to Cursor, Claude, VS Code, and more.
Start using the Dagger (Programmable CI) MCP today
We host it, we monitor it, we maintain it. You just paste one token.