(add-root context root)
Adds a root to the client's root registry and notifies the server.
Args: context - The client session context root - Root map with :uri key and other root configuration
Returns: nil
Adds a root to the client's root registry and notifies the server. Args: context - The client session context root - Root map with :uri key and other root configuration Returns: nil
(create-session {:keys [client-info client-capabilities protocol-version roots
on-initialized on-sampling-requested on-server-progress
on-server-log on-server-prompt-list-changed
on-server-prompt-list-updated on-server-resource-changed
on-server-resource-list-changed
on-server-resource-list-updated
on-server-tool-list-changed on-server-tool-list-updated]
:or {client-info {:name "mcp-toolkit" :version "0.1.0-alpha"}
client-capabilities {:roots {:listChanged true}}
protocol-version "2025-03-26"
on-initialized default-on-initialized
on-server-prompt-list-changed request-prompt-list
on-server-resource-list-changed request-resource-list
on-server-tool-list-changed request-tool-list}})
Returns the state of a newly created session.
Returns the state of a newly created session.
(notify-cancel-request context request-id)
Sends a cancellation notification for a specific request to the MCP server. (see https://modelcontextprotocol.io/specification/2025-06-18/basic/utilities/cancellation#cancellation-flow)
Args: context - The client session context request-id - ID of the request to cancel
Returns: nil
Sends a cancellation notification for a specific request to the MCP server. (see https://modelcontextprotocol.io/specification/2025-06-18/basic/utilities/cancellation#cancellation-flow) Args: context - The client session context request-id - ID of the request to cancel Returns: nil
(notify-root-list-changed context)
Notifies the MCP server that the client's root list has been changed. (see https://modelcontextprotocol.io/specification/2025-06-18/client/roots#root-list-changes)
Args: context - The client session context
Returns: nil
Notifies the MCP server that the client's root list has been changed. (see https://modelcontextprotocol.io/specification/2025-06-18/client/roots#root-list-changes) Args: context - The client session context Returns: nil
(remove-root context root)
Removes a root from the client's root registry and notifies the server.
Args: context - The client session context root - Root map with :uri key to identify which root to remove
Returns: nil
Removes a root from the client's root registry and notifies the server. Args: context - The client session context root - Root map with :uri key to identify which root to remove Returns: nil
(request-complete-prompt-param context prompt-name param-name param-value)
Requests autocompletion for a prompt parameter from the MCP server. (see https://modelcontextprotocol.io/specification/2025-06-18/server/utilities/completion#data-types)
Args: context - The client session context prompt-name - Name of the prompt to complete param-name - Name of the parameter to complete param-value - Current partial value of the parameter
Returns: A promise that resolves to completion suggestions from the server.
Requests autocompletion for a prompt parameter from the MCP server. (see https://modelcontextprotocol.io/specification/2025-06-18/server/utilities/completion#data-types) Args: context - The client session context prompt-name - Name of the prompt to complete param-name - Name of the parameter to complete param-value - Current partial value of the parameter Returns: A promise that resolves to completion suggestions from the server.
(request-complete-resource-uri context uri-template param-name param-value)
Requests autocompletion for a resource URI parameter from the MCP server. (see https://modelcontextprotocol.io/specification/2025-06-18/server/utilities/completion#data-types)
Args: context - The client session context uri-template - URI template to complete param-name - Name of the parameter to complete param-value - Current partial value of the parameter
Returns: A promise that resolves to completion suggestions from the server.
Requests autocompletion for a resource URI parameter from the MCP server. (see https://modelcontextprotocol.io/specification/2025-06-18/server/utilities/completion#data-types) Args: context - The client session context uri-template - URI template to complete param-name - Name of the parameter to complete param-value - Current partial value of the parameter Returns: A promise that resolves to completion suggestions from the server.
(request-prompt context prompt-name arguments)
Requests a specific prompt from the MCP server with given arguments. (see https://modelcontextprotocol.io/specification/2025-06-18/server/prompts#getting-a-prompt)
Args: context - The client session context prompt-name - Name of the prompt to retrieve arguments - Map of arguments to pass to the prompt
Returns: A promise that resolves to the prompt response from the server.
Requests a specific prompt from the MCP server with given arguments. (see https://modelcontextprotocol.io/specification/2025-06-18/server/prompts#getting-a-prompt) Args: context - The client session context prompt-name - Name of the prompt to retrieve arguments - Map of arguments to pass to the prompt Returns: A promise that resolves to the prompt response from the server.
(request-prompt-list context)
Requests the list of available prompts from the MCP server. Updates the session's server-prompt-by-name index and calls the on-server-prompt-list-updated callback. (see https://modelcontextprotocol.io/specification/2025-06-18/server/prompts#listing-prompts)
Args: context - The client session context
Returns: A promise that resolves when prompts are fetched and stored.
Requests the list of available prompts from the MCP server. Updates the session's server-prompt-by-name index and calls the on-server-prompt-list-updated callback. (see https://modelcontextprotocol.io/specification/2025-06-18/server/prompts#listing-prompts) Args: context - The client session context Returns: A promise that resolves when prompts are fetched and stored.
(request-resource context resource-uri)
Requests a specific resource from the MCP server by URI. (see https://modelcontextprotocol.io/specification/2025-06-18/server/resources#reading-resources)
Args: context - The client session context resource-uri - URI of the resource to retrieve
Returns: A promise that resolves to the resource content from the server.
Requests a specific resource from the MCP server by URI. (see https://modelcontextprotocol.io/specification/2025-06-18/server/resources#reading-resources) Args: context - The client session context resource-uri - URI of the resource to retrieve Returns: A promise that resolves to the resource content from the server.
(request-resource-list context)
Requests the list of available resources from the MCP server. Updates the session's server-resource-by-uri index and calls the on-server-resource-list-updated callback. (see https://modelcontextprotocol.io/specification/2025-06-18/server/resources#listing-resources)
Args: context - The client session context
Returns: A promise that resolves when the resource descriptions are fetched and stored.
Requests the list of available resources from the MCP server. Updates the session's server-resource-by-uri index and calls the on-server-resource-list-updated callback. (see https://modelcontextprotocol.io/specification/2025-06-18/server/resources#listing-resources) Args: context - The client session context Returns: A promise that resolves when the resource descriptions are fetched and stored.
(request-resource-template-list context)
Requests the list of available resource templates from the MCP server. (see https://modelcontextprotocol.io/specification/2025-06-18/server/resources#resource-templates)
Args: context - The client session context
Returns: A promise that resolves to the list of resource templates.
Requests the list of available resource templates from the MCP server. (see https://modelcontextprotocol.io/specification/2025-06-18/server/resources#resource-templates) Args: context - The client session context Returns: A promise that resolves to the list of resource templates.
(request-set-logging-level context level)
Sets the logging level on the MCP server. (see https://modelcontextprotocol.io/specification/2025-06-18/server/utilities/logging#log-levels)
Args: context - The client session context level - Logging level, accepted values are "debug", "info", "notice", "warning", "error", "critical", "alert" and "emergency"
Returns: A promise that resolves when the server acknowledges the level change.
Sets the logging level on the MCP server. (see https://modelcontextprotocol.io/specification/2025-06-18/server/utilities/logging#log-levels) Args: context - The client session context level - Logging level, accepted values are "debug", "info", "notice", "warning", "error", "critical", "alert" and "emergency" Returns: A promise that resolves when the server acknowledges the level change.
(request-subscribe-resource context resource-uri)
Subscribes to changes for a specific resource on the MCP server. (see https://modelcontextprotocol.io/specification/2025-06-18/server/resources#subscriptions)
Args: context - The client session context resource-uri - URI of the resource to subscribe to
Returns: A promise that resolves when subscription is confirmed.
Subscribes to changes for a specific resource on the MCP server. (see https://modelcontextprotocol.io/specification/2025-06-18/server/resources#subscriptions) Args: context - The client session context resource-uri - URI of the resource to subscribe to Returns: A promise that resolves when subscription is confirmed.
(request-tool-invocation context tool-name arguments)
Invokes a specific tool on the MCP server with given arguments. (see https://modelcontextprotocol.io/specification/2025-06-18/server/tools#calling-tools)
Args: context - The client session context tool-name - Name of the tool to invoke arguments - Map of arguments to pass to the tool
Returns: A promise that resolves to the tool execution result.
Invokes a specific tool on the MCP server with given arguments. (see https://modelcontextprotocol.io/specification/2025-06-18/server/tools#calling-tools) Args: context - The client session context tool-name - Name of the tool to invoke arguments - Map of arguments to pass to the tool Returns: A promise that resolves to the tool execution result.
(request-tool-list context)
Requests the list of available tools from the MCP server. Updates the session's server-tool-by-name index and triggers the on-server-tool-list-updated callback. (see https://modelcontextprotocol.io/specification/2025-06-18/server/tools#listing-tools)
Args: context - The client session context
Returns: A promise that resolves when the tool descriptions are fetched and stored.
Requests the list of available tools from the MCP server. Updates the session's server-tool-by-name index and triggers the on-server-tool-list-updated callback. (see https://modelcontextprotocol.io/specification/2025-06-18/server/tools#listing-tools) Args: context - The client session context Returns: A promise that resolves when the tool descriptions are fetched and stored.
(request-unsubscribe-resource context resource-uri)
Unsubscribes from changes for a specific resource on the MCP server. (see https://modelcontextprotocol.io/specification/2025-06-18/server/resources#subscriptions)
Args: context - The client session context resource-uri - URI of the resource to unsubscribe from
Returns: A promise that resolves when unsubscription is confirmed.
Unsubscribes from changes for a specific resource on the MCP server. (see https://modelcontextprotocol.io/specification/2025-06-18/server/resources#subscriptions) Args: context - The client session context resource-uri - URI of the resource to unsubscribe from Returns: A promise that resolves when unsubscription is confirmed.
(send-first-handshake-message context)
Sends the initial handshake message to establish the MCP connection. Initializes the session with server capabilities and triggers the on-initialized callback upon receiving the server's response. (see https://modelcontextprotocol.io/specification/2025-06-18/architecture#capability-negotiation)
Args: context - The client session context
Returns: nil
Sends the initial handshake message to establish the MCP connection. Initializes the session with server capabilities and triggers the on-initialized callback upon receiving the server's response. (see https://modelcontextprotocol.io/specification/2025-06-18/architecture#capability-negotiation) Args: context - The client session context Returns: nil
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close