#Need guidance on how I can expose a "dagger agent" as MCP.

1 messages · Page 1 of 1 (latest)

edgy reef
#

I created a dagger agent that has multiple of my dagger modules as inputs.

func (m *PlatformAgent) Ask(
    ctx context.Context,

    // The question to ask the database agent
    // +optional
    question string,
) *dagger.LLM {
.... omitted stuff
    // create an environment for the agent to use
    env := dag.Env().
        WithStringInput("question", question, "The question being asked").
        WithCloudflareCacheInput("cache", cache, "The Cloudflare cache module to use to deal with caching operations").
        WithCloudflarePagesInput("pages", pages, "The Cloudflare pages module to use to deal with pages operations").
        WithAzureDevopsInput("azure-devops", azureDevops, "The Azure Devops module to deal with azure devops operations").
        WithSlackInput("slack", slack, "The Slack module to deal with slack operations")

    // create the agent and run it
    return dag.LLM().
        WithEnv(env).
        WithPrompt(`Omitted on purposed`)

}


If i wanted to use this in claude how could I proceed ?
If I return a *dagger.LLM it's struggling to figure out how to use the tools from the underlying modules. Is it not meant to be used like that ?
Should I just start one MCP server (using dagger mcp ) per module and connect it all to Claude ?

paper moat
paper moat
cursive bone
#

you could expose over mcp a module that exposes the submodules as toolchains @edgy reef

#

dagger toolchain install MOD

#

do you also want to expose your llm to claude code, as a subagent?

#

the LLM type is more if a replacement of claude code, but you can wrap it into a function then expose that as a tool over mcp

#

basically an "agentic function"

paper moat
cursive bone
#

(from the toolchain module's top-level description)

edgy reef