GitHub Stars
0
User Rating
Not Rated
Favorites
0
Views
5
Forks
0
Issues
0
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
Ensure you have Docker running on your system
Navigate to the RSChatApp.AppHost directory:
cd RSChatApp.AppHost
- 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
Open the Aspire dashboard at the provided URL (typically http://localhost:15986) to monitor all services
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 URLClientId
: Client identifier in KeycloakClientSecret
: Client secret (get from Keycloak admin console)Realm
: Keycloak realm nameScopes
: OpenID Connect scopes to requestRequireHttpsMetadata
: Set tofalse
for development,true
for productionTokenRefreshThreshold
: Time before token expiry to refresh
ReportServer Settings:
Address
: ReportServer base URLSessionTimeout
: Session timeout durationCookieDomain
: Domain for session cookiesEnableSessionBridge
: 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 URLModel
: Chat completion model (e.g., "mistral-nemo:12b", "llama3.2:3b")EmbeddingModel
: Text embedding modelEnabled
: Whether this provider is available
Anthropic Claude Settings:
ApiKey
: Anthropic API key from console.anthropic.comModel
: 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.comModel
: GPT model variant ("gpt-4o", "gpt-4", "o1-mini")Enabled
: Whether this provider is available
Azure OpenAI Settings:
Endpoint
: Azure OpenAI resource endpointApiKey
: Azure OpenAI API keyDeploymentName
: 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.
0
Followers
0
Repositories
0
Gists
0
Total Contributions
This MCP server provides data for the Australian Football League (AFL), allowing users to retrieve information about past games, current standings, team details, power rankings, and predictions. It offers tools for accessing specific game results and managing data sources, making it a valuable resource for AFL enthusiasts and analysts.
McpDataGovSg is a C# project related to data governance, focusing on data management and analysis. The project offers features for data visualization and report generation, designed to help users effectively utilize data. The code quality is average, making it suitable for beginner to intermediate users.