MCP server: building one for business software | Rakam AI

MCP · Updated 2026-08-28

MCP server: what it contains, and where the work is

An MCP server is not a layer of intelligence, it is a contract. It declares what a model may call, with which parameters and within which limits. All the work is in that contract, and almost none in the protocol.

What an MCP server actually contains

Three things, and it helps to keep them apart because they often get conflated.

Tools. Functions the model can call, each with a name, a description, a parameter schema and a return value. This is the part that matters.

Resources. Content the model can read without triggering an action: a document, a record, an extract from a reference table. Useful, rarely decisive.

Prompts. Pre-registered request templates the client can offer the user. Interface convenience, not architecture.

A server with nothing but well-described tools works. A server with all three but vague tools does not. That is where the outcome is decided.

The tool description is the real code

This is the point most teams discover too late. The model does not see your implementation: it sees a name, a sentence and a schema. If it picks the wrong tool, that is almost never its fault, it is that two descriptions look alike.

Three rules we apply systematically:

One business intent, one tool. Not one function per API endpoint. “Find a customer’s unpaid invoices” is a tool; “GET /invoices with nine optional parameters” is not, because it forces the model to guess the useful combination.

The description says when not to use it. A sentence like “do not use for credit notes, see this other tool” removes half the selection errors. It is counter-intuitive and very effective.

The schema refuses rather than guesses. A missing required parameter must produce an explicit error the model can read and correct, not a silent default that yields a wrong but plausible result.

The number of tools is a constraint, not a detail

Past twenty or thirty tools, selection degrades: each extra description dilutes the others. Two possible answers.

The first is to group: move up one level of abstraction so that ten tools cover what a hundred endpoints exposed. That is almost always the right answer, and it requires understanding the business.

The second is to select before calling: a first stage picks the few tools relevant to the question, and only those are presented to the model. That is what you need when the perimeter is genuinely wide, as on a full management suite.

Security: three decisions to take before the first line of code

The perimeter is closed by default. The server exposes only what you decided to open, tool by tool. A server that exposes “the database” is not an MCP server, it is a door.

Rights are the user’s, not the server’s. If the server queries everything with a privileged account, a user obtains through the agent what they cannot see in the software. That is an information leak with no technical flaw, and it is invisible in a demo.

Content injection is handled server-side. A document, a ticket or a free-text field can contain instructions the model takes as directions. No system prompt solves this reliably. What does: writes going through controlled functions, human approval on anything not reversible, and logging of every call with its parameters. The full reasoning is on MCP.

What a production server taught us

We operate MCP servers in front of clients’ business software, including one covering several dozen tools on a management suite. On the reporting agent at OOTI, a construction ERP, two measurements sum up everything above:

  • 92 % tool-call precision, meaning the right function with the right parameters. That figure moved when we rewrote the descriptions, not when we changed model.
  • Under $0.10 per interaction, because the agent calls two or three precise tools instead of loading a massive context.

The lesson is always the same: changing model takes a day, writing the tool contract takes the project. The SDK we use to build these servers is published as open source under the name rakam_systems.

When to build a server, and when to skip it

Skip it for a first project, on a single product, with a single agent. Calling your APIs directly is faster, and the tool descriptions will be reusable later anyway.

Build it as soon as there are several consumers: several models, a desktop client and a server-side agent, or several teams wanting to plug in their own assistants. From there you describe the tools once instead of once per integration, and that is what makes the cost reasonable.

Frequently asked

Fewer than you would think. Past twenty to thirty tools, the model chooses less well, because each description drowns in the others. The right granularity is not one function per endpoint but one function per business intent, which often gives ten tools where the API has a hundred endpoints. One server we operate goes past that limit, and it only does so with a mechanism that pre-selects the relevant tools.

stdio for a desktop client that launches the server as a subprocess, HTTP when several remote consumers share the same server. In practice a server sitting in front of business software ends up on HTTP, because it has to live where the rights and the secrets live, not on a user's machine.

The server carries its own technical account, whose rights you set, and it propagates the user's identity for anything that must respect authorisations. The rule is simple: what a user cannot see in the software, they must not obtain through the agent. A server that queries everything with an administrator account creates an information leak with no technical flaw at all.

No, never directly. A tool that accepts free-form SQL cancels every control the software has: its business rules, its triggers, its consistency. Tools call functions we have written, each with its own parameter validation. Reads can go through generated queries, but against bounded, read-only views.

On two levels. Each tool is tested like an ordinary function, with its edge cases. Then you test selection: a set of real questions, and you check that the right tool is called with the right parameters. It is that second level projects skip, and it is the one that makes the difference between 92 % and 60 % call precision.

No, because most of the effort is not about the protocol. Describing tools, validating parameters, bounding a perimeter and logging calls is the work to be done anyway, whatever the transport. What you invest in the contract of your business functions stays valid if the specification changes.

Newsletter

Every month, what really works in AI for software vendors.

Cases, figures, business models. One email, no more.

Request a demo

Fifteen minutes to see an AI agent working inside software like yours.