What is an MCP server? An MCP server is a process that speaks the Model Context Protocol and exposes a curated set of tools, resources, and prompts to an MCP client. The model never “owns” your APIs directly—the server is the adapter that turns business systems into typed, discoverable capabilities the agent can call under host policy.
If you only remember one engineering truth: the server sits on the trust boundary. Every tool it registers is a potential blast radius. Shipping a useful MCP server is less about wrapping one HTTP call and more about schemas, transport choice, auth, logging, and a deny-by-default posture that still lets the agent finish real work.
Where the server sits in the MCP stack
MCP separates three roles. The MCP host is the product experience (Cursor, Claude Desktop, or your own agent runtime) that owns UX, identity, and policy. Inside the host, an MCP client opens sessions to one or more servers, lists capabilities, and invokes tools. The server is the process on the other side of that session: it advertises what it can do and executes approved calls against databases, ticketing systems, file trees, browsers, or internal APIs.
That split is why MCP beat ad-hoc function-calling glue for many teams. Hosts stay interchangeable; servers stay reusable. An agent still needs a goal and a loop—see what is an AI agent—but the server is how you productize the tool surface without rewriting integrations for every IDE.
What an MCP server actually exposes
Most production servers lean on three primitive kinds:
- Tools — callable operations with JSON schemas for arguments and structured results (create ticket, query metrics, open PR).
- Resources — addressable read surfaces (docs, configs, ticket threads) the model can fetch without inventing a bespoke “get” tool every time.
- Prompts — reusable prompt templates the host can surface so operators get consistent starting points for a job type.
Tools do the mutating work; resources reduce hallucination by giving the model grounded text; prompts encode playbook shape. Skills such as SKILL.md sit adjacent: they teach the agent how to use those tools for a workflow, while the server remains the authority on what is executable.
stdio vs HTTP: picking a transport
| Transport | Best for | Ops shape | Watch-outs |
|---|---|---|---|
| stdio / local process | IDE plugins, laptop sandboxes, single-user tools | Host spawns the process; JSON-RPC over stdin/stdout | Credential scope = developer machine; hard to share across a team fleet |
| HTTP (streamable / SSE patterns) | Shared team servers, remote data planes, multi-host use | Deployed service with authn/z and network policy | Larger attack surface; needs TLS, tokens, rate limits, audit |
Local stdio is perfect for “this developer’s repo indexer” or a thin wrapper around a CLI you already trust. HTTP (or equivalent remote transports) is what you need when many hosts must hit one governed tool plane. Do not expose a laptop stdio server to the public internet with a tunnel and call it “done”—that is a credential leak with extra steps.
Implementation shape that holds up
A maintainable MCP server looks like a small product, not a weekend script:
- Thin protocol layer — speak MCP cleanly; keep business logic out of framing code.
- Explicit tool registry — each tool name, description, input schema, and risk tier documented in one place.
- Backend clients — official SDKs for Jira, Postgres, GitHub, etc., with timeouts and retries that are agent-safe (no silent infinite loops).
- Auth injection — per-user or per-tenant credentials from the host/session, not a shared god key in the process env forever.
- Structured results — return machine-usable JSON plus a short human summary; dump less raw HTML into the model context.
- Observability — correlate request IDs from host → client → server → backend.
If you are starting from zero, follow a guided build path such as build your first MCP server, then harden it with the practices in MCP security before anyone points a write tool at production.
Trust, supply chain, and “community” servers
Installing an MCP server is equivalent to installing software that can act with whatever credentials you hand it. Treat third-party servers like dependencies: pin versions, read the tool list, prefer signed or reviewed packages, and run unknown servers in a locked-down environment with read-only credentials first.
Supply-chain risk is not theoretical. A malicious or compromised server can exfiltrate tokens, rewrite files the host allows, or social-engineer the model with deceptive tool descriptions. Your allowlist should be at the tool grain when possible, not “whatever this npm package registered today.” Pair that with least-privilege AI tools so even a buggy server cannot delete the warehouse.
Security controls you should require
- Separate read tools from write tools; gate writes behind host approval or a secondary confirmation tool.
- Scope credentials to the minimum API permissions; rotate them; never log secrets in tool results.
- Validate and canonicalize inputs—path traversal and SQL injection still exist when an LLM invents arguments.
- Cap payload sizes and rate-limit calls so a looping agent cannot DoS your backend.
- Emit audit events for every mutating call: who, which tool, which resource IDs, success/deny.
- Fail closed when auth is missing; do not silently fall back to a broad service account.
Host policy cannot save you from a server that returns secrets in plaintext or that implements “delete_all” with no dry-run. Server authors share the security burden.
Worked scenario: read-only metrics MCP
A growth eng team wants agents to draft weekly metrics briefs. They ship an HTTP MCP server with three tools: list_dashboards, fetch_metric_series, and explain_metric_definition. No warehouse write tools exist. Auth is a short-lived token minted per user. Resources expose metric dictionary pages so the model cites definitions instead of inventing them.
Evals cover a golden path (correct series for “activation rate”) and a deny path (prompt injection in a dashboard title must not invent a write). The same server plugs into Cursor for local drafting and into a custom host for scheduled runs—because the protocol, not a proprietary plugin API, is the integration surface.
When not to build a server
If one host-native function call already covers a private prototype, MCP may be overhead. If the only consumers will never leave a single custom runtime, a typed internal SDK can be simpler. Build an MCP server when reuse across hosts, discoverability, or team-shared governance matters—or when you want a clear process boundary between the model loop and your systems of record.
Common mistakes
- Registering sprawling “do anything” tools instead of small, auditable operations.
- Putting production admin tokens in a local stdio server “just for testing.”
- Vague tool descriptions that encourage the model to guess arguments.
- Returning megabyte dumps that blow the context window and hide the useful rows.
- Ignoring transport auth because “it’s only on the VPN.”
- Shipping without a versioned changelog of tool schemas—breaking clients silently.
Ship checklist for an MCP server
- Write the threat model: who runs the host, what credentials the server holds, what writes exist.
- List tools with risk tiers (read / write / admin) and schemas reviewed by a human.
- Choose stdio vs HTTP deliberately; document how secrets enter the process.
- Add request IDs, structured logs, and a kill switch.
- Fixture-test at least one success path and one policy-deny path.
- Pin the package version in host configs (see Cursor MCP setup for local wiring).
- Schedule a dependency review cadence for third-party servers you did not write.
FAQ
Is an MCP server the same as an API gateway?
No. An API gateway routes HTTP for many clients. An MCP server speaks the Model Context Protocol so agent hosts can discover and invoke tools with model-friendly schemas. You may call backends through a gateway from inside the server, but the MCP surface is specifically for agent tooling, not general public traffic.
Can one MCP server talk to multiple backends?
Yes. Many teams ship a domain-oriented server (for example “support ops”) that wraps CRM + ticketing + knowledge base. Keep the tool list coherent and the blast radius understandable; a kitchen-sink mega-server becomes hard to review and harder to least-privilege.
Do I need resources and prompts, or are tools enough?
Tools alone can ship an MVP. Resources help when the model must read large or versioned content without stuffing it into every tool response. Prompts help operators start consistent workflows. Add them when repetition or grounding quality becomes the bottleneck.
How do MCP servers relate to agent skills?
Servers expose capabilities; skill files teach procedure. A SKILL.md might say “always fetch the metric dictionary resource before drafting commentary,” while the server is what actually serves that resource and the fetch tool. You usually want both for production-quality agents.
What breaks first in production?
Auth expiry, oversized tool results, and schema drift. Agents also loop when error messages are opaque. Return actionable errors (“metric_id not found”) instead of stack traces, and version your schemas so hosts can upgrade deliberately.
Bottom line
What is an MCP server? A protocol-speaking process that exposes tools, resources, and prompts on a trust boundary the host and client can govern. Treat it like production software—schemas, transports, least privilege, and audits—not like a disposable wrapper around one curl command.
AI Generated Apps AI Code Learning Technology
