A collection of C# demos showcasing practical AI agent patterns, including group-chat orchestration, Model Context Protocol (MCP) integration, and Windows Event Log analytics.
- .NET 10 SDK (preview)
- Windows host for Windows Event Log–based samples
- Optional administrator rights for richer System log access in Event Log–based samples
- Azure OpenAI access (required for JokeAgentsDemo)
- Additional project-specific requirements are noted below and in each project’s README
- Open the solution:
AIForCSharpDev.slnx - Or run projects individually with
dotnet run --project <ProjectName>
- Path: HelloAgent/
- Summary: Simple “hello world” agent sample to get started quickly.
- Setup/Run: See project directory for details.
- Path: JokeAgentsDemo/
- Summary:
- Demonstrates a two-agent “creator and critic” workflow using the Microsoft Agent Framework (MAF)
- Group chat orchestration with a custom quality gate that stops when the critic approves or rates highly
- Browser UI with both streaming (SSE) and classic result views
- REST and SSE endpoints for automation and integrations
- Prerequisites:
- .NET 10 SDK (preview)
- Azure OpenAI with a deployed chat-completion model
- Local Azure authentication (
az login)
- Configure:
- Update Azure OpenAI settings in
Program.cs:var endpoint = new Uri("https://<your-resource>.cognitiveservices.azure.com/"); var credential = new DefaultAzureCredential(); string deploymentName = "<your-deployment-name>";
- Update Azure OpenAI settings in
- Run:
Open http://localhost:5000 and choose the streaming or classic experience.
dotnet run --project JokeAgentsDemo
- Endpoints:
GET /— Web UIPOST /api/jokes/create?topic=<topic>— One-shot workflowGET /api/jokes/stream?topic=<topic>— Streaming via SSEPOST /agents/creator— Direct A2A to creatorPOST /agents/critic— Direct A2A to criticGET /agents/{agent}/.well-known/agent.json— Agent cardsGET /health— Health check
- More: See the project’s README at JokeAgentsDemo/README.md
- Path: EventLogMcp/
- Summary:
- Native C# MCP server exposing Windows Event Log analytics as AI tools
- HTTP MCP endpoint at
http://localhost:5115/mcp - Tools:
get_startup_shutdown_events— Startup, shutdown, and unexpected shutdown events for a periodcalculate_uptime— Aggregate and per-day uptime statisticsget_usage_summary— Compact, human-readable usage summary with stats
- Automatic fallback from System log to Application log when admin rights are unavailable
- JSON responses with camel-cased properties suitable for agents
- Requirements:
- Windows host with access to the local Event Log
- .NET 10 SDK (preview), targets
net10.0-windows - Optional admin rights (for System log)
- Run:
The server listens on
dotnet run --project EventLogMcp
http://localhost:5115/mcp. - More: See EventLogMcp/README.md
- Path: ComputerUsageAgent/
- Summary:
- Agent that connects to the MCP server from
EventLogMcpto analyze Windows computer usage via Event Logs
- Agent that connects to the MCP server from
- Run:
- Start the MCP server:
cd EventLogMcp dotnet run - Run the agent:
cd ../ComputerUsageAgent dotnet run
- Start the MCP server:
- More: See ComputerUsageAgent/README.md
- Path: LocalOllamaAgent/
- Summary: Local model agent demo. See the project directory for setup and usage details.
AIForCSharpDev.slnx
ComputerUsageAgent/
EventLogMcp/
HelloAgent/
JokeAgentsDemo/
LocalOllamaAgent/
Setup/
LICENSE.txt
CHANGES.md
PROJECT-STRUCTURE.md
TEST_PLAN.md
MIT — see LICENSE.txt