Main

Model Context Protocol Overview from Python SDK README

From the Python SDK README.

Overview

MCP servers provide focused functionality like resources, tools, prompts, and other capabilities that can be reused across many client applications. These servers are designed to be easy to build, highly composable, and modular.

Key design principles

  • Servers are extremely easy to build with clear, simple interfaces
  • Multiple servers can be composed seamlessly through a shared protocol
  • Each server operates in isolation and cannot access conversation context
  • Features can be added progressively through capability negotiation

Server provided primitives

  • Prompts: Templatable text
  • Resources: File-like attachments
  • Tools: Functions that models can call
  • Utilities:
    • Completion: Auto-completion provider for prompt arguments or resource URI templates
    • Logging: Logging to the client
    • Pagination*: Pagination for long results

Client provided primitives

  • Sampling: Allow servers to sample using client models
  • Roots: Information about locations to operate on (e.g., directories)

Connections between clients and servers are established through transports like stdio or SSE (Note that most clients support stdio, but not SSE at the moment). The transport layer handles message framing, delivery, and error handling.