CereBro

MCP.Pizza Chef: rob1997

CereBro is a model-agnostic MCP client designed for .Net and Unity environments. It acts as an AI agent wrapper that supports multiple AI models through the Model Context Protocol, allowing developers to write tools compatible with various LLMs without code changes. It currently supports OpenAI models and plans to integrate others like Claude, Grok, and Gemini, facilitating seamless AI model interoperability in .Net applications.

Use This MCP client To

Integrate AI agents into .Net and Unity applications Develop AI tools compatible with multiple LLM providers Switch AI models without rewriting client code Build model-agnostic AI workflows in .Net environments Leverage MCP for real-time context in AI agents Create AI-enhanced game or app features in Unity Manage AI model interactions via a unified client interface

README

CereBro

GitHub release NuGet stable version GitHub license

CereBro is a model-agnostic AI Agent Wrapper for .Net. Now with 🔥 Model Context Protocol 🔥 , based on the Official C# SDK, you can write Tools that can be used with different AI models without changing the code.

Models

Below is a list of supported and planned models for CereBro.

Supported:

Planned:

Installation

You can install the package from NuGet using the following command:

dotnet add package Rob1997.CereBro

dotnet add package Rob1997.CereBro.Open-AI

Usage

Step 1: Create a servers.json file

This file will contain the configuration for the MCP servers you want to use. Below is an example of the servers.json file.

[
  {
    "Id": "everything-server",
    "Name": "Everything",
    "TransportType": "stdio",
    "TransportOptions": {
      "command": "npx",
      "arguments": "-y @modelcontextprotocol/server-everything"
    }
  }
]

You can check out more servers here.

Step 2: Add your OpenAI API Key to your environment variables

export OPEN_AI_API_KEY="your-api-key"
$env:OPEN_AI_API_KEY="your-api-key"

If you want this to be permanent, you can add it to your .bashrc or .bash_profile file in linux or use the following command in PowerShell.

[Environment]::SetEnvironmentVariable("OPEN_AI_API_KEY", "your-api-key", "User")

Step 3: Add the following code to your Program.cs (Entry Point)

public static async Task Main(string[] args)
{
    var builder = Host.CreateApplicationBuilder(args);
    
    builder.Services.UseOpenAI(Environment.GetEnvironmentVariable("OPEN_AI_API_KEY"), "gpt-4o-mini");
            
    IHost cereBro = builder.BuildCereBro(new CereBroConfig{ ServersFilePath = "./servers.json" });

    await cereBro.RunAsync();
}

CereBro uses the Console as a chat dispatcher. You can create your own dispatcher by implementing the IChatDispatcher interface and use builder.BuildCereBro<IChatDispatcher>(config) to build CereBro's host.

Step 4: Run your application

dotnet run

Adding a new Model

Currently, CereBro only supports OpenAI's models. To add a new model you'll need to Implement Microsoft.Extensions.AI.IChatClient, unless it already exists, Microsoft already has implementations for some models like OpenAI and Ollama.

Once you've done that you can create a Placeholder Type that implements Microsoft.Extensions.AI.FunctionInvokingChatClient something like this.

Finally, you can use the UseChatClient<T>(this IServiceCollection services, IChatClient chatClient) where T : FunctionInvokingChatClient extension method to add your model to the service collection.

⚠️ Note ⚠️

At the moment CereBro doesn't support multiple models at the same time, so you'll have to remove the UseOpenAI method from the Program.cs file to use another model.

CereBro.Unity

CereBro.Unity is a Unity package that allows you to use CereBro in Unity. README.

Contributing

If you'd like to contribute to the project, you can fork the repository and create a pull request. You can also create an issue if you find any bugs or have any feature requests.


CereBro FAQ

How does CereBro support multiple AI models?
CereBro uses the Model Context Protocol to abstract AI model interactions, enabling support for OpenAI, Claude, Grok, Gemini, and more without code changes.
Can I use CereBro with Unity projects?
Yes, CereBro is designed to integrate seamlessly with both .Net and Unity environments for AI agent development.
Is CereBro limited to OpenAI models?
No, while it currently supports OpenAI, CereBro plans to support other models like Claude, Grok, and Gemini.
How do I add new AI models to CereBro?
You can extend CereBro by implementing MCP-compatible adapters for new AI models, leveraging its model-agnostic architecture.
Does CereBro require specific MCP versions?
CereBro is based on the official C# MCP SDK, ensuring compatibility with the latest MCP standards.
Is CereBro open source and how is it licensed?
Yes, CereBro is open source under the MIT license, allowing flexible use and modification.
What programming languages does CereBro support?
CereBro is primarily for C# in .Net and Unity environments.
How does CereBro handle tool development?
Developers can write MCP Tools once and use them across different AI models without rewriting code.