AI Engineering Reference/MCP, Tools & Automation

MCP & Tool Use Protocol

Model Context Protocol architecture, tool schemas, stateless vs stateful servers, and the 2026-07-28 stateless RC — what changed and what endures.

4/5Overview: 35m

Why tools matter

An LLM without tools is a text generator. With tools, it becomes an agent that can:

  • Query your database ("how many failed orders today?")
  • Read Jira/Linear tickets
  • Run terminal commands (tests, builds, deploys)
  • Search the web for current docs
  • Create PRs, post Slack messages, update configs

Tool use is the bridge from "AI assistant" to "AI that does work."

Tool use fundamentals

All major providers implement the same pattern:

1. Define tools with JSON Schema (name, description, parameters) 2. Send tools list with prompt 3. Model returns tool_call (name + arguments) instead of text 4. Your code executes the tool 5. Send tool result back to model 6. Model continues (more tool calls or final answer)

The model chooses which tool to call based on descriptions. Bad descriptions = wrong tool selection.

{ "name": "search_codebase", "description": "Search the repository for code matching a query. Use for finding implementations, not for reading a specific file.", "parameters": { "query": { "type": "string", "description": "Search terms" }, "max_results": { "type": "integer", "default": 5 } } }

Description quality is prompt engineering for tools. Be explicit about when to use and when NOT to use each tool.

Model Context Protocol (MCP)

MCP is an open standard (Anthropic, adopted broadly) for connecting AI clients to external data and tools via servers:

AI Client (Cursor, Claude Desktop) ←→ MCP Server ←→ Your System (DB, API, filesystem)
MCP primitivePurposeExample
ToolsActions the model can invokerun_query, create_ticket, deploy
ResourcesRead-only data the model can fetchfile://config.yaml, db://schema
PromptsPre-built prompt templates"Review this PR" with injected context

Transports

TransportHowUse case
stdioLocal process, stdin/stdoutIDE integrations, local dev tools
SSE/HTTPRemote server, event streamShared team servers, cloud services

Cursor supports both. Most IDE setups use stdio for local servers.

Stateless RC (2026-07-28): what changed

The July 2026 MCP release candidate introduces stateless server mode:

  • Before: MCP servers could hold session state between tool calls (connection-scoped)
  • After (RC): Servers can declare themselves stateless — each tool call is independent, no session affinity required

What this means for engineers:

ImpactDetail
Simpler deploymentStateless servers scale horizontally; no sticky sessions
Cloud-friendlyMCP servers can run as serverless functions or k8s pods
Less magicEach call must carry all needed context; no "remember what I said last call"
Durable conceptTool design should be stateless anyway — session state was always fragile

Don't over-index on the RC details. The durable lesson: design tools as idempotent, self-contained operations with explicit parameters. Whether the server is stateful or stateless, your tools should work the same way.

Tool design principles

PrincipleWhy
Idempotent when possibleAgent may retry; get_user(id) not increment_counter()
Narrow scopeOne tool = one action. Not manage_database
Explicit parametersNo implicit state; everything the tool needs is in the call
Safe defaultsRead-only by default; write operations require confirmation
Descriptive errorsReturn actionable error messages the model can act on
Rate limitAgent loops can hammer APIs; add backoff

Security model

MCP servers run with your credentials. The agent inherits whatever the server can access:

  • Scope API keys minimally (read-only DB user for query tools)
  • Never expose prod write access without human approval gate
  • Audit tool calls (log who/what/when)
  • Validate tool arguments server-side — don't trust the model's JSON

Parallel tool calls

Modern models can request multiple tools in one turn:

User: "What's the error rate and who is on call?" Model: [call metrics_api, call pagerduty_api] in parallel

Design tools to be independently callable. Avoid tools that depend on side effects from a prior call in the same turn.

Interview framing

"MCP standardizes how AI clients connect to external tools via a client-server protocol. I design tools as narrow, idempotent operations with explicit schemas. The stateless RC direction reinforces what was already best practice: tools carry their own context, no hidden session state."

Senior signal: Draw the MCP client-server diagram. Explain why tool descriptions matter as much as tool implementations. Mention credential scoping and audit logging.

Further Reading

Hands-On Tasks (Optional)

Practical exercises — prompt drills, local MCP servers, or workflow design on paper. The goal is professional fluency, not model training.

  • Audit your MCP server inventory

    List every MCP server configured in your IDE/team. For each: what tools does it expose? What credentials does it need? What could go wrong if the agent calls it incorrectly? Document one improvement.

    20m