Skip to content

Build tools AI can use correctly

Em See Pea helps you build tools that AI assistants can use through the Model Context Protocol (MCP). It handles the server, checks incoming data, and checks the results your tools return.

Correct data is only half the job. Its testing package checks whether a language model chooses the right tool and explains the result correctly.

Create a small, tested starter and make it yours. Start with one useful tool, then add the capabilities you need.

Get your first server running.

Keep your server. Add tests that check whether a model chooses the expected tool and understands its result.

Add AI tool-choice and understanding tests.

Find out which transport, validation, and request-handling code Em See Pea can take over, and which application responsibilities remain yours.

Plan a server migration.

  • Tools that answer questions using your data or another service.
  • Protected capabilities with public discovery by default, or explicit permission-shaped discovery.
  • Reference material and reusable prompts for assistants.
  • Tools that send progress updates while they work.
  • Optional detailed feedback and durable support conversations.
  • Optional webhook events that notify subscribed clients after an application change.
  • Optional web forms, using native HTML or React.

Choose an example that matches what you want to build.

Add feedback after choosing the application shape.

Add MCP Events when an authenticated client needs a webhook after an application change.

Test the choice and meaning, not just the response

Section titled “Test the choice and meaning, not just the response”

A response can contain all the right fields and still lead to a wrong answer. An assistant might confuse money available to spend with money owed, or a payment received with a payment matched to an invoice.

Em See Pea lets you describe the expected tool and meaning in a JavaScript test. The model chooses from your server’s advertised tools. The test runs the chosen call against your server, then checks whether the model understands the result. Keep these tests in eval/, separate from ordinary tests in test/.

Write an AI tool-choice test.

Em See Pea is beta. Here, beta means exactly this:

  • The MCP capabilities named below are usable and verified end to end.
  • Versions below 1.0 may still introduce breaking changes.
  • Only the newest version published under the npm latest tag is eligible for security fixes.
  • There is no production-support promise, no backport promise, and no response-time promise.

The active revision is MCP 2026-07-28 over Streamable HTTP. One stateless endpoint also accepts a verified compatibility subset of 2025-11-25, 2025-06-18, 2025-03-26, 2024-11-05, and 2024-10-07: initialization, tool listing, and tool invocation.

Two optional capabilities are not implemented: list-change notifications within one running process and a generic extension-notification registration point. MCP Sampling is intentionally absent because the active revision deprecates it. Read the protocol coverage ledger for the evidence and boundaries.

The packages support Node.js 22 or newer. Four starters require Node.js 22.13.0 or newer. Continuous integration (CI) exercises Node.js 22 and 24; those are tested versions, not the complete support range.

The starter commands use npm’s default release channel. The framework and examples are open source under the MIT licence.