{"type":"mcp_server","name":"CereBro","description":"CereBro is a model-agnostic AI Agent Wrapper for .Net that supports the Model Context Protocol, allowing developers to write tools compatible with various AI models like OpenAI without code changes.","category":"AI","language":"C#","stars":17,"forks":1,"owner":"rob1997","github_url":"https://github.com/rob1997/CereBro","homepage":null,"setup":"## Setup\n\n1.  Install the package from NuGet using the following commands:\n\n    ```bash\n    dotnet add package Rob1997.CereBro\n\n    dotnet add package Rob1997.CereBro.Open-AI\n    ```\n\n2.  Create a `servers.json` file with the configuration for the MCP servers you want to use, for example:\n\n    ```json\n    [\n      {\n        \"Id\": \"everything-server\",\n        \"Name\": \"Everything\",\n        \"TransportType\": \"stdio\",\n        \"TransportOptions\": {\n          \"command\": \"npx\",\n          \"arguments\": \"-y @modelcontextprotocol/server-everything\"\n        }\n      }\n    ]\n    ```\n\n3.  Add your OpenAI API Key to your environment variables:\n\n    ```bash\n    export OPEN_AI_API_KEY=\"your-api-key\"\n    ```\n\n    ```powershell\n    $env:OPEN_AI_API_KEY=\"your-api-key\"\n    ```\n\n    Or, to make it permanent in PowerShell:\n\n    ```powershell\n    [Environment]::SetEnvironmentVariable(\"OPEN_AI_API_KEY\", \"your-api-key\", \"User\")\n    ```\n\n4.  Add the following code to your `Program.cs` (Entry Point):\n\n    ```csharp\n    public static async Task Main(string[] args)\n    {\n        var builder = Host.CreateApplicationBuilder(args);\n        \n        builder.Services.UseOpenAI(Environment.GetEnvironmentVariable(\"OPEN_AI_API_KEY\"), \"gpt-4o-mini\");\n                \n        IHost cereBro = builder.BuildCereBro(new CereBroConfig{ ServersFilePath = \"./servers.json\" });\n\n        await cereBro.RunAsync();\n    }\n    ```\n\n5.  Run your application:\n\n    ```bash\n    dotnet run\n    ```","tools":"## Available Tools\n\n\t\t1.  Model-agnostic AI Agent Wrapper for .Net (allows writing Tools that can be used with different AI models without changing the code).\n\t\t2.  Model Context Protocol (allows using different AI models without changing the code).\n\t\t3.  OpenAI Support (allows using OpenAI models).\n\t\t4.  Console Chat Dispatcher (uses the console as a chat dispatcher).\n\t\t5.  IChatDispatcher Interface (allows creating custom chat dispatchers).\n","faq":null,"created_at":"2025-03-09T19:19:35+00:00","updated_at":"2025-03-28T20:46:02+00:00","source_url":"https://model-context-protocol.com/servers/net-ai-agent-model-context-protocol","related_articles":[]}