Skip to main content

Crate stand_in

Crate stand_in 

Source
Expand description

§stand-in

A stand-in for your MCP server boilerplate.

You write declarative macros that look like your MCP server — tools, resources, prompts — but when the compiler rolls, the macros step aside and production-ready code takes their place.

§Quick Start

use stand_in::prelude::*;

#[mcp_tool(
    name = "get_weather",
    description = "Returns current weather for a given city"
)]
async fn get_weather(city: String) -> Result<String> {
    Ok(format!("{}: sunny", city))
}

#[mcp_server]
struct MyServer;

#[tokio::main]
async fn main() {
    MyServer::serve(StdioTransport::default()).await;
}

Modules§

error
Centralized error types for stand-in.
prelude
Prelude module — import everything you need with use stand_in::prelude::*.
prompt
MCP prompt types — trait, registry, factory, and protocol types.
protocol
JSON-RPC 2.0 wire format types.
server
MCP server types — capabilities, handshake, and request dispatch.
tool
MCP tool abstraction — trait, registry, and tool-related types.
transport
Transport layer — abstracts communication between MCP client and server.

Attribute Macros§

mcp_prompt
Marks an async function as an MCP prompt template.
mcp_resource
Marks an async function as an MCP resource.
mcp_server
Marks a struct as an MCP server.
mcp_tool
Marks an async function as an MCP tool.