Expand description
VELOCITY-MCP Core - WASM-compatible protocol logic.
This crate contains pure MCP protocol handling without OS-specific dependencies. It can be compiled to both native and wasm32-wasip1 targets.
§Tool Execution
The core crate defines a ToolExecutor trait that callers implement to provide
actual tool execution. The handle_mcp_request_with_executor function routes
tools/list and tools/call to the provided executor, enabling real tool execution
in any deployment target (native, edge/WASM, etc.).
§Supported MCP Methods
| Method | Status |
|---|---|
initialize | Full — declares tools, resources, prompts capabilities |
notifications/initialized | Acknowledged (no-op) |
ping | Full |
tools/list | Full via executor; stub returns empty |
tools/call | Full via executor; stub returns placeholder |
resources/list | Returns empty list (no resource provider on Edge) |
resources/read | Validates URI format, returns error for unknown URIs |
resources/templates/list | Returns empty list |
prompts/list | Returns empty list (no prompt provider on Edge) |
prompts/get | Validates name, returns error for unknown prompts |
elicitation/create | Refused (-32601) — server→client method |
roots/list | Refused (-32601) — server→client method |
completion/complete | Validates ref type, returns empty completions |
sampling/createMessage | Refused (-32601) — server→client method |
Structs§
- McpError
- MCP error structure
- McpRequest
- MCP JSON-RPC request
- McpResponse
- MCP JSON-RPC response
- Tool
Definition - Definition of an MCP tool (name, description, JSON Schema for input).
Traits§
- Tool
Executor - Trait for providing tool listing and execution to the core protocol handler.
Functions§
- handle_
mcp_ request - Process an MCP request in stub mode (no tool execution).
- handle_
mcp_ request_ with_ executor - Process an MCP request with a real tool executor.
- parse_
request - Parse raw JSON bytes into an McpRequest
- serialize_
response - Serialize an McpResponse to JSON bytes