Nexus MCP SDK documentation¶
The groups follow what you came to do: learn the SDK, get a task done, look something up, or understand why the SDK is built this way.
Start here¶
- Getting started: the tutorial. It takes you from an empty directory to a stdio server and a PHP client that calls it.
How-to guides¶
Server¶
- Server API overview: the builder, the lifecycle, and the guide to every feature page.
- Tools: registering tools, structured content, and schema validation.
- Prompts: registering prompt renderers.
- Resources: static and templated resources, and cache hints.
- Completions: serving
completion/complete. - Stores and pagination: page size, custom stores, runtime mutation.
- Custom handlers: vendor-extension methods and spec-method overrides.
- Extensions: enabling SEP-2133 extensions and the capability gate.
- Tasks: brokering tool calls into polled long-running tasks (SEP-2663).
- Apps: declaring
ui://views and linking tools to them (SEP-1865). - Subscriptions: serving
subscriptions/listenstreams. - Asking the client for input: the
InputRequiredResultflow. - Attribute discovery: declaring features with
#[AsTool]and friends.
Client¶
- Client API overview: the builder, the lifecycle, and the guide to every feature page.
- Connecting and discovery: attaching a transport and reading
server/discover. - Typed requests: the per-method calls, mirrored tool parameters, and
sendRequest(). - When the server asks for input first: answering an
InputRequiredResult. - Progress and timeouts: streaming progress and request deadlines.
- Notification handlers: reacting to server notifications.
- Extensions: enabling SEP-2133 extensions and the outbound gate.
- Tasks: calling tools as tasks and polling them to completion (SEP-2663).
- Apps: advertising renderable mime types and reading
_meta.ui(SEP-1865). - Subscriptions: opening
subscriptions/listenstreams.
Authorization¶
- Authorization overview: what the SDK enforces and the OAuth error surface.
- Client authorization: composing an authorized client and the user-agent leg.
- Resource server: validating tokens and publishing the metadata document.
- Persisting tokens and registrations: the store interfaces.
- Scopes and step-up: scope selection and insufficient-scope retries.
- OAuth extension grants: client credentials (SEP-1046) and enterprise-managed authorization (SEP-990).
- Provider recipes: Keycloak, Microsoft Entra ID, Auth0, Okta.
Reference¶
- Transports: the transport contract and lifecycle, with one page per binding: stdio, Streamable HTTP, SupervisedTransport, InMemoryTransport.
- Server configuration: everything
ServerBuildertakes. - Client configuration: everything
ClientBuildertakes. - Capability advertisement: how
ServerCapabilitiesis derived. - ServerContext: what every handler receives.
- Error handling: exception types, JSON-RPC error codes, and the diagnostic message grammar.
- API reference: the generated class-level reference for the public
Nexus\Mcp\API. It tracks the1.xdevelopment branch.
Explanation¶
- Architecture: the namespace tree, layering rules, and the dispatch kernel.
- Spec compliance: coverage against the targeted revision, and the deliberate omissions.
- Design rationale: the choices behind the SDK.
- Best practices: conventions the SDK is shaped to reward.
Runnable code¶
- examples/: demo servers and clients over stdio, in-memory, and HTTP. They include the OAuth and MCP Apps end-to-end setups.