Skip to main content
Glama

mcp-hr-knowledge-evals

Enterprise-ready Model Context Protocol (MCP) server in TypeScript exposing structured HR policy tools, RAG-style context retrieval with citations, and an automated evaluation harness that benchmarks accuracy against 20 synthetic HR scenarios.

Docs · Live tool demo · npm

Stack

  • Runtime: Node.js >= 18 (ESM), TypeScript strict mode (NodeNext, ES2022)

  • MCP: @modelcontextprotocol/sdk — tools, prompts, resources over stdio

  • Evals: vitest harness with deterministic lexical scoring; optional Claude-as-judge scoring via @anthropic-ai/sdk

  • Validation: zod input schemas on every tool

Related MCP server: HR Assist MCP Server

Quickstart

npm install
npm run build      # compile TypeScript -> dist/
npm start          # run server on stdio
npm run dev        # watch mode via tsx
npm run inspector  # MCP Inspector: npx @modelcontextprotocol/inspector node dist/index.js
npm run eval       # vitest run evals/ — 20 scenario benchmarks
npm run web        # local browser demo on http://localhost:8000

Or install from npm and register with an MCP client:

npm install -g mcp-hr-knowledge-evals
{ "mcpServers": { "hr-knowledge": { "command": "mcp-hr-knowledge-evals" } } }

Optional: copy .env.example to .env and set ANTHROPIC_API_KEY to enable the Claude-as-judge scorer (EVAL_MODEL overrides the default claude-3-5-sonnet-20241022). Without a key, evals use the deterministic scorer — all 20 cases still run and pass.

Tools

query_hr_policy

Keyword/semantic retrieval over the HR handbook. Returns the top matching policy documents with full section text and citation ids.

Param

Type

Required

Notes

query

string

yes

Natural-language HR question

department

"HR" | "Engineering" | "Sales"

no

Scope filter

get_onboarding_milestones

Role-specific onboarding expectations and completion criteria. Roles map to Engineering / Sales / HR / General families.

Param

Type

Required

Notes

role

string

yes

e.g. "backend engineer"

tenure_days

30 | 60 | 90

yes

Onboarding checkpoint

fetch_manager_coaching_rubric

Synthesizes a 1-on-1 agenda, coaching prompts, and SBI feedback guidance keyed to the scenario topic (deadlines, growth, conflict, workload) and rating.

Param

Type

Required

Notes

scenario

string

yes

e.g. "missed two sprint deadlines"

performance_rating

"Exceeds" | "Meets" | "Needs_Improvement"

yes

Rating tier

Prompts & resources

  • Prompt: conduct_manager_1on1 — formats employee name, rating, and scenario into a policy-grounded system prompt.

  • Resources: every policy exposed at hr://policies/<id> (e.g. hr://policies/parental-leave) as markdown with its citation id.

Eval harness

npm run eval executes 20 synthetic scenarios covering all three tools and reports:

----------------------------------------------------
  HR KNOWLEDGE EVAL BENCHMARK
----------------------------------------------------
  Cases evaluated .......... 20
  Judge .................... deterministic
  Tool selection accuracy .. 100.0%
  Policy retrieval precision 100.0%
  Hallucination rate ....... 0.0%  (goal 0.0%)
----------------------------------------------------

Metrics

  • Tool selection accuracy — heuristic router picks the expected tool

  • Policy retrieval precision — fraction of ground-truth facts present in output

  • Hallucination rate — forbidden content, fabricated citation ids, or missing required citations (goal: 0.0%)

With ANTHROPIC_API_KEY set, each case additionally receives a Claude-as-judge PASS/FAIL faithfulness verdict.

Layout

src/
  index.ts            entry point — connects StdioServerTransport
  server.ts           MCP server: tools, prompts, resources
  tools/hrTools.ts    tool implementations (pure functions)
  data/hrPolicies.ts  mock HR handbook with citation ids
  types/index.ts      interfaces + zod schemas
evals/
  scenarios.ts        20 eval cases with ground truth
  scorer.ts           deterministic scorer + Claude judge + prompt router
  hrScenarioEval.test.ts
scripts/
  smoke-stdio.mjs     JSON-RPC handshake smoke test
web/
  server.mjs          zero-dep HTTP wrapper around dispatchTool (live demo)
  public/index.html   browser playground for the three tools
docs/
  index.html          GitHub Pages docs site

Live demo

web/server.mjs exposes POST /api/tools/<name> and a small static playground, calling the same dispatchTool() the MCP tools/call handler uses — no LLM in the loop. render.yaml deploys it as a free Render web service (health check at /api/health); the UI is served same-origin so no extra config is needed.

Available Tools

3 tools
fetch_manager_coaching_rubricB

Synthesize a structured 1-on-1 agenda, coaching prompts, and feedback guidance for a scenario and performance rating.

Inputs: scenario (required), performance_rating (required).

get_onboarding_milestonesB

Get role-specific 30/60/90-day onboarding expectations and completion criteria.

Inputs: role (required), tenure_days (required).

query_hr_policyA

Search the HR policy handbook with keyword/semantic matching. Returns verified policy text with citation ids for grounded answers.

Inputs: query (required), department.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 3 tools

    Disambiguation4/5

    Each tool targets a distinct output: policy text with citations, onboarding milestones, and a coaching rubric/agenda. There is mild conceptual overlap since onboarding expectations and coaching guidance often live inside HR policy, so an agent could occasionally route an onboarding question to query_hr_policy instead.

    Naming Consistency4/5

    All names follow snake_case verb_noun structure (query_, get_, fetch_), which is readable and predictable. Minor deviation: 'fetch_manager_coaching_rubric' actually synthesizes content rather than fetching it, so the verb slightly misrepresents the action.

    Tool Count4/5

    Three tools is on the lean side but each earns its place in a narrow HR knowledge/evals domain with no redundant operations. Scoping is tight rather than padded, though the surface is thin enough that users may wish for one or two more entry points.

    Completeness4/5

    For a read-only HR knowledge server, coverage is reasonable: policy lookup, onboarding lifecycle guidance, and manager coaching scenarios. Minor gaps exist, such as no way to enumerate available policy categories or resolve citation ids as a follow-up, but agents can work around these via query_hr_policy.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      MCP server that enables querying an HR FAQ document via RAG, returning accurate answers and related chunks, and supports index rebuilding and response evaluation.
      -
    • F
      license
      C
      quality
      D
      maintenance
      Agentic HR assistant providing employee, leave, meeting, ticket, and email tools over the Model Context Protocol, designed to automate onboarding workflows via an MCP client such as Claude Desktop.
      14
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      An MCP server exposing internal business operations as tools — task management (create, list, update status) and RAG-style semantic search over an internal knowledge base (leave, expense, and onboarding policies) that any MCP-compatible AI agent can call directly for grounded, non-hallucinated answers.
      -
    • F
      license
      Not graded
      quality
      B
      maintenance
      Enables querying corporate knowledge such as HR policies, vendor contracts, and support FAQs, with every answer grounded in an exact source and retrieval quality and hallucination rate explicitly measured.
      -