rs-mcp-agent

Agent & MCP Server for the ReportServer using RPC interface

GitHub Stars

0

User Rating

Not Rated

Favorites

0

Views

5

Forks

0

Issues

0

README
Enterprise MCP Server for ReportServer Integration

A sophisticated Model Context Protocol (MCP) server implementation that provides AI-powered integration via front and backend with Java-based ReportServer application. Built with .NET 9.0, this system leverages Microsoft's latest technologies for cloud-native application development.

πŸ—οΈ Architecture Overview

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ RSChatApp.Web (Browser-Based Workspace) β”‚
β”‚ (Blazor UI) β”‚
β”‚ β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ LLM Provider Layer β”‚ β”‚ Session Management β”‚ β”‚
β”‚ β”‚ β”‚ β”‚ β”‚ β”‚
β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ Current: In-Memory β”‚ β”‚
β”‚ β”‚ β”‚ Ollama β”‚ β”‚ Anthropic β”‚ β”‚ β”‚ β€’ Browser Session β”‚ β”‚
β”‚ β”‚ β”‚ (Local LLM) β”‚ β”‚ (Claude/Sonnet) β”‚ β”‚ β”‚ β€’ Conversation Context β”‚ β”‚
β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚
β”‚ β”‚ β”‚ β€’ Mistral β”‚ β”‚ β€’ Claude-3.5 β”‚ β”‚ β”‚ Future: Persistent β”‚ β”‚
β”‚ β”‚ β”‚ β€’ Llama β”‚ β”‚ β€’ Claude-3 β”‚ β”‚ β”‚ β€’ Topic-Based History β”‚ β”‚
β”‚ β”‚ β”‚ β€’ Qwen β”‚ β”‚ β€’ Claude Haiku β”‚ β”‚ β”‚ β€’ Cross-Session Context β”‚ β”‚
β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β”‚ β”‚ β”‚
β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ β”‚ OpenAI β”‚ β”‚ Azure AI β”‚ β”‚ β”‚ Qdrant β”‚ β”‚
β”‚ β”‚ β”‚ (GPT-4/o1) β”‚ β”‚ (OpenAI) β”‚ β”‚ β”‚ (VectorDB) β”‚ β”‚
β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚
β”‚ β”‚ β”‚ β€’ GPT-4o β”‚ β”‚ β€’ GPT-4 β”‚ β”‚ β”‚ β€’ Vector Search β”‚ β”‚
β”‚ β”‚ β”‚ β€’ GPT-4 β”‚ β”‚ β€’ GPT-3.5 β”‚ β”‚ β”‚ β€’ Embeddings β”‚ β”‚
β”‚ β”‚ β”‚ β€’ o1-mini β”‚ β”‚ β€’ Text Embeddingβ”‚ β”‚ β”‚ β€’ Semantic RAG β”‚ β”‚
β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β”‚ β”‚ β–² β”‚
β”‚ β”‚ πŸ”„ Intelligent Provider Selection β”‚ β”‚ β”‚
β”‚ β”‚ β€’ Cost optimization β”‚ Knowledge β”‚ β”‚
β”‚ β”‚ β€’ Performance-based routing β”‚ Base β”‚ β”‚
β”‚ β”‚ β€’ Fallback mechanisms β”‚ Ingestion β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ Ingested Content β”‚ β”‚
β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ πŸ“š Documentation πŸ”§ Groovy Scripts β”‚ β”‚
β”‚ β”‚ β€’ PDFs, Markdown β€’ .groovy files β”‚ β”‚
β”‚ β”‚ β€’ API Docs β€’ Build scripts β”‚ β”‚
β”‚ β”‚ β€’ User Manuals β€’ Automation scripts β”‚ β”‚
β”‚ β”‚ β”‚ β”‚
β”‚ β”‚ πŸ’» Terminal Commands β”‚ β”‚
β”‚ β”‚ β€’ CLI usage examples β”‚ β”‚
β”‚ β”‚ β€’ Command syntax β”‚ β”‚
β”‚ β”‚ β€’ Shell scripts β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ 🌐 (Legacy)Software Integration β”‚ β”‚
β”‚ β”‚ β”‚ β”‚
β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚
β”‚ β”‚ β”‚ 🎭 Playwright Browser Tool β”‚ β”‚ β”‚
β”‚ β”‚ β”‚ β€’ Visual UI automation for legacy applications β”‚ β”‚ β”‚
β”‚ β”‚ β”‚ β€’ ReportServer frontend interaction β”‚ β”‚ β”‚
β”‚ β”‚ β”‚ β€’ Screenshot capture & visual analysis β”‚ β”‚ β”‚
β”‚ β”‚ β”‚ β€’ User workflow simulation & testing β”‚ β”‚ β”‚
β”‚ β”‚ β”‚ β€’ Cross-browser compatibility (Chrome, Firefox, Safari) β”‚ β”‚ β”‚
β”‚ β”‚ β”‚ β€’ Element inspection & interaction β”‚ β”‚ β”‚
β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚
β”‚ MCP Protocol
β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ RsMcpServer.Web β”‚
β”‚ (MCP Server) β”‚
β”‚ β”‚
β”‚ Backend Integration Tools: β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ βœ… Basic Terminal Tool β”‚ β”‚
β”‚ β”‚ β€’ Command execution β”‚ β”‚
β”‚ β”‚ β€’ Process management β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ βœ… Backend RPC Integration β”‚ β”‚
β”‚ β”‚ β€’ Direct Java RPC calls β”‚ β”‚
β”‚ β”‚ β€’ GWT protocol support β”‚ β”‚
β”‚ β”‚ β€’ Session management β”‚ β”‚
β”‚ β”‚ β€’ Authentication bridge β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β”‚
β”‚ Future Extensions: β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ β€’ Advanced Report Tool β”‚ β”‚
β”‚ β”‚ β€’ File Management Tool β”‚ β”‚
β”‚ β”‚ β€’ Database Query Tool β”‚ β”‚
β”‚ β”‚ β€’ Workflow Automation Tool β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚ β”‚
β”‚ Playwright β”‚ RPC/HTTP
β”‚ Browser β”‚ Backend
β”‚ Automation β”‚ API
β–Ό β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ ReportServer β”‚
β”‚ (Java/GWT) β”‚
β”‚ β”‚
β”‚ Frontend UI ◄──────────► Backend API β”‚
β”‚ β€’ Web Interface β€’ RPC Server β”‚
β”‚ β€’ User Actions β€’ Data Layer β”‚
β”‚ β€’ Visual Elements β€’ Business β”‚
β”‚ β€’ Report Rendering Logic β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Authentication Layer β”‚
β”‚ β”‚
β”‚ RSChatApp.Web ◄──────► Keycloak ◄──────► RsMcpServer.Web β”‚
β”‚ (OIDC) β”‚
β”‚ β”‚
β”‚ β”‚ β”‚ β”‚
β”‚ β”‚ Legacy Auth β”‚ Modern Auth β”‚
β”‚ β–Ό β–Ό β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ ReportServer β”‚ β”‚ Keycloak β”‚ β”‚
β”‚ β”‚ Native Login β”‚ β”‚ (OIDC Provider) β”‚ β”‚
β”‚ β”‚ β”‚ β”‚ β”‚ β”‚
β”‚ β”‚ β€’ Username/Pass β”‚ β”‚ β€’ SSO Integration β”‚ β”‚
β”‚ β”‚ β€’ Session Bridgeβ”‚ β”‚ β€’ JWT Tokens β”‚ β”‚
β”‚ β”‚ β€’ GWT RPC Auth β”‚ β”‚ β€’ Role Management β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β”‚
β”‚ ReportServer ◄─────────► Authentication β”‚
β”‚ (Dual Mode Support) (Keycloak + Legacy) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜


