Skip to main content

MCP & AI agents cheatsheet

A one-page reference for MCP and AI agents. For agent design patterns and safety/guardrail depth, see the complete guide.

๐Ÿ“– Full guide: MCP & AI Agents โ†’

Architecture: host, client, serverโ€‹

ComponentRole
Hostuser-facing AI app (Claude Code, an IDE, a custom agent) โ€” owns the conversation
Clientinside the host, 1:1 stateful connection to one MCP server
Serverexposes tools/resources/prompts over the protocol

One host commonly holds many client connections at once โ€” one per configured server.

What a server exposesโ€‹

PrimitiveWhat it is
Toolscallable functions with an input schema โ€” the LLM decides when to invoke
Resourcesread-only data, addressed like URIs (file://, postgres://)
Promptsreusable, parameterized prompt templates

Transportโ€‹

  • stdio โ€” server runs as a local subprocess (filesystem, git servers).
  • HTTP/SSE โ€” server runs remotely (hosted/shared servers).

Protocol is JSON-RPC 2.0-based, transport-independent.

Agents vs single-shot callsโ€‹

A single-shot LLM call answers once from its context. An agent loops: observe โ†’ decide โ†’ call a tool โ†’ observe the result โ†’ decide again โ€” until the task is done or it hits a stop condition.

Safety & guardrailsโ€‹

  • Scope tool permissions narrowly โ€” least privilege, same as any service credential.
  • Put a human-approval checkpoint before irreversible/production-impacting actions.
  • Read-only/investigative tasks: lower oversight. Anything that writes: explicit approval gate.

MCP vs plain function callingโ€‹

Plain tool/function calling is one host wiring its own tools by hand. MCP standardizes the protocol so any compliant host can talk to any compliant server โ€” write the server once, use it from every MCP-compatible client.

See: Safety & Guardrail Considerations