Skip to content

Latest commit

 

History

History
30 lines (24 loc) · 1.51 KB

File metadata and controls

30 lines (24 loc) · 1.51 KB

Servers

An MCP server exposes four kinds of elements to a connected client. They differ by who decides to use them:

  • A tool is an action the model picks and calls. This is the page most people want first.
  • A resource is read-only data the application chooses to read, addressed by a fixed URI. Resource templates are the same thing with variables in the URI, for data that is generated per request.
  • A prompt is a message template a person invokes by name, from a menu or a slash command.

Around those, the rest of what a server declares:

  • Completions is server-side autocomplete for prompt and resource-template arguments.
  • Schema generation explains how your PHP types and docblocks become the JSON Schema a model sees, and how to override it where the types are not enough.
  • Registering elements covers the three ways an element reaches the registry: attribute discovery, explicit registration, or both at once.

Every page here stands on its own; jump straight to the one you need. If you have not built a server yet, start with First server instead.

What happens inside the functions you register — logging, progress, asking the client for an LLM completion — is the next section, Inside your handler. Getting the server in front of a client is Running your server.