Build an MCP server people actually use
MCP is an interface, not a product. These are the parts I usually build, and the traps that decide whether the server gets used or stays in a folder.
What MCP solves
Model Context Protocol is a way to describe tools and data to an AI client. The server says which tools exist, what input they take and what they return. The client, such as Claude Desktop, an IDE or your own agent, then decides when to use the tool.
That sounds like an API, and it is: an API with a shared description that an AI client understands. The value does not come from the protocol itself. It comes from the same tools being usable from several clients without someone writing a new integration every time.
When it is worth building
Build an MCP server when a capability will be reused. It might be reading orders, searching internal documents, looking up a customer or creating a ticket. If one app will call one endpoint, a normal function is simpler.
It also helps when permissions and traceability need to sit in one place. The server can then decide what the user may do, whichever AI client is asking.
- The same tools are needed in several AI clients or teams.
- Data sits in internal systems without a good AI interface.
- You want permissions, logging and approvals controlled centrally.
- You want to change model or client without rebuilding the integration.
A server in three parts
I always start with a small surface: one read tool, a clear description and an error message a person can understand. Write tools come only after the read flow works and someone actually uses it.
Here is a minimal TypeScript server. It exposes one tool for reading an order. The SDK version may differ, so always check the documentation for the version you install.
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
import { z } from 'zod';
const server = new McpServer({
name: 'orders',
version: '1.0.0',
});
server.registerTool(
'get_order',
{
description: 'Read one order by id. Returns status, customer and lines.',
inputSchema: {
orderId: z.string().describe('Order id, for example ORD-1042'),
},
},
async ({ orderId }) => {
const order = await orders.find(orderId);
if (!order) {
return {
isError: true,
content: [{ type: 'text', text: 'No order with id ' + orderId }],
};
}
return {
content: [{ type: 'text', text: JSON.stringify(order) }],
};
},
);
await server.connect(new StdioServerTransport());Describe the tool for the model
The model does not see your database. It sees a name, a description and a schema. A tool called `get_data` that takes a free string is almost impossible to use correctly. A tool called `get_order` that takes `orderId` with an example is easier.
Write the description like an instruction to a new colleague: what the tool does, when to use it and what it does not do. Return a clear error rather than an empty string. Then the model can back off and ask the user instead of making something up.
Permissions, approval and logs
An MCP server is a new path into your systems. Treat it like any other integration. Authenticate the call, check permission on the server and log who did what. Never trust the client to send the right user id.
For write tools I usually require explicit approval before anything is sent, booked or paid. It can be a confirmation in the client or a separate step in the server. A tool that sends an email is not a read tool with a different name.
- Read tools can be more open than write tools.
- Write tools should be idempotent or require a unique key.
- Log the tool name, parameters without sensitive values and result status.
- Set limits for size, timeout and number of calls.
Test and deploy
Test the server with real questions, not just a call that returns 200. Ask a client to solve the same task a user would. Then ask what happened when the tool had no data or responded slowly.
For local development, stdio is simplest. For a server several people need to reach, I use HTTP with authentication and a clear limit on which tools are public. Log the server version with every call, so it is possible to understand what changed.
- Run the server locally and connect a client.
- Test a successful call, an empty response and an error.
- Test with a user who lacks permission.
- Set up logging and a basic alert before more people start using it.
What I would build first
Start with the most boring tool that saves the most time: read an order, look up an article or fetch a customer’s latest ticket. Measure how often it is used and where it fails. Expand when someone is missing a capability, not because the protocol makes it possible.
A small MCP server that solves a real problem is worth more than ten tools that exist only to make the demo look big.
Related services
Read next
Questions and answers
Do I need an MCP server to use AI in my system?
No. If one app will call one endpoint, a normal function is enough. MCP is worth it when the same capability will be used from several AI clients, or when permissions and logging need to live in one place.
Should the server run locally or in the cloud?
Start locally with stdio if you are developing alone. If several people or clients need to reach it, you need a hosting environment with authentication, logging and a clear limit on which tools can be called.
How do I stop the AI from doing the wrong thing?
Limit the tools, check permissions on the server and require approval for write steps. Log the calls and test both successful and failed flows before more people use the server.