MCP cover image
See in Github
2025-04-07

A model-agnostic MCP Client-Server for .Net and Unity

3

Github Watches

2

Github Forks

13

Github Stars

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.


相关推荐

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • Contraband Interactive
  • Emulating Dr. Jordan B. Peterson's style in providing life advice and insights.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • rustassistant.com
  • Your go-to expert in the Rust ecosystem, specializing in precise code interpretation, up-to-date crate version checking, and in-depth source code analysis. I offer accurate, context-aware insights for all your Rust programming questions.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • apappascs
  • Discover the most comprehensive and up-to-date collection of MCP servers in the market. This repository serves as a centralized hub, offering an extensive catalog of open-source and proprietary MCP servers, complete with features, documentation links, and contributors.

  • ShrimpingIt
  • Micropython I2C-based manipulation of the MCP series GPIO expander, derived from Adafruit_MCP230xx

  • modelcontextprotocol
  • Model Context Protocol Servers

  • Mintplex-Labs
  • The all-in-one Desktop & Docker AI application with built-in RAG, AI agents, No-code agent builder, MCP compatibility, and more.

  • ravitemer
  • A powerful Neovim plugin for managing MCP (Model Context Protocol) servers

  • jae-jae
  • MCP server for fetch web page content using Playwright headless browser.

  • patruff
  • Bridge between Ollama and MCP servers, enabling local LLMs to use Model Context Protocol tools

  • n8n-io
  • Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

  • WangRongsheng
  • 🧑‍🚀 全世界最好的LLM资料总结(Agent框架、辅助编程、数据处理、模型训练、模型推理、o1 模型、MCP、小语言模型、视觉语言模型) | Summary of the world's best LLM resources.

    Reviews

    1 (1)
    Avatar
    user_BpOnxrXs
    2025-04-18

    CereBro is an exceptional tool for managing my application processes. Its user-friendly design and robust functionalities make it indispensable for my daily operations. I highly recommend checking it out on GitHub. Kudos to rob1997 for creating such an efficient and reliable product!