MCP Server Architecture for AI Agents
MCP is useful because it gives agents a cleaner way to reach tools and context.
It is not useful when teams treat it like magic.
An MCP server is still production software. It has auth, permissions, rate limits, logs, secrets, owners, failure modes, and deployment boundaries.
If an agent can use it, a human engineer needs to understand it.
The simple mental model#
Use MCP to separate agent reasoning from system access.
The agent should decide what it needs.
The MCP layer should decide what is allowed, what shape the data takes, what gets audited, and which calls require approval.
That separation matters because your agent prompt should not contain the messy rules for every internal system.
Split servers by risk, not by buzzword#
A weak design is one huge "company MCP" server.
A better design has smaller servers with clear ownership:
docs-mcp: runbooks, ADRs, product specs, support policies.repo-mcp: code search, pull request reads, CI status.ops-mcp: traces, logs, deploys, alerts, incidents.ticket-mcp: Jira, Linear, Zendesk, Intercom.billing-mcp: Stripe, plans, invoices, refund previews.browser-mcp: scoped browser actions and screenshots.
The point is not purity. The point is blast radius.
If billing tools are higher risk than docs resources, they should not live behind the same permission story.
Tools, resources, and prompts are different#
MCP gives you more than "tools."
Resources are context. Runbooks, schemas, customer policies, repo maps, incident timelines, OpenAPI specs.
Tools take action. Search code, create ticket, preview refund, run test, fetch trace, post Slack reply.
Prompts package repeatable behavior. Incident summary format, PR review rubric, support escalation policy, deployment checklist.
Model these separately. If you blur them, your agent will also blur them.
Approval belongs near the action#
Do not put all safety in the model prompt.
Approval should live close to the tool call:
- Read-only calls can run inside user scope.
- Write calls need explicit policy.
- Dangerous writes need human approval.
- Sensitive outputs need redaction.
- Every call needs an audit record.
That means the MCP server, or a policy gateway in front of it, should know which actions are safe.
What to log#
You do not need to log everything forever.
You do need enough to answer basic questions:
- Which agent called the tool?
- Which user or workspace authorized it?
- What resource did it access?
- Was the action read-only or mutating?
- Did a human approve it?
- What was returned to the model?
- What was redacted?
- Did the call fail, retry, or time out?
That is the difference between "the agent did something" and an actual production trace.
Deploy shape#
For most teams, I would start with this:
- Agent orchestrator calls MCP clients.
- MCP servers run as separate services or serverless routes.
- Secrets stay in a vault, not in prompts.
- Tool calls write to an audit log.
- Risky actions pause in an approval queue.
- Evals replay tool traces before release.
- Observability tracks tool latency, errors, and cost.
This is not heavyweight. It is the minimum shape that lets a team trust the workflow.
Why this matters now#
The MCP ecosystem is moving fast. The official MCP docs frame it as a standard for connecting AI apps to external systems like data sources, tools, and workflows. OpenAI's Agents SDK docs also point teams toward explicit control over tools, MCP servers, orchestration, state, and approvals.
That is the right direction.
But the standard does not remove the architecture work. It makes the architecture easier to express.
Build it in Codelit#
Try this:
Design MCP server architecture for a production AI agent. Include docs, repo, ops, ticket, billing, and browser MCP servers with tools, resources, prompts, auth scopes, approval policies, audit logs, evals, and deployment.
Map the MCP agent architecture
MCP is a connection layer. The workflow still needs engineering judgment.
Try these templates
Netflix Video Streaming Architecture
Global video streaming platform with adaptive bitrate, CDN distribution, and recommendation engine.
10 componentsSearch Engine Architecture
Web-scale search with crawling, indexing, ranking, and sub-second query serving.
8 componentsGoogle Search Engine Architecture
Web-scale search with crawling, indexing, PageRank, query processing, ads, and knowledge graph.
10 componentsContinue learning
Go deeper on AI agents and LLM systems
As an Amazon Associate I earn from qualifying purchases. Codelit may receive a commission at no extra cost to you.
AI Engineering
Chip Huyen · 2025
Book-length treatment of evals, prompts and deployment tradeoffs for foundation-model apps.
Designing Multi-Agent Systems
Victor Dibia · 2025
Six orchestration patterns plus ten documented failure modes, from an AutoGen core contributor.
4.8 (39)#6 in Machine TheoryBuilding Applications with AI Agents
Michael Albada · 2025
Architecture choices for single- vs multi-agent systems, with the research behind each pattern.
Enterprise Integration Patterns
Gregor Hohpe, Bobby Woolf · 2003
A catalog of 65 messaging patterns with diagrams - the vocabulary queue designs still use today.
4.6 (581)