v0.4.0 · Interface
protocol
Model Context Protocol (MCP) core types and messages
This interface defines all MCP protocol types, including:
- JSON-RPC message structures (requests, responses, notifications, errors)
- Content types (text, images, audio, resources)
- Server capabilities (tools, prompts, resources)
- Client capabilities (sampling, roots, elicitation)
- Session and context management
These types form the foundation for MCP communication between clients and servers.
They are used by both handler interfaces and capability interfaces.
Spec:
Records
R
embedded-resource-options
R=========================================================================
text-resource-contents
RText resource contents
blob-resource-contents
RBinary resource contents
server-capabilities
R=========================================================================
client-capabilities
RClient capabilities advertised during initialization
implementation
RMCP implementation metadata
annotations
R=========================================================================
content-options
ROptions for content blocks
resource-link-options
ROptions for resource link content
resource-link-content
RA resource link included in a prompt or tool call result
blob
RBinary content (image or audio) with MIME type
text-content
RText content block
embedded-resource-content
REmbedded resource with content options
prompt-message
RA message in a prompt with role and content
tool-annotations
RTool-specific annotations
tool-options
R=========================================================================
next-cursor-options
RPagination options for list results
tool
RTool definition
resource-options
R=========================================================================
mcp-resource
RResource definition
meta-options
RGeneric metadata options
resource-template-options
RResource template optional properties
resource-template
RResource template with URI template pattern
prompt-argument
R=========================================================================
prompt-options
RPrompt optional properties
prompt
RPrompt definition
description-options
RGeneric description options
string-schema
RJSON Schema for string type
number-schema
RJSON Schema for number/integer type
boolean-schema
RJSON Schema for boolean type
enum-schema
RJSON Schema for enum type
requested-schema
RSchema requested from client during elicitation
initialize-request
R=========================================================================
initialize-result-options
RInitialize result optional properties
initialize-result
RInitialize result structure
list-tools-request
R=========================================================================
list-tools-result
RList tools result
call-tool-request
RCall tool request
call-tool-result
RCall tool result
list-resources-request
R=========================================================================
list-resources-result
RList resources result
read-resource-request
RRead resource request
read-resource-result
RRead resource result
list-resource-templates-request
RList resource templates request
list-resource-templates-result
RList resource templates result
list-prompts-request
R=========================================================================
list-prompts-result
RList prompts result
get-prompt-request
RGet prompt request
get-prompt-result
RGet prompt result
completion-argument
R=========================================================================
completion-context
RCompletion context
completion-prompt-reference
RPrompt reference for completion
complete-request
RComplete request
complete-result
RComplete result
elicit-request
R=========================================================================
elicit-result
RElicit result
list-roots-request
R=========================================================================
root
RRoot directory or file
list-roots-result
RList roots result
ping-request
R=========================================================================
sampling-message
RMessage for sampling request
model-hint
RModel hint for sampling
model-preferences
RModel preferences for sampling
sampling-create-message-request
RSampling create message request
sampling-create-message-result
RSampling create message result
logging-message-notification
R=========================================================================
cancelled-notification
RCancelled notification
progress-notification
RProgress notification
common-notification
RCommon notification fields
error
R=========================================================================
client-context
R=========================================================================
server-context
Server context passed to client handlers
Variants
V
text-data
V=========================================================================
blob-data
VBinary data that can be provided as bytes or stream
resource-contents
VResource contents (text or binary)
progress-token
VProgress token for tracking long-running operations
request-id
VJSON-RPC request identifier
content-block
VContent blocks that can be included in messages
primitive-schema-definition
VPrimitive schema types
elicit-result-content
VElicitation result content value
completion-reference
VReference types for completion
client-request
V=========================================================================
server-request
VServer requests (sent to client)
mcp-request
VMCP request (client or server)
server-response
VServer responses (to client requests)
client-response
VClient responses (to server requests)
mcp-response
VMCP response (client or server)
server-notification
VServer notifications (sent to client)
client-notification
VClient notifications (sent to server)
mcp-notification
VMCP notification (client or server)
error-code
Standard JSON-RPC error codes
Enums
E
log-level
E=========================================================================
protocol-version
EMCP protocol version
role
ERole in a conversation
string-schema-format
E=========================================================================
number-schema-type
ENumber schema type
elicit-result-action
EElicitation result action
include-context
E=========================================================================
sampling-content
Sampling content type
Type Aliases
T
input-stream
TAn input bytestream.
output-stream
TAn output bytestream.
hash
T=========================================================================
cursor
TOpaque pagination cursor for list operations
json
TJSON-encoded data as a string
meta
TMetadata field (JSON-encoded)
uri
TUniform Resource Identifier
session-id
TSession identifier (cryptographic hash)
claims
TIdentity claims (JSON-encoded)
image-content
TImage content alias
audio-content
Audio content alias