# MCP Server Foundations

> Understanding the architecture, lifecycle, and transports of the Model Context Protocol (MCP).

- Skill: `jcorpac/mcp-server-foundations` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add jcorpac/mcp-server-foundations`
- Raw SKILL.md: https://api.skillmd.com/api/skills/jcorpac/mcp-server-foundations/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: jcorpac (https://skillmd.com/u/jcorpac)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/jcorpac/mcp-server-foundations

---


# MCP Server Foundations

The Model Context Protocol (MCP) is the standard for connecting AI models to external tools and data.

## Architecture
- **Host**: The application (like Claude Desktop) that initiates the connection.
- **Server**: The adapter providing tools, resources, or prompts.
- **Client**: The model's interface within the host.

## Transports
- **STDIO**: Standard input/output for local processes.
- **SSE (Server-Sent Events)**: For remote servers over HTTP.

## Lifecycle
1.  **Initialization**: Capabilities negotiation.
2.  **Interaction**: Tool calls, resource reads.
3.  **Shutdown**: Cleanly closing connections.

## Best Practices
- **Graceful Error Handling**: Returning clear error messages instead of crashing.
- **Resource Management**: Efficiently closing file handles and network sockets.


