Get the FREE Ultimate OpenClaw Setup Guide →

Business.AI.Demo

This project demonstrates how to integrate AI capabilities into a typical business application with .NET Platform It showcases a common scenario where business events flow through the system and get processed, stored, and then made available for AI-powered interactions.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio ardacetinkaya-business.ai.demo dotnet run --project MCP.Server \
  --env CONNECTIONS="Kafka:order-events, PostgreSQL:Orders,Payments" \
  --env ASPNETCORE_URLS="https://0.0.0.0:5001;http://0.0.0.0:5000" \
  --env MCP_PROTOCOL_VERSION="2025-06-18"

How to use

Business.AI.Demo exposes an MCP server that hosts the CustomAgent and provides access to business data such as recent payments via the MCP protocol. The MCP.Server component lists its available tools (e.g., get_random_number, accountant_does_financial_calculations, get_recent_payments) and can be queried using standard MCP tool discovery calls. You can interact with the server through the MCP Host web UI or by sending JSON-RPC requests to the server endpoint to discover tools and invoke them. This setup enables AI agents to fetch recent payments, perform simple financial calculations, and reuse or extend the conversation context with a persistent thread store. The architecture ties together Kafka-driven event data, persistent storage, and an AI chat interface so users can ask questions about orders, payments, and related data.

How to install

Prerequisites:

  • .NET 7+ SDK installed
  • Kafka broker running with topics such as order-events
  • PostgreSQL database configured with necessary tables (Orders, Payments, Fees)

Install and run:

  1. Clone the repository and navigate to the project root.
  2. Build the solution: dotnet build
  3. Run the Demo.Host (for orchestration) and MCP.Server (for MCP tooling) in separate terminals:
    • dotnet run --project Demo.Host
    • dotnet run --project MCP.Server

Configuration:

  • Ensure environment variables and connection strings point to the running Kafka and PostgreSQL instances.
  • If using HTTPS for MCP.Server, make sure certificates are configured or run with development certificates as appropriate.

Verification:

  • Confirm that the Host UI is accessible and that the MCP server endpoint (e.g., https://localhost:5001) is responding.
  • Test tool listing by posting the MCP tool discovery request to the MCP.Server endpoint as shown in the README examples.

Additional notes

Tips and common issues:

  • Ensure Kafka topics (order-events) exist and the producer/consumer are authorized to publish/consume.
  • The CustomAgent persistence relies on thread state file at {BaseDirectory}/thread/agent_thread.json; ensure the application has write permissions to that path or configure a custom storage location.
  • When running locally with HTTPS, you may need to trust development certificates for the MCP endpoint.
  • If tools do not appear in the list, verify that MCP.Server has successfully started and is connected to the data sources (Kafka and PostgreSQL).
  • The MCP protocol version used in requests should match the server’s configured version (e.g., 2025-06-18).
  • For production deployments, consider securing the MCP endpoints, rotating credentials, and enabling observability/metrics as done in the Demo.Host setup.

Related MCP Servers

Sponsor this space

Reach thousands of developers