Skip to main content
Glama
Aman3786

IT Onboarding Automator MCP Server

by Aman3786

Mock IT Onboarding Automator

Project Overview

The Mock IT Onboarding Automator is a backend service that automates employee onboarding based on HR webhook events.

When a new employee is hired, the HR system sends an onboarding event to the service. The system validates the event, determines which applications the employee should receive based on their role, provisions access records, records audit information, and ensures duplicate events are handled safely through idempotent processing.

The project also exposes an MCP (Model Context Protocol) server that allows AI assistants and operators to inspect employee access, review failed onboarding events, and retry failed provisioning operations.


Features

Related MCP server: Test-Governance MCP Server

Webhook Processing

Supports HR onboarding events via:

POST /webhooks/hris

Supported event type:

employee.hired

Role-Based Access Provisioning

Application access is automatically assigned based on employee role.

engineer

  • slack

  • google_workspace

  • jira

sales

  • slack

  • google_workspace

  • salesforce

it_admin

  • slack

  • google_workspace

  • jira

  • salesforce

Idempotent Event Processing

Duplicate webhook deliveries using the same event_id are safely ignored.

The system guarantees:

  • No duplicate employees

  • No duplicate access grants

  • No duplicate provisioning actions

Audit Logging

Every successful provisioning operation creates an audit log containing:

  • event_id

  • role

  • granted applications

  • idempotency status

MCP Server

The MCP server exposes the following tools:

get_employee_access

Retrieve employee details and provisioned application access.

list_failed_events

List failed onboarding events.

retry_provision

Retry a previously failed onboarding event.


Architecture Summary

flowchart TB
    HR[HR System]

    HR -->|POST /webhooks/hris| WEBHOOK[FastAPI Webhook]
    WEBHOOK --> PROV[Provisioning Service]

    PROV --> EMP[Employees]
    PROV --> ACCESS[Access Grants]
    PROV --> AUDIT[Audit Log]

    DB[(SQLite Database)]

    EMP --> DB
    ACCESS --> DB
    AUDIT --> DB

    MCP[MCP Server]

    MCP --> TOOL1[get_employee_access]
    MCP --> TOOL2[list_failed_events]
    MCP --> TOOL3[retry_provision]

    TOOL1 --> DB
    TOOL2 --> DB
    TOOL3 --> DB

Technology Stack

Component

Technology

Language

Python 3.12+

API Framework

FastAPI

ORM

SQLAlchemy 2.0

Database

SQLite

MCP

Official Python MCP SDK

Testing

pytest

Package Management

uv


Prerequisites

Install:

  • Python 3.12+

  • uv

  • Git

Verify installation:

python --version
uv --version
git --version

Installation

Clone repository:

git clone https://github.com/Aman3786/IT-Onboarding-Automator.git
cd IT-Onboarding-Automator

Install dependencies:

uv sync

OR

uv pip install -r requirements.txt

Initialize Database

Create tables and seed initial role mappings:

uv run python setup_db.py

Expected output:

Database initialized successfully

Database location:

data/onboarding.db

Run API

Start FastAPI server:

uv run uvicorn api.main:app --reload

API available at:

http://localhost:8000

Interactive documentation:

http://localhost:8000/docs

Run MCP Server

Start MCP server (Prequisite: Nodejs Should be installed for MCP Inspector)

npx @modelcontextprotocol/inspector uv run python -m mcp_server.server

OR

uv run mcp dev mcp_server/server.py

OR

uv run python -m mcp_server.server
npx -y @modelcontextprotocol/inspector

The MCP server uses stdio transport and is intended to be consumed by MCP Inspector, cursor and other MCP-compatible clients.


Configure Cursor MCP

Create:

.cursor/mcp.json

Configuration:

{
  "mcpServers": {
    "onboarding-automator": {
      "command": "uv",
      "args": [
        "run",
        "python",
        "-m",
        "mcp_server.server"
      ]
    }
  }
}

Restart Cursor after creating the configuration.

The following tools should become available through MCP Inspector/Cursor:

  • get_employee_access

  • list_failed_events

  • retry_provision


Run Tests

Run all tests:

uv run pytest

Run verbose output:

uv run pytest -v

Run a specific test file:

uv run pytest tests/test_webhook.py -v

Example Requests

Successful Employee Onboarding

curl -X POST http://localhost:8000/webhooks/hris \
-H "Content-Type: application/json" \
-d '{
  "event_id":"evt_hire_001",
  "event_type":"employee.hired",
  "email":"alex.chen@example.com",
  "full_name":"Alex Chen",
  "role":"engineer"
}'

Example response:

{
  "event_id": "evt_hire_001",
  "status": "completed",
  "idempotent": false,
  "employee": {
    "email": "alex.chen@example.com",
    "role": "engineer"
  },
  "granted_apps": [
    "slack",
    "google_workspace",
    "jira"
  ]
}

