Crate wasmcp

Crate wasmcp 

Source
Expand description

Rust SDK for building MCP (Model Context Protocol) WebAssembly components

This crate provides the core traits and macros for implementing MCP handlers in Rust.

Macros§

create_handlerDeprecated
Legacy macro for backwards compatibility (deprecated). Please use the #[mcp_handler] attribute macro instead.
json
Re-export of serde_json’s json! macro for convenience. Construct a serde_json::Value from a JSON literal.

Structs§

PromptArgument
Represents a single argument for a prompt.
PromptMessage
Represents a message in a prompt conversation.

Enums§

Json
Re-export of serde_json::Value as Json for convenience. Represents any valid JSON value.
PromptRole
The role of a participant in a prompt conversation.

Traits§

AsyncPromptHandler
Async trait for implementing MCP prompts.
AsyncResourceHandler
Async trait for implementing MCP resources.
AsyncToolHandler
Async trait for implementing MCP tools.
PromptArguments
Trait for defining prompt arguments.
PromptHandler
Trait for implementing MCP prompts.
ResourceHandler
Trait for implementing MCP resources.
ToolHandler
Trait for implementing MCP tools.

Attribute Macros§

mcp_handler
Re-export the proc macro for creating MCP handlers.