Skip to main content
AI Agent Delivery

Building AI Agents with the Model Context Protocol (MCP): A Production Guide

How to build AI agents on the Model Context Protocol: what MCP does and does not do, server boundaries, small toolsets, logging, human review and security.

By May 27, 20266 min readUpdated October 31, 2026
Building AI Agents with the Model Context Protocol (MCP): A Production Guide
Article focusMCP standardises how an agent reaches tools and data, not what it should be allowed to do. Narrow servers, small toolsets, traces and a review queue do that part.

Building an AI agent on the Model Context Protocol (MCP) means exposing the systems the agent needs as MCP servers and letting the agent call them through an MCP client. MCP standardises the connection, not the judgment: you still decide which actions the agent may take, which need a person's approval, and how the workflow recovers when a tool call fails.

A prompt-only assistant can answer questions; an operational agent has to act. It reads from a warehouse, inspects job logs, creates a ticket, drafts a reply or triggers a workflow, and every new capability adds a new way to fail. This guide covers what MCP gives you, the production architecture, lessons from an agent we built with more than 70 MCP integrations, a six-step build and where human review belongs.

What MCP gives you, and what it does not

MCP is an open protocol, introduced by Anthropic in November 2024, for connecting AI applications to tools and data. The official documentation describes three roles: the host application, the MCP client inside it, and MCP servers that expose capabilities. A server offers three kinds of thing:

  • Tools: actions the model can call, each with a name, a description and an input schema
  • Resources: data the application can read, such as files, records or query results
  • Prompts: reusable templates a user or application can invoke

Local servers usually talk over standard input and output, remote servers over HTTP, and the specification defines an OAuth-based authorization flow for remote servers. Agent frameworks have adopted it widely; the OpenAI Agents SDK and Microsoft's Azure guidance both document MCP support.

What MCP does not give you matters as much. It is an integration protocol, not an agent framework: orchestration, memory, routing, evaluation, permission policy and human review are still yours to design. MCP makes tool access explicit, which is a good start, but an explicit tool can still be the wrong tool to give an agent.

The production architecture

MCP production architecture showing agent app, client, server, tools, logs, and review queue.
Figure 1. A production MCP agent separates reasoning, tool access, system execution and review.

A production MCP agent has five parts, and each one fails in its own way:

  1. The agent application, where orchestration lives: which agent handles a request, how many steps it may take, when it stops.
  2. The MCP client, which discovers servers and passes tool calls and results back and forth.
  3. MCP servers, one per system boundary, each holding only the credentials that system needs.
  4. Logs and traces of every tool call, its input, its output and the model's next decision.
  5. A review queue for the actions a person must approve, with enough context to decide.

Lessons from an agent with more than 70 MCP integrations

alice/ai is an AI operating system for small businesses that we built: the owner sets the direction and specialist agents do the work across the tools the business already runs on. A LangGraph Supervisor routes each request to specialised sub-agents over more than 70 MCP tool integrations, including connections to Cliniko and Nookal that bring healthcare practice-management records and scheduling into the same assistant. Three lessons from it apply to most MCP projects.

Do not hand one agent every tool. The supervisor routes to specialised sub-agents, so each agent chooses from a short, relevant toolset even as integrations pass 70. Tool selection degrades as the list grows: descriptions start to overlap, and the model calls the plausible tool instead of the right one. Routing first, then a small toolset per agent, keeps tool calls accurate.

Treat each server as an integration boundary. A server is where a system's credentials, rate limits, error handling and data shape are decided. In a multi-tenant product, sign-in (AWS Cognito in alice/ai) has to carry the tenant into every call, so a tool can only ever reach the current tenant's data.

Trace every run. alice/ai traces agent runs in LangSmith. When an answer is wrong, the trace shows which tool was called, with which input, and what came back, which turns a vague complaint into a specific fix.

Build an MCP agent in six steps

Six-step MCP agent build workflow from defining actions to testing unsafe requests.
Figure 2. A reliable MCP agent starts from the workflow and ends with failure testing.
  1. Define the workflow and the allowed actions. Write down the job, the systems involved, what the agent may read, what it may change and what always needs approval.
  2. Choose the system boundaries. One server per system (the warehouse, the ticketing tool, the CRM) keeps credentials and failure handling separate.
  3. Pick the build pattern.
OptionUse it whenWatch out for
An existing MCP serverA maintained server already covers the system and its scopes fit your needsReview its code and permissions; pin the version you tested
A custom MCP serverThe agent needs internal systems, proprietary data or business rulesYou own its auth, tests, rate limits and upkeep
Direct function calls, no MCPOne agent, one or two tools, no plan to reuse themIntegrations get rebuilt each time another agent needs them
  1. Expose the smallest useful tool set. Separate read tools from write tools, give each a precise name and description, and validate inputs with a strict schema. A tool called update_record that accepts anything is an incident waiting to happen; set_ticket_priority with an enum is not.
  2. Add logging, permissions and review. Log every call with its input and output, give each server a least-privilege credential, and route sensitive tools through the review queue.
  3. Test normal, ambiguous and unsafe requests. Include requests the agent should refuse, tool errors, slow responses and tool outputs that contain instructions, because content a tool returns is untrusted input.

Decide what needs a person's approval

Risk ladder for MCP agent actions showing when human review should be required.
Figure 3. Review gates rise with an action's impact, irreversibility and visibility.

Review effort should follow risk, not novelty:

  • Read-only lookups run without review, with logging.
  • Drafts (a reply, a summary, a proposed change) get sample-based review, more often at first.
  • Reversible writes run automatically, and exceptions go to a person.
  • Irreversible, expensive or customer-visible actions (sending a message, moving money, deleting data) wait for approval before they run.

Also escalate when tool outputs conflict, data looks stale or the agent's confidence is low. Our AI agent ops and human escalation playbook covers how to design that queue, and designing AI agents with human review loops goes deeper into the review step itself.

Security notes specific to MCP

  • Tool descriptions and outputs are untrusted. A malicious server or a poisoned document can carry instructions; never let tool output change what the agent is allowed to do.
  • Vet third-party servers. Read the code, check the scopes it requests and pin the version you reviewed.
  • One credential per server, least privilege. If an agent must never delete records, its server should not hold a credential that can.
  • Use OAuth for remote servers, as the specification describes, rather than long-lived shared keys.
  • Keep a human in front of sensitive tools, and log enough to reconstruct every action afterwards.

Common mistakes

  • Treating MCP as the whole agent architecture instead of its integration layer.
  • Giving one agent dozens of tools instead of routing to agents with small toolsets.
  • Combining read and write in one broad tool.
  • Logging only the final answer, not the tool calls behind it.
  • Shipping without testing unsafe requests and hostile tool output.
  • Adding human review after the first bad action instead of designing it in.

Where to start

Pick one workflow with clear value and contained risk, wrap the two or three systems it needs as narrow MCP servers, and ship it with logging and a review queue from the first day. Widen the agent's reach only when the traces show it choosing tools correctly. That is the order our AI agent development projects follow, and when something does go wrong, our AI agent incident response playbook picks up from there.

Van Data Team in practice

How do we build a production AI agent on Model Context Protocol (MCP) with safe tool access?

A production MCP agent needs scoped MCP servers around each internal system, plus orchestration, permissions, logging and human review for risky actions. We wrap your APIs and data sources as MCP servers with narrow permissions, separate retrieval, action and review steps, and log every tool call, input, output and model decision. Irreversible, customer-visible or low-confidence actions go to a human reviewer, with a recovery path when a tool fails.

Tran Tien Van
Tran Tien Van

Founder of Van Data Team. Builds Vanaxity, the AI agent system for SEO, GEO, and AEO, and leads data engineering delivery for B2B teams.

About the author

Article FAQ

Questions readers usually ask next.

These short answers clarify the practical follow-up questions that often come after the main article.

Share this

Need a similar system?

If this article maps to a workflow your team already operates, the next step is usually a scoped review of the system, constraints, and rollout path.

Consultation

Scope your next AI workflow.

Share the system and blockers. We will map fit, gaps, and the next step.

We use these details only to reply about your project. See our privacy policy.