All buildsIn progress

Local tool server package / 2026 / In progress · Anonymized work

Research MCP Service.

A local tool server that checks every research tool call on the way in and on the way out

Part of the Research Workflow Engine journey
Role
Software engineering
Built with
TypeScript · Node.js · MCP SDK · Zod · SQLite · esbuild · Vitest

01What I built

The problem.

A program calling a tool can send badly formed input. It may also try again when something fails. A tool might accept junk, send back an answer in a shape the caller didn’t expect, or leak a raw error. Then the caller can’t tell what to do next. And a retry must not be mistaken for a second, separate attempt.

What I built.

Research A technical wordMCPModel Context Protocol. A standard way for AI apps to find and use tools that other programs offer. Service is an MCP server. It offers the engine’s actions to AI apps as tools, each with a fixed shape. Programs talk to it through standard input and output, the plain text channels a command-line program uses. A registry, a list of every tool, holds each tool’s version and its input and output rules. One shared service handles every call. It reads the input, sent as A technical wordJSONA common text format that programs use to send each other structured data. text, and limits how deeply data can sit inside other data. Then it hands the work to the engine’s own code, and checks the result before it goes back. The research rules and the saved data stay with the engine.

The server

TypeScript, Node.js, MCP SDK, Zod, esbuild, Vitest

Tool registry
Holds each tool’s version, its strict input rules and output rules, and short notes that describe it.
Shared service
Reads the input and limits how deeply data can sit inside other data. Then it hands the work to the engine and checks the result.The storyReturning useful errors without recording a failed save twice
Error mapping
Sorts known failures into types, each with retry advice. Any unknown failure becomes one fixed internal error.The storyReturning useful errors without recording a failed save twice
Output streams
Sends protocol messages on the standard output channel, and start and stop logs on the error channel. The logs leave out file paths and the computer’s settings.
Packaged process
Ships as one bundle, with the piece that lets it use SQLite and the steps that set up the database. It keeps saved data away from the installed code.

Confidential work. Names and identifying business details have been changed.

02The journey

What broke, and what changed.

Broke, then fixedA decisionA milestone

  1. 01 of 04Decided

    One service behind both the protocol and the tests

    The questionThe tools can be reached through A technical wordMCPModel Context Protocol. A standard way for AI apps to find and use tools that other programs offer., the Model Context Protocol, or called directly in tests. Two separate routes through the code would mean two sets of checks.

    What I choseSo one Research MCP Service · The serverShared serviceReads the input and limits how deeply data can sit inside other data. Then it hands the work to the engine and checks the result.See it in the map above sits behind both routes. Every caller gets the same checks and the same code doing the work. Separate protocol tests still check how tools are listed and how messages travel. A direct call can’t reach those parts.

03Today

Where it stands.

Tests that call the code directly don’t cover the packaged program or the protocol. I haven’t compared the installed plugin with this code. The server can’t tell whether an observation it is given is true. Known error messages are passed on as they are. So the code that writes them has to keep private details out.