DS DevShelfHub Projects · AI tools
Tutorials / MCP / API Reference

MCP API Reference

By DevShelfHub

Complete documentation for the Model Context Protocol — every interface, every JSON-RPC method, every notification. Detailed explanations, fields, examples, and common mistakes.

37 Interfaces 20 Methods 10 Notifications
Tool
server-primitives
Executable function exposed by a server that the LLM can invoke.
ToolAnnotations
server-primitives
Optional hints describing the side-effect profile of a tool.
CallToolRequest
server-primitives
Client request to invoke a tool by name with arguments.
CallToolResult
server-primitives
Server response containing the output content of a tool invocation.
Resource
server-primitives
Read-only data exposed by a server, identified by URI.
ResourceTemplate
server-primitives
Parameterised URI template (RFC 6570) representing a family of resources.
ResourceLink
server-primitives
Content block that points to a resource without embedding it.
EmbeddedResource
server-primitives
Content block carrying the actual bytes of a resource inline.
Prompt
server-primitives
Server-defined message template the user can invoke explicitly.
PromptArgument
server-primitives
Description of a single argument accepted by a Prompt.
PromptMessage
server-primitives
A single message returned by a Prompt invocation.
ClientCapabilities
lifecycle
Declares the optional features the client supports, sent during initialize.
ServerCapabilities
lifecycle
Declares the optional features the server supports, returned during initialize.
Implementation
lifecycle
Identifies a client or server by name, title, and version.
InitializeRequest
lifecycle
First request a client sends to begin an MCP session.
InitializeResult
lifecycle
Server response confirming protocol version and declared capabilities.
JSONRPCRequest
protocol
Base shape for every request message in MCP (JSON-RPC 2.0).
JSONRPCResponse
protocol
Success response correlated by id to a JSONRPCRequest.
JSONRPCError
protocol
Failure response with code, message, and optional data.
JSONRPCNotification
protocol
One-way message with no id and no expected response.
CreateMessageRequest
client-features
Server asks the client to run an LLM completion via sampling/createMessage.
CreateMessageResult
client-features
Client's response containing the LLM completion.
ModelPreferences
client-features
Server hints describing the kind of model that should run a sampling request.
SamplingMessage
client-features
One message in a sampling conversation.
ElicitRequest
client-features
Server asks the user for structured input via the client.
ElicitResult
client-features
User's response to an elicitation, with action and optional content.
Root
client-features
A filesystem or URI scope the client exposes to servers.
Task
tasks
Durable state machine wrapping a long-running MCP request.
TaskStatus
tasks
Enum describing the lifecycle state of a Task.
TextContent
content-blocks
Plain-text content block used in tool results, prompts, and sampling.
ImageContent
content-blocks
Image content block carrying base64-encoded bytes.
AudioContent
content-blocks
Audio content block, added in spec 2025-11-25.
Annotations
content-blocks
Metadata describing audience, priority, and last-modified for content/resources.
ProgressToken
utilities
Identifier (string or integer) attached to a request to enable progress updates.
LoggingLevel
utilities
Syslog-style severity for server-emitted log messages.
PrimitiveSchemaDefinition
schema
Union of the four primitive schemas used in elicitation forms.
EnumSchema
schema
Schema for single- or multi-select choices in elicitation forms.

MCP API Reference FAQ

What does the MCP API reference cover?

This reference covers every MCP TypeScript type (interfaces), every JSON-RPC method (like initialize, tools/list, tools/call), and every notification — with field tables, examples, common mistakes, and related types for each entry.

What are MCP Interfaces?

MCP Interfaces are TypeScript types that define the shape of protocol data — request parameters, result shapes, content types, and configuration objects. They form the schema layer of MCP's JSON-RPC 2.0 messages.

What are MCP Methods?

MCP Methods are the JSON-RPC 2.0 procedures that clients and servers call on each other — for example, initialize, tools/list, tools/call, resources/read, prompts/get, and sampling/createMessage. Each method has defined request and result types.

What are MCP Notifications?

MCP Notifications are fire-and-forget JSON-RPC 2.0 messages with no id and no expected response. They're used for progress updates (notifications/progress), list-changed events (notifications/tools/list_changed), log messages, and cancellation.

Is this MCP API reference up to date?

This reference is based on the MCP specification as of June 2026. MCP is actively evolving — check the official modelcontextprotocol/specification repository on GitHub for the latest changes and experimental proposals.