Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

393 Commits

Repository files navigation

mcp

Rust framework for Model Context Protocol

Rustcrates.ioLicense: MIT OR Apache-2.0

Rust framework for building Model Context Protocol servers and clients.

Note

Part of the PulseEngine toolchain. Provides the MCP implementation used across PulseEngine's AI-assisted development infrastructure.

Example

use pulseengine_mcp_macros::{mcp_server, mcp_tools};use schemars::JsonSchema;use serde::{Deserialize,Serialize};#[derive(Debug,Clone,Serialize,Deserialize,JsonSchema)]pubstructGreetParams{pubname:Option<String>,}#[mcp_server(name = "My Server")]#[derive(Default,Clone)]pubstructMyServer;#[mcp_tools]implMyServer{/// Greet someone by namepubasyncfngreet(&self,params:GreetParams) -> anyhow::Result<String>{let name = params.name.unwrap_or_else(|| "World".to_string());Ok(format!("Hello, {name}!"))}}#[tokio::main]asyncfnmain() -> Result<(),Box<dyn std::error::Error>>{MyServer::configure_stdio_logging();MyServer::with_defaults().serve_stdio().await?.run().await}

The #[mcp_server] and #[mcp_tools] macros generate the protocol implementation. Tool schemas are derived from your Rust types via JsonSchema.

Crates

CrateDescription
mcp-protocolMCP types, JSON-RPC, schema validation
mcp-serverServer infrastructure with McpBackend trait
mcp-clientClient for connecting to MCP servers
mcp-transportstdio, HTTP, WebSocket transports
mcp-authAuthentication, API keys, OAuth 2.1
mcp-securityInput validation, rate limiting
mcp-loggingStructured logging with credential sanitization
mcp-macros#[mcp_server], #[mcp_tools], #[mcp_resource]

Examples

MCP Spec

Implements MCP 2025-11-25: tools, resources, prompts, completions, sampling, roots, logging, progress, cancellation, tasks, and elicitation.

License

MIT OR Apache-2.0


Part of PulseEngine — a WebAssembly toolchain for safety-critical systems, with formally verified components

About

Rust framework for building Model Context Protocol servers and clients. Published to crates.io.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages