An MCP (Model Context Protocol) server application for managing IT helpdesk services and service requests. This application provides a REST API for tracking IT equipment/services inventory and managing service requests from employees.
- Service Management: Track IT services/equipment with quantities
- Service Request Management: Handle employee requests for IT services
- Database Integration: PostgreSQL database with SQLModel ORM
- MCP Protocol: Built using FastMCP for seamless integration with AI assistants
- Docker Support: Containerized application for easy deployment
- Modern Python: Built with Python 3.13+ and modern async patterns
The application exposes the following MCP tools:
read_services()- Fetch all available servicesmodify_service_quantity(service_id, quantity)- Update service inventory quantities
read_service_requests()- Fetch all service requestscreate_new_service_request(request)- Create new service requestsmodify_service_request_status(request_id, status)- Update request status
Service Model:
id: Primary keyname: Service name (indexed, max 100 chars)description: Optional service description (max 500 chars)quantity: Available quantity (β₯ 0)created_at,updated_at: Timestamps
ServiceRequest Model:
id: Primary keyservice_id: Foreign key to Servicerequester_name: Name of requester (max 100 chars)request_date: When request was madestatus: Enum (pending,approved,returned)created_at,updated_at: Timestamps
βββ server/
β βββ main.py # MCP server entry point
β βββ config.py # Configuration settings
β βββ models/ # SQLModel database models
β β βββ service.py
β β βββ service_request.py
β βββ schemas/ # Pydantic schemas for API
β β βββ service.py
β β βββ service_request.py
β βββ crud/ # Database operations
β β βββ service.py
β β βββ service_request.py
β βββ db/
β βββ init_db.py # Database initialization
βββ Dockerfile # Multi-stage Docker build
βββ compose.yaml # Docker Compose configuration
βββ pyproject.toml # UV package management
βββ requirements.txt # Python dependencies
- Docker and Docker Compose
- PostgreSQL database
- Create a
.envfile in the project root:
POSTGRES_DATABASE_URL=postgresql://username:password@localhost:5432/helpdesk_db- Using Docker Compose (Recommended):
docker-compose up --build- Using Docker directly:
# Build the image
docker build -t it-helpdesk-agent .
# Run the container
docker run -p 8000:8000 --env-file .env it-helpdesk-agentThe server will be available at http://localhost:8000
- Python 3.13+
- uv package manager
- PostgreSQL database
- Install dependencies with uv:
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install -r requirements.txt- Set up environment variables:
export POSTGRES_DATABASE_URL="postgresql://username:password@localhost:5432/helpdesk_db"- Run the server:
python -m server.main --port 8000Key dependencies managed by UV:
- FastMCP: MCP server framework
- SQLModel: Modern SQL toolkit for Python
- FastAPI: High-performance web framework
- asyncpg/psycopg2: PostgreSQL drivers
- uvicorn: ASGI server for production
The application uses environment variables for configuration:
| Variable | Description | Required |
|---|---|---|
POSTGRES_DATABASE_URL |
PostgreSQL connection string | Yes |
- Set up PostgreSQL database
- Configure environment variables
- Deploy using Docker Compose:
docker-compose up -d --buildThe application automatically:
- Creates database tables on startup
- Validates database connectivity
- Provides structured error responses
# Example service request payload
{
"service_id": 1,
"requester_name": "John Doe",
"status": "pending"
}# Example quantity update
{
"quantity": 50
}- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License.
For support and questions:
- Check the documentation
- Review the API schemas in
/server/schemas/ - Examine the models in
/server/models/
Built with β€οΈ using Python, FastMCP, and Docker