Skip to content

Chitresh-code/helpdesk-mcp-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

IT Helpdesk Agent

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.

πŸš€ Features

  • 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

πŸ“‹ API Endpoints

The application exposes the following MCP tools:

Service Management

  • read_services() - Fetch all available services
  • modify_service_quantity(service_id, quantity) - Update service inventory quantities

Service Request Management

  • read_service_requests() - Fetch all service requests
  • create_new_service_request(request) - Create new service requests
  • modify_service_request_status(request_id, status) - Update request status

πŸ—οΈ Architecture

Database Models

Service Model:

  • id: Primary key
  • name: 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 key
  • service_id: Foreign key to Service
  • requester_name: Name of requester (max 100 chars)
  • request_date: When request was made
  • status: Enum (pending, approved, returned)
  • created_at, updated_at: Timestamps

Project Structure

β”œβ”€β”€ 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

🐳 Getting Started with Docker

Prerequisites

  • Docker and Docker Compose
  • PostgreSQL database

Environment Setup

  1. Create a .env file in the project root:
POSTGRES_DATABASE_URL=postgresql://username:password@localhost:5432/helpdesk_db

Running the Application

  1. Using Docker Compose (Recommended):
docker-compose up --build
  1. 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-agent

The server will be available at http://localhost:8000

πŸ› οΈ Development Setup

Local Prerequisites

  • Python 3.13+
  • uv package manager
  • PostgreSQL database

Local Development

  1. Install dependencies with uv:
uv venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
uv pip install -r requirements.txt
  1. Set up environment variables:
export POSTGRES_DATABASE_URL="postgresql://username:password@localhost:5432/helpdesk_db"
  1. Run the server:
python -m server.main --port 8000

πŸ“¦ Dependencies

Key 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

πŸ”§ Configuration

The application uses environment variables for configuration:

Variable Description Required
POSTGRES_DATABASE_URL PostgreSQL connection string Yes

πŸš€ Deployment

Production Deployment

  1. Set up PostgreSQL database
  2. Configure environment variables
  3. Deploy using Docker Compose:
docker-compose up -d --build

Health Checks

The application automatically:

  • Creates database tables on startup
  • Validates database connectivity
  • Provides structured error responses

πŸ“ Usage Examples

Creating a Service Request

# Example service request payload
{
    "service_id": 1,
    "requester_name": "John Doe",
    "status": "pending"
}

Updating Service Quantity

# Example quantity update
{
    "quantity": 50
}

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

πŸ“„ License

This project is licensed under the MIT License.

πŸ†˜ Support

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors