mcp-human-resources

dbrown725/mcp-human-resources

3.2

If you are the rightful owner of mcp-human-resources 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.

Spring Boot MCP Server implementation focused on exposing Human Resources department data.

mcp-human-resources

Spring Boot MCP Server implementation focused on exposing Human Resources department data

This was built as a learning tool. Do not use it as a template for a Production application. Giving your LLM access to create, update and delete database rows is probably not a good idea.

Installation

Assumes Linux with Java, Maven, node and npm installed

  1. Clone the repository:
git clone https://github.com/dbrown725/mcp-human-resources.git
cd mcp-human-resources
  1. Setup Brave Search: Acquire API Key, update configuration file and install Node module(s):
    https://github.com/modelcontextprotocol/servers-archived/tree/main/src/brave-search
    Follow the above directions and acquire an API Key

    Brave Search configuration: src/main/resources/mcp-servers.json
    Update with your BRAVE_API_KEY
npm i @modelcontextprotocol/server-brave-search
  1. Setup Elastic Search:
    Elastic Search MCP: https://github.com/elastic/mcp-server-elasticsearch

    Install Elastic Search and Kibana: https://www.elastic.co/docs/deploy-manage/deploy/self-managed/install-kibana
    Directions for loading a csv file into Elastic Search using Kibana.
    https://www.elastic.co/blog/importing-csv-and-log-data-into-elasticsearch-with-file-data-visualizer

    Use the following data to load an Elastic Index: mcp-human-resources/employee_code_of_conduct_policies.csv
    Name the index: employee_code_of_conduct_policies

    Configuration: src/main/resources/mcp-servers.json
    Note that a space was needed in "ES_API_KEY": " ", since my local Elastic Index has not security enabled
npm i @elastic/mcp-server-elasticsearch
  1. Setup your preferred LLM, tested with GROQ and Google Vertex AI:
    Spring AI supported models: https://docs.spring.io/spring-ai/reference/api/index.html

    Current code setup with GROQ
    Acquire an API KEY: https://console.groq.com/keys

export GROQ_API_KEY=<YOUR_GROQ_API_KEY>
  1. Notes from when run with Google Vertex AI
    https://docs.spring.io/spring-ai/reference/api/chat/vertexai-gemini-chat.html
    Including the following command run in the terminal that also starts the spring-boot app.
    gcloud config set project <YOUR_PROJECT_ID> && gcloud auth application-default login <YOUR_ACCOUNT>

    Need to set up ADC. (Need to run on a machine with a browser)
    Helped with seting up ADC locally:
    https://cloud.google.com/docs/authentication/set-up-adc-local-dev-environment https://www.youtube.com/watch?v=mEsC0BpEYGM
    gcloud auth application-default login
    In the browser when prompted choose my google user and then selected all access options.
    Terminal then showed: Credentials saved to file: [/home/davidbrown/.config/gcloud/application_default_credentials.json]
    First test resulted in an error and instructions with url link to resolve. I needed to follow the link and enable Vertex AI API

    If switching from current GROQ setup to Google Vertex AI you will have to make comment/uncomment changes to pom.xml and application.properties

  2. Setup log directory and file

sudo mkdir /var/log/mcp-human-resources
sudo touch /var/log/mcp-human-resources/mcp-human-resources.log
sudo chmod -R 777 /var/log/mcp-human-resources
  1. Run a Maven Intall
"/home/<YOUR_HOME_DIRECTORY>/Documents/projects/mcp-human-resources/mvnw" install -f "/home/<YOUR_HOME_DIRECTORY>/Documents/projects/mcp-human-resources/pom.xml"
  1. Start the server
    Update run.sh with your JDK install location
./run.sh
  1. Can be tested using a browser or Postman

    http://localhost:8081/ai?prompt=Write%20a%20few%20paragraphs%20about%20the%20Fermi%20Paradox%20and%20what%20are%20some%20of%20the%20possible%20explainations%20for%20why%20it%20exists.

    http://localhost:8081/employees/5012

    http://localhost:8081/ai?prompt=How%20many%20employees%20in%20IT%20are%20asian?

    http://localhost:8081/ai/chat-response?prompt=I%20am%20visiting%20Baltimore%20Maryland%20next%20week,%20give%20me%20a%20list%20of%20twenty%20places%20to%20visit.

    http://localhost:8081/ai/stream?prompt=I%20am%20visiting%20Baltimore%20Maryland%20next%20week,%20give%20me%20a%20list%20of%20twenty%20places%20to%20visit.

    Can be tested using the associated Client APP:
    https://github.com/dbrown725/mcp-human-resources-client

  2. Uses H2 as a database, it is loaded on application startup.
    http://localhost:8081/h2-console
    Password is in application.properties
    Sample query: Select * from EMPLOYEE where AGE > 50;

  3. To see current logging level:
    http://localhost:8081/log