Most “how to build an MCP server” content is written for developers who want a coding tutorial. This chapter is written for the person who needs to understand what the build actually involves – so they can scope it, commission it intelligently, and evaluate whether the result is any good. You do not need to write a line of code to get value here.
Before you build: should you?
The first question is not how to build. It is whether to build at all.
Chapter 7 covers the build-vs-buy decision in full, but the short version is this: if an MCP server already exists for the system you want to connect, use it. The official MCP ecosystem includes ready-made servers for many common business tools – Slack, GitHub, Notion, Google Drive, and others. If your need is connecting a mainstream tool to an AI agent, the work may already be done. Check before commissioning a build.
The case for building your own server is specific. You should build when the system you want to connect is proprietary – your own product, your internal platform, a custom-built database, a bespoke workflow engine. You should build when an off-the-shelf server exists but does not implement the specific tools or permissions model your business requires. And you should build when the connection itself represents a competitive edge – when the way your AI agent accesses your data is part of what makes the capability distinctive.
Building for the sake of building is an expensive mistake. If the underlying system is generic and a maintained open-source server already wraps it, your engineering effort is better spent elsewhere.
The most important step: scoping from jobs, not APIs
Assuming you have decided to build, the most expensive mistake is scoping the server from the system’s full API rather than from the jobs the AI should actually do.
Every serious enterprise system has a rich API. CRMs expose hundreds of endpoints. ERPs expose thousands. If you ask a developer to “build an MCP server for our CRM,” and they treat that as “wrap the CRM API,” you will end up with a server that exposes far more capability than the AI agent needs, creates a sprawling security surface, and is hard to audit. This is exactly what you do not want.
The right starting point is a list of specific jobs. What should the AI agent be able to do? “Look up a customer’s contract status.” “Check whether a support ticket is open or resolved.” “Draft a renewal notice using the customer’s current plan details.” Each job maps to a small, named set of tools and resources. That list – the jobs-to-be-done – is your specification. Everything in the server should trace back to it. Everything that does not trace back to it should not be in the server.
This scoping work is also your security model. When you define precisely what the server can do, you are implicitly defining what it cannot do. An AI agent with access to a customer-lookup tool cannot modify contract terms, delete records, or access other customers’ data – not because you hope it will behave, but because the server does not expose those capabilities. Permissions are structural, not behavioral. This principle was covered in detail in Chapter 8; it applies at the scoping stage before a line of code is written.
An illustration: a 300-person property management company wanted an AI agent to help their leasing staff. Their property management system had a rich API covering everything from maintenance scheduling to financial reporting. The scoping conversation produced a list of eight specific jobs – checking unit availability, looking up tenant lease terms, retrieving maintenance request status, and so on. The MCP server was built to support those eight jobs and nothing else. When a leasing agent’s AI assistant pulled tenant data, it could retrieve lease terms. It could not modify them, could not access financial records, and could not look up tenants for other properties the agent was not assigned to. That constraint was structural. It was built in from day one because the scope defined it.
The anatomy of the build, in plain terms
For readers who want a clear picture of what building an MCP server actually involves, here is the shape of the work without the code.
Identify the systems to connect. These are the data sources and services the AI agent will need to reach. Each one is a target for integration work. Some will have clean APIs; some will require database queries; some will need custom middleware. Knowing this upfront prevents scope surprises.
Define tools, resources, and prompts. These are the three building blocks of MCP, covered in Chapter 4. Tools are actions the AI can invoke – think of them as functions the server makes available. Resources are data the AI can read – structured information the agent pulls in to answer a question. Prompts are pre-built instruction patterns you make available to the host application. Most business MCP servers are heavy on tools and resources, light on prompts. Each tool and resource needs a name and a plain-language description – the AI reads these descriptions to decide what to use and when, so they matter more than most engineers initially expect.
Choose local or remote deployment. Chapter 10 covers this in depth. For anything team-wide or production-grade, you need a remote server – a hosted service rather than something running on one developer’s laptop. The deployment environment affects the authentication approach, the infrastructure requirements, and the operational overhead.
Wire up authentication and permissions. The server needs to authenticate both inbound (verifying that only authorized AI hosts can call it) and outbound (connecting to the underlying systems with credentials scoped to what the server needs and nothing more). OAuth 2.1 is the standard for the MCP authentication layer; Chapter 8 goes into the specifics. At the application level, role-based access controls ensure that a customer service agent’s AI tools do not expose data reserved for finance teams.
Add logging. Every tool call and every result should be logged. This is not optional. Auditability is part of what makes an MCP server enterprise-ready, and it is far easier to build in from the start than to retrofit later.
Tooling reality: you are not writing the protocol from scratch
A practical note for anyone briefing a vendor or supervising a development team: nobody should be implementing the MCP protocol from scratch. Official SDKs exist in Python, TypeScript, Java, Kotlin, Swift, Ruby (promoted to the top support tier on 30 October 2026), and other languages. They handle the protocol plumbing – the message format, the transport layer, the capability negotiation – so the development work is almost entirely about the integration and the guardrails, not the communication protocol itself.
If a vendor quotes you a build timeline that seems to imply they are implementing the protocol, ask directly whether they are using an official SDK. The answer should be yes. Building from scratch would be like writing your own HTTPS library before building a web application – technically possible, inadvisable, and a red flag about how the team approaches complexity.
The genuine engineering work is in three places: the integration with your specific backend systems (which may have quirks, authentication requirements, and data structures that take real time to understand); the tool definitions and descriptions (which require domain knowledge and iteration); and the security and permissions model (which requires deliberate design, not just implementation). These are where the hours go, and they are where the budget should go.
A phased build plan you can actually use
I recommend a phased approach because it surfaces real problems early and avoids the trap of building something elaborate that nobody uses.
Phase 1 – Prototype one tool. Pick the single highest-value job from your scoped list. Build the minimum server that delivers that one tool. Connect it to a real AI host – Claude Desktop, a local Claude Code session, or a similar client. Use it. The goal of this phase is to find out where your assumptions were wrong before you have committed to the full build. Budget: days, not weeks.
Phase 2 – Test with a real host and real data. Expand the prototype to a small group of internal users with access to production data (or a staging environment that closely mirrors it). Watch how the AI uses the tools. Read the logs. You will almost certainly find that some tool descriptions need rewriting, some tools are not being used the way you expected, and at least one job on your list is more complex than it appeared.
Phase 3 – Add authentication and logging. Make the server production-grade. Implement proper auth on the inbound side. Scope the credentials on the outbound side. Stand up logging to whatever observability infrastructure you use. If you are deploying to a regulated environment, this is also the phase where you wire into your audit logging system.
Phase 4 – Security review. Before any broad rollout, the server should be reviewed for the standard MCP-specific risks: prompt injection exposure (are tool descriptions or returned data crafted in ways that could manipulate the AI host’s behavior?), overpermissioned credentials, sensitive data in error messages, missing rate limiting. Chapter 8 has the full checklist. This review does not need to be a six-week engagement – a focused two-to-four day review by someone who understands the protocol is usually sufficient for a single-purpose server.
Phase 5 – Pilot with a defined user group. Roll out to a specific team or use case. Collect structured feedback. Identify gaps in the tool set versus the actual jobs users are trying to do.
Phase 6 – Harden and document. Fix the gaps the pilot revealed. Write documentation – both technical documentation for whoever maintains the server, and user-facing guidance on what the AI agent can and cannot do. The latter matters more than most teams expect: users who do not understand the server’s scope will try things it cannot do, blame the AI when they fail, and underuse the capabilities it does have.
How to know the result is actually good
If you have commissioned this work or are reviewing it before sign-off, here is a practical checklist.
The server’s permissions are scoped to what the spec required, not the system’s full API. If the developer says “I exposed the full API surface to make it flexible,” that is a problem, not a feature.
Every tool has a clear, plain-language description. Ask a non-technical colleague to read the descriptions and tell you what they think each tool does. If they cannot, the AI will also struggle to use the tools correctly.
Error handling is explicit. If an underlying system call fails, the server returns a meaningful error rather than crashing silently or, worse, returning a partial result that looks valid. Ask the developer to demonstrate what happens when the database is unavailable.
The server works across more than one AI host. If it only works in one specific client, you have built something fragile. Test against at least two compliant hosts. This also validates that the implementation actually follows the protocol standard rather than relying on undocumented behavior of a single client.
Logging is live and reviewable. Ask to see a sample of the logs from a test session. They should show which tools were called, when, by whom (or by which AI session), and what was returned.
Documentation exists. Not just for the server itself but for what it can and cannot do. If the documentation does not exist, the server is not done regardless of whether the code works.
What to put in a brief if you are commissioning the build
If you are hiring a contractor or engaging a vendor, a clear brief will save weeks of back-and-forth and significantly reduce the risk of receiving something that does not meet your requirements. Here is a structure that works.
Systems to connect. Each backend system by name, with its access mechanism (REST API, direct database access, vendor SDK) and any known constraints.
Jobs the AI agent should be able to do. Plain-language statements, not technical requirements. “Look up whether a customer’s invoice is overdue” is more useful than “implement a GET on the /invoices endpoint.”
What the server must NOT be able to do. As important as the capability list. Name the capabilities that exist in the underlying systems but are explicitly out of scope.
Deployment target. Where will this run – your cloud VPC, a managed container service, on-premise? This affects infrastructure requirements and the operational model.
Authentication requirements. What auth does the underlying system use? What do you require on the inbound side? Any SSO or directory integration?
Compliance and audit requirements. If you are in a regulated industry, name the relevant frameworks and the specific logging requirements that come with them.
AI hosts to support. The specific AI clients or platforms the server must work with. This determines which transport mechanisms and auth flows to implement.
Acceptance criteria. How will you decide the build is done? State this upfront: functional criteria (tools exist and work), non-functional criteria (logging live, auth implemented, security review passed), and usability criteria (a pilot group has used it successfully).
A brief built from this structure gives a competent developer everything they need to estimate accurately and deliver something reviewable.
A note on real-world reference material
One advantage of MCP being an open standard is that real production servers are public and can be studied. Open-source MCP servers that are in active use – handling real API integrations, real authentication flows, and real permission models – are worth examining before you write your brief or review your contractor’s work. They show you what a production-grade server actually looks like versus a tutorial example.
As one public example: the @ethora/mcp-server package on npm is an open-source server that wraps the Ethora chat and AI platform’s API. It covers messaging, user management, file handling, and AI bot controls across more than 100 tools, with documentation, versioning, and the kind of tool descriptions that have been iterated on through real use. It is worth a read not as a product recommendation but as a concrete example of how a production MCP server is structured and documented.
The broader lesson is that reference material exists. Use it.
What this means for you
Scope the server from jobs-to-be-done, not from the underlying system’s API surface. That list of jobs is your specification and your security model simultaneously. Do not skip this step even if it feels like it is slowing down the build.
Prototype one tool before building the full server. The things you learn in the prototype phase are exactly the things that would have cost you significantly more to uncover after a full build.
Do not skip the security review before broad rollout. It does not need to be expensive or lengthy, but it does need to happen. A MCP server that is not reviewed is a server with unknown exposure.
If you are commissioning this work, write a brief that includes what the server must not do. That constraint is as important as the capability list.
Chapter 12 covers rolling out MCP across your organization – how to sequence adoption, manage change, and avoid the failure patterns that derail enterprise AI deployments.
If you are at the stage of commissioning a build and want to talk through the scope with someone who has built MCP servers for production use, the resources at ethora.com and agrus.ai may be useful starting points.
Previous: Chapter 10: Data Ownership, Self-Hosting, and Private Deployment | Contents | Next: Chapter 12: Rolling Out MCP Across Your Organization