Duplicate Event

Submitting the same request again:

{
  "event_id": "evt_hire_001",
  "status": "completed",
  "idempotent": true
}

Invalid Role

curl -X POST http://localhost:8000/webhooks/hris \
-H "Content-Type: application/json" \
-d '{
  "event_id":"evt_invalid_role",
  "event_type":"employee.hired",
  "email":"bad@example.com",
  "full_name":"Bad User",
  "role":"unknown_role"
}'

Response:

{ 
  "event_id":"evt_invalid_role",
  "status":"failed",
  "error":"Unknown role: 'unknown_role'"
}

Assumptions

  1. Employee email addresses are unique.

  2. Roles are predefined and managed internally.

  3. Application provisioning is simulated through database records.

  4. SQLite is sufficient for local execution and evaluation.

  5. Duplicate webhook deliveries reuse the same event_id.

Available Tools

3 tools
get_employee_accessA

Look up an employee by email address and return their profile plus the list of provisioned application grants.

ParametersJSON Schema
NameRequiredDescriptionDefault
emailYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states the output but does not disclose whether the operation is read-only, any side effects, authorization requirements, or error handling behavior. This is minimal for a lookup tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence of 18 words with no extraneous information. It is front-loaded and every word adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (one parameter, output schema exists), the description covers the basic operation and result. However, it does not address edge cases (e.g., email not found) or response details, but the output schema may handle that.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description explains the sole parameter 'email' by stating the lookup is by email address. Since schema coverage is 0%, the description compensates adequately by specifying the parameter's purpose beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool looks up an employee by email, returning their profile and provisioned application grants. It is specific about verb ('look up'), resource ('employee'), and result. It distinguishes from siblings (list_failed_events, retry_provision) which are about events and provisioning.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool versus alternatives. The description does not mention context, prerequisites, or situations where other tools would be more appropriate. Siblings are present but not referenced.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_failed_eventsA

List webhook events that failed provisioning. Optionally filter to events created on or after the provided ISO 8601 timestamp (since).

ParametersJSON Schema
NameRequiredDescriptionDefault
sinceNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.5/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must fully disclose behavior, but it only states the tool lists events with an optional filter. Missing details on rate limits, pagination, behavior when no events, or authorization needs.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise sentences efficiently convey purpose and filtering option without unnecessary words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simplicity (one optional param, output schema exists), the description is adequate but lacks mention of ordering, pagination, or error scenarios. Could be more complete for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Since schema coverage is 0%, the description adds essential meaning by explaining the 'since' parameter filters events on or after an ISO 8601 timestamp, which is not evident from the schema alone.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool lists webhook events that failed provisioning, using a specific verb and resource. It distinguishes from siblings like 'get_employee_access' and 'retry_provision' which serve different purposes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives. Sibling tools are listed but not contrasted, and there is no mention of prerequisites or scenarios where this tool is preferable.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

retry_provisionA

Retry provisioning for a previously failed webhook event by event_id. Reloads the stored payload and runs the hire provisioning flow again.

ParametersJSON Schema
NameRequiredDescriptionDefault
event_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden. It mentions reloading stored payload and running the hire provisioning flow, indicating a mutation operation. However, it lacks details on side effects, retry limits, idempotency, or potential consequences.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with two sentences that front-load the purpose and action. No unnecessary words or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has only one parameter, an output schema, and clear siblings, the description covers the core functionality well. It could elaborate on the output or error conditions, but it is sufficiently complete for this context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The only parameter, 'event_id', is described as identifying the event, but the description does not explain its format, source, or constraints. With 0% schema coverage, the description adds minimal meaning beyond the schema's name.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Retry' and the resource 'provisioning for a previously failed webhook event'. It distinguishes from sibling tools like 'list_failed_events' and 'get_employee_access' by focusing on the retry action for failed events.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description specifies it is for 'previously failed webhook events', providing clear context. However, it does not explicitly state when not to use this tool or list alternatives, though the sibling tools imply distinct purposes.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 3 tool updatesv0.1.0
    • First observedget_employee_access
    • First observedlist_failed_events
    • First observedretry_provision

TDQS

A3.8/5.0

Scored across 3 tools

Disambiguation5/5

Each tool serves a distinct function: employee lookup, listing failures, and retrying provisioning. There is no ambiguity or overlap between them.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern in snake_case: get_employee_access, list_failed_events, retry_provision. No deviations.

Tool Count4/5

Three tools is slightly on the low side but adequate for the narrow domain of IT onboarding automation. The set covers lookups, monitoring, and recovery.

Completeness3/5

The tools cover access checking and failure handling, but lack creation or revocation of access. This leaves notable gaps in typical onboarding lifecycle.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers