package
0.8.3
Repository: https://github.com/mark3labs/mcp-go.git
Documentation: pkg.go.dev

# Functions

ArgumentDescription adds a description to a prompt argument.
AsBlobResourceContents attempts to cast the given interface to BlobResourceContents.
AsEmbeddedResource attempts to cast the given interface to EmbeddedResource.
AsImageContent attempts to cast the given interface to ImageContent.
AsTextContent attempts to cast the given interface to TextContent.
AsTextResourceContents attempts to cast the given interface to TextResourceContents.
DefaultBool sets the default value for a boolean property.
DefaultNumber sets the default value for a number property.
DefaultString sets the default value for a string property.
Description adds a description to a property in the JSON Schema.
Enum specifies a list of allowed values for a string property.
Helper for formatting numbers in tool results.
Max sets the maximum value for a number property.
MaxLength sets the maximum length for a string property.
Min sets the minimum value for a number property.
MinLength sets the minimum length for a string property.
MultipleOf specifies that a number must be a multiple of the given value.
Helper function to create a new EmbeddedResource.
NewGetPromptResult creates a new GetPromptResult.
Helper function to create a new ImageContent.
NewInitializeResult creates a new InitializeResult.
NewJSONRPCError creates a new JSONRPCResponse with the given id, code, and message.
NewJSONRPCResponse creates a new JSONRPCResponse with the given id and result.
NewListPromptsResult creates a new ListPromptsResult.
NewListResourcesResult creates a new ListResourcesResult.
NewListResourceTemplatesResult creates a new ListResourceTemplatesResult.
NewListToolsResult creates a new ListToolsResult.
Helper function for creating a logging message notification.
Helper function for creating a progress notification.
NewPrompt creates a new Prompt with the given name and options.
Helper function to create a new PromptMessage.
NewReadResourceResult creates a new ReadResourceResult with text content.
NewResource creates a new Resource with the given URI, name and options.
NewResourceTemplate creates a new ResourceTemplate with the given URI template, name and options.
Helper function to create a new TextContent.
NewTool creates a new Tool with the given name and options.
NewToolResultError creates a new CallToolResult that indicates an error.
NewToolResultImage creates a new CallToolResult with both text and image content.
NewToolResultResource creates a new CallToolResult with an embedded resource.
NewToolResultText creates a new CallToolResult with a text content.
Pattern sets a regex pattern that a string property must match.
Required marks a property as required in the tool's input schema.
RequiredArgument marks an argument as required in the prompt.
Title adds a display-friendly title to a property in the JSON Schema.
WithAnnotations adds annotations to the Resource.
WithArgument adds an argument to the prompt's argument list.
WithBoolean adds a boolean property to the tool schema.
WithDescription adds a description to the Tool.
WithMIMEType sets the MIME type for the Resource.
WithNumber adds a number property to the tool schema.
WithPromptDescription adds a description to the Prompt.
WithResourceDescription adds a description to the Resource.
WithString adds a string property to the tool schema.
WithTemplateAnnotations adds annotations to the ResourceTemplate.
WithTemplateDescription adds a description to the ResourceTemplate.
WithTemplateMIMEType sets the MIME type for the ResourceTemplate.

# Constants

Standard JSON-RPC error codes.
Standard JSON-RPC error codes.
Standard JSON-RPC error codes.
JSONRPC_VERSION is the version of JSON-RPC used by MCP.
LATEST_PROTOCOL_VERSION is the most recent version of the MCP protocol.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Standard JSON-RPC error codes.
Standard JSON-RPC error codes.
No description provided by the author
No description provided by the author

# Structs

Annotated is the base for objects that include optional annotations for the client.
No description provided by the author
CallToolRequest is used by the client to invoke a tool provided by the server.
CallToolResult is the server's response to a tool call.
CancelledNotification can be sent by either side to indicate that it is cancelling a previously-issued request.
ClientCapabilities represents capabilities a client may support.
CompleteRequest is a request from the client to the server, to ask for completion options.
CompleteResult is the server's response to a completion/complete request.
CreateMessageRequest is a request from the server to sample an LLM via the client.
CreateMessageResult is the client's response to a sampling/create_message request from the server.
EmbeddedResource represents the contents of a resource, embedded into a prompt or tool call result.
GetPromptRequest is used by the client to get a prompt provided by the server.
GetPromptResult is the server's response to a prompts/get request from the client.
ImageContent represents an image provided to or from an LLM.
Implementation describes the name and version of an MCP implementation.
InitializedNotification is sent from the client to the server after initialization has finished.
InitializeRequest is sent from the client to the server when it first connects, asking it to begin initialization.
InitializeResult is sent after receiving an initialize request from the client.
JSONRPCError represents a non-successful (error) response to a request.
JSONRPCNotification represents a notification which does not expect a response.
JSONRPCRequest represents a request that expects a response.
JSONRPCResponse represents a successful (non-error) response to a request.
ListPromptsRequest is sent from the client to request a list of prompts and prompt templates the server has.
ListPromptsResult is the server's response to a prompts/list request from the client.
ListResourcesRequest is sent from the client to request a list of resources the server has.
ListResourcesResult is the server's response to a resources/list request from the client.
ListResourceTemplatesRequest is sent from the client to request a list of resource templates the server has.
ListResourceTemplatesResult is the server's response to a resources/templates/list request from the client.
ListRootsRequest is sent from the server to request a list of root URIs from the client.
ListRootsResult is the client's response to a roots/list request from the server.
ListToolsRequest is sent from the client to request a list of tools the server has.
ListToolsResult is the server's response to a tools/list request from the client.
LoggingMessageNotification is a notification of a log message passed from server to client.
ModelHint represents hints to use for model selection.
ModelPreferences represents the server's preferences for model selection, requested of the client during sampling.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
PingRequest represents a ping, issued by either the server or the client, to check that the other party is still alive.
ProgressNotification is an out-of-band notification used to inform the receiver of a progress update for a long-running request.
Prompt represents a prompt or prompt template that the server offers.
PromptArgument describes an argument that a prompt template can accept.
PromptListChangedNotification is an optional notification from the server to the client, informing it that the list of prompts it offers has changed.
PromptMessage describes a message returned as part of a prompt.
PromptReference identifies a prompt.
ReadResourceRequest is sent from the client to the server, to read a specific resource URI.
ReadResourceResult is the server's response to a resources/read request from the client.
No description provided by the author
Resource represents a known resource that the server is capable of reading.
ResourceContents represents the contents of a specific resource or sub- resource.
ResourceListChangedNotification is an optional notification from the server to the client, informing it that the list of resources it can read from has changed.
ResourceReference is a reference to a resource or resource template definition.
ResourceTemplate represents a template description for resources available on the server.
ResourceUpdatedNotification is a notification from the server to the client, informing it that a resource has changed and may need to be read again.
No description provided by the author
Root represents a root directory or file that the server can operate on.
RootsListChangedNotification is a notification from the client to the server, informing it that the list of roots has changed.
SamplingMessage describes a message issued to or received from an LLM API.
ServerCapabilities represents capabilities that a server may support.
SetLevelRequest is a request from the client to the server, to enable or adjust logging.
SubscribeRequest is sent from the client to request resources/updated notifications from the server whenever a particular resource changes.
TextContent represents text provided to or from an LLM.
No description provided by the author
Tool represents the definition for a tool the client can call.
No description provided by the author
ToolListChangedNotification is an optional notification from the server to the client, informing it that the list of tools it offers has changed.
UnsubscribeRequest is sent from the client to request cancellation of resources/updated notifications from the server.

# Interfaces

ClientNotification represents any notification that can be sent from client to server.
Client messages */ ClientRequest represents any request that can be sent from client to server.
ClientResult represents any result that can be sent from client to server.
JSONRPCMessage represents either a JSONRPCRequest, JSONRPCNotification, JSONRPCResponse, or JSONRPCError.
ProgressToken is used to associate progress notifications with the original request.
RequestId is a uniquely identifying ID for a request in JSON-RPC.
ServerNotification represents any notification that can be sent from server to client.
Server messages */ ServerRequest represents any request that can be sent from server to client.
ServerResult represents any result that can be sent from server to client.

# Type aliases

ArgumentOption is a function that configures a PromptArgument.
Cursor is an opaque token used to represent a cursor for pagination.
EmptyResult represents a response that indicates success but carries no data.
LoggingLevel represents the severity of a log message.
No description provided by the author
PromptOption is a function that configures a Prompt.
PropertyOption is a function that configures a property in a Tool's input schema.
ResourceOption is a function that configures a Resource.
ResourceTemplateOption is a function that configures a ResourceTemplate.
Role represents the sender or recipient of messages and data in a conversation.
ToolOption is a function that configures a Tool.