DEV Community

Ian Cowley
Ian Cowley

Posted on

C# got left behind in the AI Agent hype. So I fixed it! AgentDevKit

If you’re a .NET developer watching the current AI landscape, you probably know the feeling.

A massive new paradigm drops—in this case, autonomous AI agents—and overnight, Python and TypeScript are flooded with official SDKs, shiny frameworks like LangChain or crewAI, and endless tutorials.

Meanwhile, us C# backend devs are left staring at the wall, waiting for an enterprise-grade port that will inevitably be bloated, overly abstracted, and arrive 18 months late.

I’ve been writing backend software and integrations for 40 years. I don’t like waiting, and I don't like bloated frameworks. I just wanted a native, high-performance way to build AI agents in C# that can actually do things—read files, query databases, and use the new Model Context Protocol (MCP) without a mountain of boilerplate.

Since it didn't exist, I built it.

Meet AgentDevKit (ADK).

What is it?

It’s a native C# Agent Development Kit designed to help you create "Agents"—AI personalities powered by Google Gemini that don't just talk, but think, plan, and act using real-world tools.

Here is a quick look at what I built into it to make it actually useful for backend environments.

1. The Brain & The Hands (Tools)

An LLM is just a brain. Without tools, it's just a chatbot. ADK lets you easily attach "hands" to your agent so it can interact with your systems.

When you ask the agent a question, it pauses, realizes it needs more info, executes your C# tool, and uses the result to finish its answer.

// Setup the connection
var llm = new GeminiService(apiKey);

// Create the Agent
var agent = new LlmAgent(
    name: "SysAdminBot",
    instructions: "You are an expert system administrator."
);

// Give it hands (a tool you define in C#)
agent.Tools.Add(new FileReadTool());

// Run it
string result = await agent.RunAsync("What is in the server.log file?", llm);

Enter fullscreen mode Exit fullscreen mode

2. Model Context Protocol (MCP) Integration

This is the real game-changer. MCP is becoming the industry standard for letting AI securely plug into local environments.

Instead of writing a custom C# wrapper for every single database or file system you want your AI to touch, ADK supports MCP out of the box.

// Auto-connect to a local SQLite database using MCP
var mcp = new McpService();
var databaseTools = await mcp.InitializeFromConfigAsync(config);

agent.Tools.AddRange(databaseTools);

Enter fullscreen mode Exit fullscreen mode

3. Delegation (Building Teams)

One agent is cool. A team of agents is dangerous.
ADK supports orchestration patterns like Pipelines and Parallel workflows. You can literally give a "Manager" agent a "Researcher" agent to use as a tool.

var researcher = new LlmAgent("Researcher", "Find facts...");
var manager = new LlmAgent("Manager", "Guide the project...");

// The Manager can now delegate tasks to the Researcher
manager.Tools.Add(new DelegationTool(researcher, llm));

Enter fullscreen mode Exit fullscreen mode

4. Guardrails (Because I trust no one, especially AI)

If you've managed backend integrations as long as I have, you know that giving an AI blind access to tools is a terrible idea.

ADK includes Human-in-the-Loop (HITL) approvals and interceptors. If a tool is dangerous, wrap it in a SensitiveTool. The agent cannot execute it without an explicit green light from your IApprovalService (which you can hook up to a console prompt, a web UI, or an email).

// Block the AI from breaking out of directories
agent.BeforeToolCall = async (tool, args) => {
    if (args.Contains("..")) {
        throw new SecurityException("Path breakout attempt blocked!");
    }
    return args;
};

Enter fullscreen mode Exit fullscreen mode

5. Resilient Parsing

Smaller local models (and even big ones sometimes) spit out malformed JSON when trying to call tools. ADK has a built-in Self-Correction Loop. If the LLM messes up the JSON structure, the SDK catches the error, feeds the error back to the model, and tells it to fix its formatting automatically based on a retry budget.

Try it out

I built this to fill a massive gap in the .NET ecosystem, keeping the architecture pragmatic and heavily focused on orchestration and safety.

If you are a C# dev wanting to mess around with autonomous agents, MCP, and Gemini without having to learn Python, check it out.

GitHub: ian-cowley/AgentDevKit

Drop a star, try hooking it up to your database via MCP, and let me know how it goes. If you find any bugs, open an issue—I'd love to hear how other C# devs are using it.

Top comments (0)