MCP server by nhcloud
MCP Workshop
This project demonstrates the Model Context Protocol (MCP) with multiple server architectures and an AI-powered agent client. The implementation is available in both .NET and Python.
Architecture Overview
┌─────────────────────────────────────────────────────────────────┐
│ MCP Agent Client │
│ (Interactive AI Assistant) │
└──────────────┬──────────────────────────┬───────────────────────┘
│ │
│ STDIO │ HTTP (Streamable)
│ │
┌──────────────▼──────────────┐ ┌─────────▼───────────────────────┐
│ MCP Local Server │ │ MCP Bridge │
│ (In-memory tickets) │ │ (MCP over HTTP) │
│ :STDIO │ │ :5070 │
└─────────────────────────────┘ └─────────────┬───────────────────┘
│ REST API
│
┌─────────────▼───────────────────┐
│ Remote Server │
│ (REST API Backend) │
│ :5060 │
└─────────────────────────────────┘
Components
| Component | Description | Transport | |-----------|-------------|-----------| | Remote Server | REST API backend with ticket data | Port 5060 | | MCP Bridge | MCP server that wraps REST API | Port 5070 (HTTP) | | MCP Local Server | Standalone MCP server with in-memory data | STDIO | | MCP Agent Client | AI agent that consumes MCP servers | Interactive CLI |
Available MCP Tools
All MCP servers expose the same tools for ticket management:
| Tool | Description |
|------|-------------|
| GetAllTickets | Gets all support tickets with optional limit |
| GetTicket | Gets a support ticket by ID (e.g., TICKET-001) |
| UpdateTicket | Updates a ticket's status (Open, In Progress, Resolved, Closed) |
Implementations
Choose your preferred implementation:
🔷 .NET Implementation
- Built with .NET 10 and ASP.NET Core
- Uses ModelContextProtocol NuGet package
- Uses Microsoft.Extensions.AI for AI integration
- Azure OpenAI for the agent client
🐍 Python Implementation
- Built with Python 3.x and FastAPI
- Uses mcp SDK for Model Context Protocol
- Uses azure-ai-projects for AI integration
- Azure OpenAI for the agent client
Quick Start
Each implementation includes scripts to launch all services:
Windows
# For .NET
cd dotnet
start_all.cmd
# For Python
cd python
start_all.cmd
macOS / Linux
# For .NET
cd dotnet
chmod +x start_all.sh # Make executable (first time only)
./start_all.sh
# For Python
cd python
chmod +x start_all.sh # Make executable (first time only)
./start_all.sh
See the implementation-specific README for detailed setup instructions.
Shared Data
All implementations read ticket data from a shared JSON file:
data/tickets.json
This ensures consistent data across .NET and Python implementations.
Exercises (Optional)
Ready to explore more? Check out EXERCISES.md for hands-on tasks to extend the workshop:
- Add new MCP tools (
CreateTicket,DeleteTicket) - Implement ticket filtering and search
- Add authentication to the MCP Bridge
- Extend the data model with comments
- And more bonus challenges!
License
MIT