### πŸ“– Architecture Description

The RSChatApp operates as a **browser-based workspace** that provides an intelligent chat interface powered by AI and enhanced with semantic search capabilities:

**🌐 Browser-Based Workspace (RSChatApp.Web)**
- **Session Management**: Currently maintains conversation context in browser memory for immediate responsiveness
- **Interactive Chat Interface**: Real-time Blazor UI for seamless user interaction with AI models
- **Future Evolution**: Plans for persistent sessions with topic-based conversation history and cross-session context retention

**🧠 Knowledge Base Integration**
The system ingests diverse content types into Qdrant vector database for intelligent retrieval:
- **πŸ“š Documentation**: PDFs, Markdown files, API documentation, and user manuals
- **πŸ”§ Groovy Scripts**: Build scripts, automation scripts, and custom .groovy files  
- **πŸ’» Terminal Commands**: CLI usage examples, command syntax references, and shell scripts

**πŸ€– Multi-Provider AI Intelligence**
  - **Flexible LLM Provider Layer**: Support for multiple AI providers, in future with intelligent routing and fallback 
  - **Ollama**: Local deployment for privacy-sensitive workloads and offline operation
  - **Anthropic Claude**: High-quality reasoning and code analysis with Claude-3.5 Sonnet
  - **OpenAI GPT**: Versatile models including GPT-4o and o1-mini for different use cases
  - **Azure OpenAI**: Enterprise-grade hosted OpenAI models with additional security

