The problem
Ask an AI agent how a payroll code is calculated in Senior, which table holds job history, or which LSP function reads a screen field. Without a source, it answers with confidence — and gets it wrong: it invents table names, mixes versions, describes a rule that doesn’t exist.
The right knowledge exists. It lives in the official documentation, the developer portal, the support knowledge base and the product forum. It just isn’t within the agent’s reach when the agent needs it.
What it is
senior-mcp is an MCP (Model Context Protocol) server that turns that knowledge into tools the agent calls on its own. Today it covers Senior Sistemas, one of Brazil’s largest HCM/ERP vendors. LSP is Senior’s proprietary rule language — the code consultants write to customize payroll, HR and ERP behavior.
The tools fall into these groups:
- Search with sources —
senior_searchanswers natural-language queries, with filters for source, product, module and version;senior_get_chunkreturns the full passage;senior_catalogandsenior_statsshow what is indexed. - LSP rules — reference for Senior’s rule language, examples and templates; validation and formatting of a rule before it goes to the client.
- Data dictionary — exact structure of Senior HCM tables and search by field or business description, so the agent writes SQL without inventing columns.
- Screen map — finds a system screen by name, code or business description.
- Reports — SQL and SOAP-envelope templates for Senior HCM reports.
- Answer context and validation — builds an evidence packet before the answer and checks the citations against it afterwards.
How it works
Every query goes through a hybrid search, on a PostgreSQL database with pgvector:
- Vector (75%) — semantic similarity over embeddings: finds the right passage even when the wording differs.
- Keyword (25%) — term matching: finds the exact table, field or function name that embeddings miss.
- Source — every result comes back with a citation (title, origin and link), so the agent can show where its answer came from.
Optional reranking. There is a Voyage AI reranking layer, switched on by configuration. In an internal evaluation (Apr 2026, version 2.1, 50 auto-generated queries), it raised MRR@10 — a metric of whether the right result shows up at the top — from 71.0% to 76.4% (+5.4 pp). It is not yet switched on in the service in use: I want to repeat the evaluation on the current version first.
Access requires a token, and the token stays on the server. No secret goes to the client or the browser.
Real use
I use senior-mcp with Claude Code (and Codex) in consulting work: writing and reviewing LSP rules, building SQL over Senior’s tables, designing integrations. Before writing code, the agent checks the documentation and the language reference — and answers with the passage that backs the answer.
The lookup becomes part of the agent’s loop, not a documentation tab open on the side.
Roadmap — expanding
Senior came first because that is where my experience is. The next step is the layer that applies to any HR and payroll system in Brazil:
- eSocial and FGTS — Brazil’s mandatory payroll reporting system and the severance fund every employer pays into.
- CLT and collective bargaining agreements — the labor code and union agreements every payroll calculation must respect.
- Other HR/ERP systems — the same indexing pattern, for other knowledge bases.
- Connector on the Claude Marketplace — direct install for people who already use Claude.
Nothing on this list is indexed today. When it is, the number comes with it, with its source.
Status
| Status | Scope |
|---|---|
| In use | Senior Sistemas public knowledge (official docs, developer portal, support, forum) · hybrid search with sources · tools for LSP rules, data dictionary, screens and reports · token-based access |
| Optional | Voyage AI reranking: +5.4 pp MRR@10 in the Apr 2026 internal evaluation; re-evaluation before switching it on |
| Expanding | eSocial, FGTS, CLT, collective agreements · other HR/ERP systems · Claude Marketplace connector |
Evaluation access on request. Want to try senior-mcp with your own agent? Write to guilherme@gbbragadev.com and I will issue an evaluation token.
My role
Design of the hybrid indexing, the reranking layer and retrieval evaluation, PostgreSQL/pgvector integration, MCP contract design and service operation.
senior-mcp is independent infrastructure, not affiliated with Senior Sistemas. Trademarks belong to their respective owners.