kazhian/hr-data-mcp
If you are the rightful owner of hr-data-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
A Model Context Protocol (MCP) server built with Spring Boot and Spring AI, providing AI assistants with access to HR employee data through standardized queries and operations.
HR Data MCP Server
A Model Context Protocol (MCP) server built with Spring Boot and Spring AI, providing AI assistants with access to HR employee data through standardized queries and operations.
Overview
This project implements an MCP server that exposes HR employee data to AI assistants, enabling them to answer questions about employees, departments, skills, and organizational structure. The server uses an in-memory H2 database pre-populated with comprehensive employee records for testing and demonstration purposes.
Features
- MCP Protocol Implementation: Standards-compliant Model Context Protocol server
- Spring Boot Integration: Built on Spring Boot with Spring AI for robust enterprise-grade architecture
- In-Memory Database: H2 database with 100+ employee records across multiple departments
- Comprehensive Data Model: Employee records include roles, departments, skills, and contact information
- RESTful API: Easy-to-use endpoints for HR data operations
- Department Coverage: Data spans across AP, AFS, DAP, ISBLT, OPSSVC, CORE, and LIGHT departments
Technology Stack
- Java 17+
- Spring Boot 3.x
- Spring AI
- H2 Database (In-Memory)
- Gradle (Build Tool)
- Model Context Protocol (MCP)
Database Schema
CREATE TABLE employees (
id INT PRIMARY KEY,
name VARCHAR(100),
role VARCHAR(100),
department VARCHAR(50),
email VARCHAR(100),
skills VARCHAR(200)
);
Sample Data
The database includes 100 diverse employee records with:
- Departments: AP, AFS, DAP, ISBLT, OPSSVC, CORE, LIGHT
- Roles: Developers, Engineers, Managers, Analysts, Specialists
- Skills: Various technology stacks, programming languages, frameworks, and business skills
- Email Format: firstname.lastname@mcp.com
Getting Started
Prerequisites
- Java 17 or higher
- Gradle 7.x or higher
Installation
-
Clone the repository:
git clone https://github.com/yourusername/hr-data-mcp.git cd hr-data-mcp
-
Build the project:
./gradlew build
-
Run the application:
./gradlew bootRun
The server will start on http://localhost:8080
Configuration
Application properties can be configured in src/main/resources/application.properties
:
# Server configuration
server.port=8080
# H2 Database configuration
spring.datasource.url=jdbc:h2:mem:hrdb
spring.datasource.driver-class-name=org.h2.Driver
spring.h2.console.enabled=true
# Spring AI configuration
# Add your AI provider configurations here
API Endpoints
Employee Operations
GET /api/employees
- Get all employeesGET /api/employees/{id}
- Get employee by IDGET /api/employees/department/{dept}
- Get employees by departmentGET /api/employees/search?skill={skill}
- Search employees by skill
MCP Protocol Endpoints
POST /mcp/query
- Execute MCP queriesGET /mcp/schema
- Get available data schemaGET /mcp/capabilities
- Get server capabilities
Example Queries
The MCP server can handle various types of queries:
- "Show me all Java developers in the AP department"
- "Who are the machine learning engineers?"
- "List employees with React skills"
- "What departments does the company have?"
- "Find employees with cloud computing experience"
Project Structure
src/
āāā main/
ā āāā java/
ā ā āāā com/example/hrdatamcp/
ā ā āāā HrDataMcpApplication.java
ā ā āāā controller/
ā ā āāā model/
ā ā āāā repository/
ā ā āāā service/
ā āāā resources/
ā āāā application.properties
ā āāā data.sql
āāā test/
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
Use Cases
This MCP server is ideal for:
- AI Assistant Integration: Enable AI assistants to query HR data
- Learning MCP Protocol: Understand how to implement MCP servers
- HR Analytics: Demonstrate AI-powered HR data analysis
- Prototyping: Quick setup for HR-related AI applications
- Testing: Comprehensive dataset for various query scenarios
License
This project is licensed under the MIT License - see the file for details.
Acknowledgments
- Built with Spring Boot
- Uses Spring AI for AI integration
- Implements Model Context Protocol
- H2 Database for lightweight data storage
Support
If you have questions or run into issues, please:
- Check the Issues page
- Create a new issue with detailed information
- Contribute improvements via Pull Requests
Note: This is a demonstration project with sample data. For production use, implement proper security, authentication, and use a persistent database.