- **Ollama/Qdrant**: Powerful local embedding Model, provides vector search, embeddings, and semantic RAG capabilities for context-aware responses

**πŸ€– AI Chat Application with Legacy Software Integration (RSChatApp.Web)**
The chat application provides an **innovative AI interface for legacy software integration**:

- **🌐 Frontend Integration via Playwright Browser Tool**:
  - **Visual UI Automation**: AI-powered browser automation for legacy applications like ReportServer
  - **Screenshot Analysis**: AI can capture and analyze visual interfaces to understand application state
  - **User Workflow Simulation**: Automate complex user interactions through natural language commands
  - **Cross-Browser Compatibility**: Support for Chromium, Firefox, and WebKit browsers
  - **Element Inspection**: AI can identify and interact with web elements dynamically

**πŸ”§ MCP Server Backend Integration (RsMcpServer.Web)**
The MCP server provides **backend integration capabilities** for ReportServer:

- **βš™οΈ Backend Integration (RPC Client)**:
  - **Direct Java RPC Communication**: Low-level API access for programmatic operations
  - **GWT Protocol Support**: Native communication with ReportServer's GWT backend
  - **Session Management**: Efficient authentication and session handling
  - **High-Performance Operations**: Bulk data operations and system administration

- **πŸ”„ Dual Integration Strategy**: AI agents can leverage both frontend and backend approaches:
  - **Frontend Tasks**: Use Playwright in the chat app for visual verification and user workflow testing
  - **Backend Tasks**: Use RPC via MCP server for bulk operations and system configuration
  - **Hybrid Workflows**: Combine both approaches for comprehensive automation scenarios

**πŸ” Dual Authentication Support**
The system supports both modern and legacy authentication methods:

- **πŸ†• Modern Keycloak OIDC**: Enterprise-grade authentication with SSO, JWT tokens, and role management
- **πŸ”§ Legacy ReportServer Authentication**: Direct username/password authentication with GWT RPC session bridging
- **πŸ”„ Flexible Authentication Mode**: AI agents can authenticate using the most appropriate method based on deployment configuration

## πŸš€ Key Features

### **Enterprise Authentication & Security**
- βœ… **Dual Authentication Support**: Both modern Keycloak OIDC and legacy ReportServer authentication
- βœ… **Centralized Keycloak OIDC Authentication** with PKCE support
- βœ… **Legacy GWT RPC Authentication** for existing ReportServer deployments
- βœ… **Seamless ReportServer Integration** through session bridging
- βœ… **JWT Token Management** with automatic refresh
- βœ… **Cross-System Session Synchronization**
- βœ… **Role-Based Access Control (RBAC)**

### **Multi-Provider AI Chat Interface**
- βœ… **Modern Blazor Web UI** with real-time chat capabilities
- βœ… **Multiple LLM Provider Support**:
  - **Ollama Integration** for local LLM inference (Mistral, Llama, Qwen)
  - **Anthropic Claude** for advanced reasoning (Claude-3.5 Sonnet, Claude-3, Haiku)
  - **OpenAI GPT** for versatile AI capabilities (GPT-4o, GPT-4, o1-mini)
  - **Azure OpenAI** for enterprise-grade hosted models
- βœ… **Qdrant Vector Database** for semantic search and RAG
- βœ… **Document Ingestion Pipeline** with PDF support
- βœ… **Semantic Search** across ingested documents

### **AI-Powered Legacy Software Integration**
- βœ… **Frontend Integration via Chat App Playwright Tool**:
  - **Visual UI Automation** integrated directly into the AI chat interface
  - **Natural Language Interface** for legacy application interaction
  - **Screenshot Analysis** and visual feedback within chat
  - **Cross-Browser Support** (Chromium, Firefox, WebKit)
  - **Element Inspection** and dynamic interaction capabilities
- βœ… **Backend Integration via MCP Server RPC Client**:
  - **Direct Java RPC Communication** for programmatic operations
  - **GWT Protocol Support** for native ReportServer API access
  - **High-Performance Bulk Operations** and system administration
  - **Session Management** with authentication bridging
- βœ… **Hybrid AI Workflows** combining both approaches for comprehensive automation

### **MCP Server Integration**
- βœ… **Microsoft Extensions AI Framework** for MCP protocol
- βœ… **Direct ReportServer RPC Client** for Java interoperability
- βœ… **Playwright Browser Automation** for UI testing and interaction
- βœ… **Tool Integration** for AI agent functionality
- βœ… **Terminal Operations** support for ReportServer CLI
- βœ… **HTTP & SSE Transport** protocols

### **Cloud-Native Deployment**
- βœ… **.NET Aspire Orchestration** for microservices
- βœ… **Docker Containerization** with persistent volumes
- βœ… **Health Checks & Monitoring** with OpenTelemetry
- βœ… **Service Discovery** and load balancing
- βœ… **Configuration Management** with environment-specific settings

## πŸš€ Quick Start

### **1. Using .NET Aspire (Recommended)**

Start the entire application stack with one command:

```bash
# Navigate to the Aspire host directory
cd RSChatApp.AppHost

# Start all services (Ollama with auto-downloaded models, Qdrant, MCP Server, Web App)
dotnet run

πŸ’‘ Windows Users Note: If you're using Windows with Docker Desktop, you may need to set up a PowerShell alias for Docker Compose. The Aspire orchestration API uses the legacy docker-compose syntax. Run this command in PowerShell as Administrator:

Set-Alias -Name docker-compose -Value 'docker compose'

This will automatically:

  • βœ… Start Ollama in Docker with GPU support (if available) as the default local LLM provider
  • βœ… Pull and configure required AI models automatically (configurable in appsettings.json)
  • βœ… Set up multiple LLM provider support (configure Anthropic, OpenAI, Azure OpenAI in appsettings.json)
  • βœ… Start Qdrant vector database in Docker with persistent storage
  • βœ… Launch the MCP Server with authentication
  • βœ… Start the Blazor Web Application with intelligent LLM provider selection
  • βœ… Open the Aspire Dashboard for monitoring

Access Points:

  • πŸ“± Chat Application: http://localhost:5123 (or as shown in Aspire dashboard)
  • πŸ”§ Aspire Dashboard: http://localhost:15986
  • πŸ€– MCP Server API: http://localhost:5002
  • πŸ“Š Qdrant Dashboard: http://localhost:6333/dashboard

Note: The first run may take a few minutes as Docker images are downloaded and AI models are pulled automatically. To use commercial LLM providers (Anthropic, OpenAI, Azure), configure your API keys in the appsettings.json file.

Core Components
πŸš€ MCP Server with ReportServer Integration
  • RsMcpServerSDK.Web/: Modern MCP server using Microsoft Extensions AI framework
  • RSChatApp.Web/: Interactive Blazor web client with chat UI
  • ReportServerRPCClient/: Direct RPC client for Java ReportServer integration
  • RSChatApp.AppHost/: .NET Aspire orchestration for cloud-native deployment
Key Features
  • βœ… Uses official Microsoft Extensions AI SDK
  • βœ… Full .NET 9.0 integration with Aspire orchestration
  • βœ… Direct ReportServer RPC integration
  • βœ… Comprehensive logging and error handling
Project Structure
Modern MCP Server Implementation with .NET Aspire
  • RSChatApp.AppHost/: .NET Aspire app host that orchestrates all components

    • Program.cs: Configures and links Ollama, Qdrant, MCP Server, and Web App
    • appsettings.json: Configuration settings
  • RsMcpServerSDK.Web/: Modern MCP server implementation

    • Program.cs: Entry point with Microsoft.Extensions.AI MCP server configuration
    • Services/McpReportServer.cs: MCP server with decorated functions
    • Models/: Data models for MCP responses
  • RSChatApp.Web/: Interactive chat web application

    • Program.cs: Web app configuration with AI client setup
    • Components/: Blazor UI components
    • Services/: AI chat services, vector search, and data ingestion
  • ReportServerRPCClient/: Direct RPC client for Java ReportServer

    • Services/: Implementation of RPC client
    • DTOs/: Data transfer objects for RPC communication
  • ReportServer.Abstraction/: Interface definitions for Report Server communication

    • IReportServerClient.cs: Main interface for communicating with ReportServer
    • Contracts/: Data contracts for the ReportServer API
Prerequisites
  • .NET 9.0 SDK or later
  • Docker Desktop (for all containerized services)
  • Java JDK 17 or later (for ReportServer - if running locally)
  • Keycloak 22+ (for authentication - can be run via Docker)

Note: Ollama, Qdrant, and AI models are automatically managed by the .NET Aspire AppHost via Docker containers - no manual installation required!

Getting Started
Starting the Application with Aspire
  1. Ensure you have Docker running on your system

  2. Navigate to the RSChatApp.AppHost directory:

cd RSChatApp.AppHost
  1. Run the application:
dotnet run

This will start all required services in the correct order:

  • Ollama (with specified models)
  • Qdrant vector database
  • RsMcpServerSDK.Web MCP server
  • RSChatApp.Web Blazor web application
  1. Open the Aspire dashboard at the provided URL (typically http://localhost:15986) to monitor all services

  2. Access the chat web interface at the URL shown in the dashboard (typically http://localhost:5123)

Testing the MCP Server

You can test the MCP server functionality using the provided test script:

chmod +x test-mcp-server.sh
./test-mcp-server.sh

Or test directly using the Aspire dashboard to monitor service health and interactions.

βš™οΈ Configuration
RSChatApp.Web Configuration
{
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft.AspNetCore": "Warning",
      "Microsoft.EntityFrameworkCore": "Warning",
      "RSChatApp.ServiceDefaults.Authentication": "Information"
    }
  },
  "AllowedHosts": "*",

  "ReportServer": {
    "Address": "http://localhost:8081",
    "SessionTimeout": "01:00:00",
    "CookieDomain": "localhost",
    "EnableSessionBridge": true
  },
  "LLMProviders": {
    "DefaultProvider": "Ollama",
    "FallbackStrategy": "Cascade",
    "Ollama": {
      "Address": "http://0.0.0.0:11434",
      "Model": "mistral-nemo:12b",
      "EmbeddingModel": "llama3.2:1b",
      "MaxTokens": 4096,
      "Temperature": 0.7,
      "Enabled": true
    },
    "Anthropic": {
      "ApiKey": "your-anthropic-api-key",
      "Model": "claude-3-5-sonnet-20241022",
      "MaxTokens": 4096,
      "Temperature": 0.7,
      "Enabled": false
    },
    "OpenAI": {
      "ApiKey": "your-openai-api-key",
      "Model": "gpt-4o",
      "MaxTokens": 4096,
      "Temperature": 0.7,
      "Enabled": false
    },
    "AzureOpenAI": {
      "Endpoint": "https://your-resource.openai.azure.com/",
      "ApiKey": "your-azure-openai-key",
      "DeploymentName": "gpt-4",
      "MaxTokens": 4096,
      "Temperature": 0.7,
      "Enabled": false
    }
  },
  "Qdrant": {
    "Address": "http://localhost:6334"
  },
  "RsMcpServer": {
    "Address": "http://localhost:5002"
  }
}
RsMcpServer.Web Configuration
{
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft": "Warning",
      "Microsoft.Hosting.Lifetime": "Information",
      "RSChatApp.ServiceDefaults.Authentication": "Information"
    }
  },
  "Keycloak": {
    "Authority": "http://localhost:8080/realms/reportserver",
    "ClientId": "reportserver-app",
    "ClientSecret": "your-client-secret-here",
    "Realm": "reportserver",
    "Scopes": [
      "openid",
      "profile",
      "email",
      "roles"
    ],
    "RequireHttpsMetadata": false,
    "TokenRefreshThreshold": "00:05:00"
  },
  "ReportServer": {
    "Address": "http://localhost:8081/",
    "SessionTimeout": "01:00:00",
    "CookieDomain": "localhost"
  }
}
Configuration Parameters Explained

Keycloak Settings:

  • Authority: Keycloak realm URL
  • ClientId: Client identifier in Keycloak
  • ClientSecret: Client secret (get from Keycloak admin console)
  • Realm: Keycloak realm name
  • Scopes: OpenID Connect scopes to request
  • RequireHttpsMetadata: Set to false for development, true for production
  • TokenRefreshThreshold: Time before token expiry to refresh

ReportServer Settings:

  • Address: ReportServer base URL
  • SessionTimeout: Session timeout duration
  • CookieDomain: Domain for session cookies
  • EnableSessionBridge: Enable session bridging between Keycloak and ReportServer

LLM Provider Settings:

  • DefaultProvider: Primary LLM provider to use ("Ollama", "Anthropic", "OpenAI", "AzureOpenAI")
  • FallbackStrategy: How to handle provider failures ("Cascade", "RoundRobin", "None")

Ollama Settings:

  • Address: Ollama server URL
  • Model: Chat completion model (e.g., "mistral-nemo:12b", "llama3.2:3b")
  • EmbeddingModel: Text embedding model
  • Enabled: Whether this provider is available

Anthropic Claude Settings:

  • ApiKey: Anthropic API key from console.anthropic.com
  • Model: Claude model variant ("claude-3-5-sonnet-20241022", "claude-3-haiku-20240307")
  • Enabled: Whether this provider is available

OpenAI Settings:

  • ApiKey: OpenAI API key from platform.openai.com
  • Model: GPT model variant ("gpt-4o", "gpt-4", "o1-mini")
  • Enabled: Whether this provider is available

Azure OpenAI Settings:

  • Endpoint: Azure OpenAI resource endpoint
  • ApiKey: Azure OpenAI API key
  • DeploymentName: Deployment name in Azure (not the model name)
  • Enabled: Whether this provider is available

Qdrant Settings:

  • Address: Qdrant vector database URL
Environment-Specific Configuration

Development Environment:

{
  "Keycloak": {
    "RequireHttpsMetadata": false,
    "Authority": "http://localhost:8080/realms/reportserver"
  },
  "ReportServer": {
    "Address": "http://localhost:8081"
  }
}

6. Start Chat Application

cd RSChatApp.Web
dotnet run

Note: Manual setup requires you to configure all the networking and dependencies yourself. The Aspire approach handles all of this automatically with proper service discovery and health checks.