Skip to content
Back to projects

dominican-tools-mcp

In Development

An MCP server with Dominican tax and labor-law tools, and evals that check a model uses them well

Role: Solo developer

Solo · Since Nov 2026 · Public repo

.NET 10MCP C# SDKxUnitMicrosoft.Extensions.AIGemini
42
Tests, real server and client
50
Eval cases with known answers
20
Agent eval prompts

A Model Context Protocol server with five read-only tools: validate a Dominican RNC, cédula or NCF, search the Labor Code and read an article. It reuses the code from my dgii-helper and Labor Code projects, plus a set of evaluations that measure whether the tools return the right thing and whether a model uses them correctly.

Problem

Wiring a tool to a model is the easy part. The hard part is checking that the tool answers correctly, that its description is enough for the model to pick it, and that the model does not invent what the tool never said.

Solution

Each tool is read-only, has bounded inputs and a description that states what it does not do. Two kinds of evaluation sit on top: a deterministic one against known answers that runs in CI, and one that gives prompts to Gemini with the real tools and checks tool choice and answer content. The server and a real MCP client are tested connected in memory, so the protocol is exercised and not just the methods.

Not done yet

The Gemini eval is 20 prompts I wrote, one small model, one run and text checks instead of a judge, so it shows that the descriptions did not confuse that model and says nothing about others. The search is keyword-based and misses 7 of 21 test questions. The code is copied from two other repos, not shared. It queries no external service, runs only over stdio and I did not try it with a desktop MCP client.

Architecture highlights

  • 42 tests run the real server against a real MCP client over in-memory pipes. Removing the input length limit or changing the RNC check-digit weights breaks three tests each
  • An invalid identifier is a normal answer (valid: false and why); a misuse such as a 65-character value or top = 0 is a tool error. The validators never echo the input back, so a hostile string does not return to the model as if it were an instruction
  • The tool descriptions say what the tools do not do (for instance that RNC validation does not query the tax authority), and a test requires it, because the description is what the model reads when choosing
  • The deterministic eval has 50 cases: 43 pass and 7 are marked as known misses of the keyword search, such as the notice-period article. If a change fixes one, the report flags the improvement and exits non-zero until the mark is removed
  • The Gemini eval ran 20 prompts: the right tool in 19 of 19 valid runs, the expected content in 19 of 19, and one false alarm from my own number-grounding check (the article writes the figure in words and the model wrote 100%). I kept the check as it was instead of tuning it to zero
  • The first run was cut after 8 prompts by the free-tier quota. I added pacing and retries and kept both result files