Guide5 min read

How to build an MCP server for your product

To build an MCP server, pick the handful of questions and actions your users actually want from an AI assistant, expose each as a clearly described tool, enforce your app's permissions inside every tool and return only what the model needs. Use an official SDK, serve it over HTTP with proper sign-in, and test it with real assistants before release.

The Model Context Protocol lets an AI assistant use your product the way a person would: look things up, take actions, follow your rules. You build one server, and every MCP-compatible assistant can use it.

I have built MCP servers for a production CRM, FindRE, and for a commerce platform. The protocol is the easy part. The decisions below are where a server becomes useful or useless.

1. Start from questions, not endpoints

The most common mistake is to wrap every API endpoint as a tool. You end up with sixty tools the model cannot choose between.

Instead, write down what a user would actually say to an assistant:

  • "Which deals have gone quiet this week?"
  • "Add a follow-up for this lead on Friday."
  • "What is low on stock, and what is on order?"

Each of those becomes one tool, even if it takes three API calls behind the scenes. Aim for a short list. The commerce server I built exposes catalog, inventory, promotions and orders, and that covers what people ask for.

2. Know the three primitives

PrimitiveWhat it is forExample
ToolsActions the model decides to callfind_stalled_deals, create_follow_up
ResourcesInformation the client can load into contextA lead's record, a policy document
PromptsReady-made starting points for users"Review my pipeline"

Most of the value is in tools. Add resources and prompts once the tools are solid. The full specification and the official SDKs are at modelcontextprotocol.io.

3. Write descriptions for the model

The model reads each tool's name, description and input schema every time it decides what to do. That text is your interface.

  1. Name the intent

    find_stalled_deals tells the model when to use it. get_deals_v2 does not.

  2. Say when to use it, and when not to

    "Use to find deals with no activity for a number of days. Do not use for a single deal; use get_deal for that."

  3. Keep inputs few and typed

    Enumerate allowed values. Give defaults. Every optional free-text field is a chance for the model to guess wrong.

  4. Describe the output

    Tell the model what comes back, so it knows whether it has what it needs or must call something else.

4. Enforce permissions in every tool

This is the part that decides whether the server is safe to ship.

  • Act as the user, never as the system. Every call carries the identity of the signed-in person, and each tool applies the same rules your app applies to them.
  • Scope by tenant. In a multi-company product, a tool must never be able to reach another company's data, whatever arguments the model sends.
  • Do not trust the model. It will sometimes pass an ID it should not know. The check belongs in your code.
  • Confirm before writing. Reads can be automatic. Anything that changes data should be reviewable, and destructive actions should need explicit confirmation.

5. Choose the transport

There are two ways a client connects:

  • Standard input and output. The client starts your server as a local process. Simple, and right for developer tools or anything that needs the user's own machine.
  • HTTP. The server runs remotely and clients connect over the network with sign-in. This is the right choice for a SaaS product, because customers should not have to install or run anything.

For a remote server, use the protocol's authorization flow so each user signs in to your product and the server receives a token scoped to them.

6. Return less

Large responses cost tokens, slow the assistant and hide the answer.

  • Return the fields that answer the question, not whole records.
  • Page long lists, and say how to get the next page.
  • Return errors the model can act on: "No lead matches that email. Try searching by phone number."

7. Test with real assistants

Unit tests tell you the tools work. They do not tell you whether a model will use them well.

  1. Use the MCP Inspector to check that the server lists its tools and that each one runs.
  2. Connect a real client, such as Claude, and ask the questions from step one in plain language.
  3. Watch which tools it picks. When it picks the wrong one, fix the name or the description, not the prompt.
  4. Try to misuse it: ask for another customer's data, or for a destructive action. The server should refuse.

8. Ship it and document it

  • Log every call: who, which tool, what input, how long, what came back.
  • Rate-limit per user.
  • Write a short setup page for customers, with three example prompts that show what the connection is for.
  • Version your tools. Changing a tool's meaning silently will break someone's workflow.

Mistakes worth avoiding

  • Mirroring the whole API instead of designing a small tool set
  • One service account for every user, instead of acting as the signed-in person
  • Returning entire records "in case the model needs them"
  • Write actions with no confirmation and no log
  • Testing only with code, never with an actual assistant

In FindRE the MCP server is a small set of permissioned tools over the CRM, so an assistant can work with leads and deals on request without direct database access. That is the whole idea: the assistant gets to be useful, and your product's rules still apply.

If you want this built for your product, it is what I do under MCP servers. If you are still working out the agent that will use it, start with how to build an AI agent.

Questions people ask

Straight answers. If yours is not here, ask me.

Ask me directlyI read and answer every message.

What is an MCP server?

An MCP server is a small service that exposes a product's data and actions to AI assistants through the Model Context Protocol, an open standard. It publishes tools, resources and prompts that any compatible assistant, such as Claude, can discover and use.

Is an MCP server the same as an API?

No. An API is written for programmers and tends to have many precise endpoints. An MCP server is written for a model, with a small number of well-described tools it chooses between in the moment. It usually sits on top of your existing API.

Should an MCP server run locally or remotely?

For a SaaS product, remotely over HTTP with proper sign-in, so customers connect without installing anything. Local servers over standard input and output suit developer tools and things that need access to the user's own machine.

Do I need an API before building an MCP server?

It helps, because the server can call it. It is not required: the MCP server can talk to a service layer over your database, as long as that layer enforces the same permissions as your app.

Where this comes from

MCP servers

Safe, permissioned tools that let Claude and other AI assistants work with your product’s data.

Case study

FindRE

Calls, texts, contracts, follow-ups and AI call summaries in one system, with an MCP server so AI assistants can work the pipeline.

More guides

Have a process eating your team’s time?

Tell me about it. I’ll tell you straight whether AI is the right answer.

You’ll talk to me directly.On the call and in every message.

Or email hello@abdurrehman.dev