Skip to content

Notes on building

How to build an MCP server for your app

This is the plain-English version: what an MCP server is, what goes inside one, how an AI assistant connects to it, the order I would build it in, and the places it usually goes wrong. There is no code on this page. Read it before you open an editor and the code part gets a lot shorter.

It is written against the current Model Context Protocol specification, the revision dated July 28, 2026.

Start here

What is an MCP server?

MCP stands for Model Context Protocol. It is an open standard that lets an AI assistant use software it was never built to know about.

Anthropic introduced MCP in November 2024, and since December 2025 it has been run by the Agentic AI Foundation under the Linux Foundation, so no single company owns it. Claude, ChatGPT, Cursor and VS Code all speak it, along with a long list of other AI apps.

There are three pieces to keep straight. The host is the AI app a person is using. The client is the connector inside that app. The server is the small program you write that sits beside your software and speaks the protocol. The assistant asks your server what it offers, gets back a list described in plain language, and from then on your app is one of the tools it knows how to use.

The value is in the agreement. Before a shared protocol, every assistant needed its own custom wiring into every piece of software. Now you write the server once, and every AI app that speaks MCP can use your software, including the ones nobody has built yet.

The parts

What can an MCP server expose?

Everything a server offers falls into one of three kinds. Knowing which one you are building keeps the design honest.

Tools: things the assistant can do

Actions like create the invoice, search the archive or restart the render. Each tool has a name, a description, and a list of the inputs it needs (written as a JSON Schema), and it can also describe the format of what it returns. The assistant decides when to use a tool, and the specification says the AI app should keep a person in the loop who can say no. This is where most of the work lives.

Resources: things the assistant can read

A file, a record, a job status, the contents of a project, each with its own address. The AI app decides when to bring a resource into the conversation as context, rather than the assistant acting on it. Anything the assistant should know before it decides anything belongs here.

Prompts: shortcuts the person picks

Prepared instructions your app offers by name, often shown as slash commands, so someone chooses “draft the follow-up” from a menu instead of describing it from scratch every time.

The connection

How does an AI assistant connect to an MCP server?

Two standard ways, and the choice decides how much security work you take on.

On the same computer

The AI app starts your server as a small background program and talks to it directly. The specification calls this the stdio transport. Your server reads any keys it needs from its own environment, and nothing is exposed to the internet. Almost every first version should start here.

Over the internet

Your server runs as a hosted service with one web address, and every message is a request to it. This is the Streamable HTTP transport. If it needs to know who is asking, the specification uses OAuth 2.1, the same kind of sign-in flow you see when an app asks to connect to your Google account. More reach, and real security work.

No memory between calls

As of the July 2026 revision, MCP keeps no connection-level session. If your tools need to remember something from one call to the next, like an open cart or a draft in progress, hand back an ID and have the next tool call pass it in.

The order I would build it in

How do you build an MCP server, step by step?

The failure mode here is ambition. Five good tools will outperform fifty that nobody can choose between.

1. Pick the boring five

Write down what someone actually does in your app every week and take the top five. That is version one, and it is enough to tell you whether the idea works at all.

2. Use an official SDK

You do not write the protocol by hand. There are official kits for TypeScript, Python, C#, Go, Rust and Ruby, plus Java, Swift, PHP and Kotlin. Pick the language your app already uses.

3. Solve the credentials first

Your server is a client of your own application, so it needs whatever the app needs: a key, a login, a database connection, a folder on disk. Sort that out before you write a single tool, because everything after it depends on it.

4. Write the descriptions like a briefing

A tool’s description is the only thing the assistant reads when it decides what to call, so write it for a sharp new hire on their first day: what the tool does, when to use it, what it returns, and what it will not do.

5. Return something a reader can use

The result is read by a language model, so give it language. Names next to the ID numbers, dates written out. When something fails, mark the result as an error and say in a sentence what went wrong and what to try instead, so the assistant can correct itself rather than guess.

6. Test it, then watch a real assistant use it

The MCP Inspector, the project’s own testing tool, shows you exactly what your server offers and returns. Then connect it to a real assistant and ask for real work. It will pick the wrong tool, invent an input, or loop on an error it cannot read, and most of the time the fix is a sentence you rewrite, not a bug in your code.

7. Widen on evidence

Add the sixth tool when you have watched someone want it. Tools are cheap to add and expensive to live with, because each one makes the choice harder for every request that follows.

Where it goes wrong

What are the most common MCP server mistakes?

One

Too many tools

Forty tools with overlapping names and the assistant stalls, picks the nearly-right one, and does nearly the right thing. Fewer tools with sharper edges work better than complete coverage.

Two

Failing without saying so

A tool that returns an empty result when something went wrong leaves the assistant reporting success it has no evidence for. Flag the error and say what failed, in words, and it will tell the person instead of covering for you.

Three

No brakes on risky actions

Anything that deletes, sends, charges or publishes needs a confirmation the model cannot give itself. The specification expects the AI app to ask the person, and your server should still check before it does anything you cannot undo.

The usual question

Do I need an MCP server, or is my API enough?

An API is built for programmers who read your documentation and write code against it. An MCP server is built for an AI assistant that reads your descriptions at the moment it needs them and decides on its own what to call. Most MCP servers are a thin layer over an API that already exists, translating a long list of endpoints into a handful of well-described tools.

If people already ask an AI assistant to do things in your app, or you want them to, you need the server. The API alone leaves the assistant guessing.

What you get

What changes once your app has an MCP server?

The work moves to wherever the person already is. They ask for the thing in the same window where they are thinking about it, and your software answers. Nobody opens a tab, nobody learns a menu, and the features you spent a year building finally get used by the people who never found them.

That is the whole pitch. The build is a week of wiring and a month of rewriting descriptions until the assistant stops guessing.