Rob1997.CereBro.Server 1.0.6

dotnet add package Rob1997.CereBro.Server --version 1.0.6
                    
NuGet\Install-Package Rob1997.CereBro.Server -Version 1.0.6
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Rob1997.CereBro.Server" Version="1.0.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Rob1997.CereBro.Server" Version="1.0.6" />
                    
Directory.Packages.props
<PackageReference Include="Rob1997.CereBro.Server" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Rob1997.CereBro.Server --version 1.0.6
                    
#r "nuget: Rob1997.CereBro.Server, 1.0.6"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Rob1997.CereBro.Server@1.0.6
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Rob1997.CereBro.Server&version=1.0.6
                    
Install as a Cake Addin
#tool nuget:?package=Rob1997.CereBro.Server&version=1.0.6
                    
Install as a Cake Tool

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.


Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.6 105 4/6/2025
1.0.5 119 3/28/2025