Install
$ agentstack add mcp-paiml-rust-mcp-sdk Open-source listing — not yet scanned by AgentStack. Follow the source repository for install instructions.
Security review
⚠ Flagged1 finding(s); flagged for manual review. · v0.1.0 How review works →
- • Prompt-injection patterns
- • Secret / credential exfiltration
- • Dangerous shell & filesystem operations
- • Untrusted network calls
- • Known-malicious package signatures
- high Pipes remote content directly into a shell (remote code execution).
What it can access
- ● Network access Used
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
PMCP - Pragmatic Model Context Protocol
[](https://github.com/paiml/rust-mcp-sdk/actions/workflows/quality-gate.yml) [](https://github.com/paiml/rust-mcp-sdk/actions/workflows/quality-badges.yml) [](https://github.com/paiml/rust-mcp-sdk/actions/workflows/quality-badges.yml) [](https://github.com/paiml/rust-mcp-sdk/actions/workflows/quality-badges.yml)
[](https://github.com/paiml/rust-mcp-sdk/actions/workflows/ci.yml) [](https://github.com/paiml/rust-mcp-sdk) [](https://crates.io/crates/pmcp) [](https://docs.rs/pmcp) [](https://opensource.org/licenses/MIT) [](https://www.rust-lang.org) [](https://modelcontextprotocol.io)
> Production-grade Rust implementation of the Model Context Protocol (MCP) - 16x faster than TypeScript, built with Toyota Way quality principles
Overview
PMCP is a complete MCP ecosystem for Rust, providing everything you need to build, test, and deploy production-grade MCP servers — in Rust, or from configuration alone:
- 🧩 Config-Driven Servers - Build SQL & OpenAPI/HTTP MCP servers from a
config.toml, or serve a governed Excel workbook from a compiled bundle — all no Rust required (pmcp-server-toolkit,pmcp-sql-server,pmcp-openapi-server,pmcp-workbook-server) - 🦀 pmcp SDK - High-performance Rust crate with full MCP protocol support
- ⚡ cargo-pmcp - CLI toolkit for scaffolding, testing, and development
- 📚 pmcp-book - Comprehensive reference guide with 27 chapters
- 🎓 pmcp-course - Hands-on course with quizzes and exercises
- 🤖 AI Agents - Kiro and Claude Code configurations for AI-assisted development
Why PMCP?
- Performance: 16x faster than TypeScript SDK, 50x lower memory
- Safety: Rust's type system + zero
unwrap()in production code - Quality: Toyota Way principles - zero technical debt tolerance
- Complete: SDK, tooling, documentation, and AI assistance in one ecosystem
Quick Start
Choose your path based on experience and preference:
🧩 Path 1: Config-Only Servers — No Rust Required (SQL & OpenAPI)
New in v2.9 — this removes the biggest blocker to putting organizational data behind MCP: you no longer need a Rust programmer. Describe a production MCP server over a SQL database or any OpenAPI / HTTP backend in a config.toml — declare the backend, a handful of curated tools, and a Code Mode policy — and a prebuilt binary serves it. No Rust, no recompiling. Curated tools cover the common ~20%; Code Mode handles the long-tail ~80% by generating queries against your schema/spec under a static, default-deny policy. A business analyst curates the API slice in config; the toolkit does the rest.
SQL — SQLite / Postgres / MySQL / Athena (runnable from a checkout of this repo):
cargo install pmcp-sql-server
# Seed a tiny demo DB, then serve it from config alone — two curated tools
# (list_books, books_by_author) + Code Mode for the long tail.
sqlite3 /tmp/pmcp-sqlite-explorer.db --template `):
- `minimal` - Empty structure for custom servers
- `calculator` - Arithmetic operations (learning)
- `complete_calculator` - Full-featured reference implementation
- `sqlite_explorer` - Hand-coded Rust database browser (escape hatch)
**Config-driven kinds** (`cargo pmcp new --kind ` — TOML-driven, no per-tool Rust):
- `sql-server` - SQL MCP server over SQLite / Postgres / MySQL / Athena from `config.toml`
- `openapi-server` - MCP server over any OpenAPI / HTTP backend from `config.toml`
- `workbook-server` - MCP server over a governed Excel workbook, served from a compiled `bundle@version` directory
**Learn more**: [cargo-pmcp Guide](cargo-pmcp/README.md)
---
### 🦀 Path 4: pmcp SDK Directly (For Fine-Grained Control)
Use the pmcp crate directly for maximum control:
**Installation:**
```toml
[dependencies]
pmcp = "2.0"
tokio = { version = "1", features = ["full"] }
serde = { version = "1", features = ["derive"] }
schemars = "0.8" # For type-safe tools
Type-safe server example:
use pmcp::{ServerBuilder, TypedTool, RequestHandlerExtra, Error};
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
#[schemars(deny_unknown_fields)]
struct WeatherArgs {
#[schemars(description = "City name")]
city: String,
#[schemars(description = "Number of days (1-5)")]
days: Option,
}
#[derive(Debug, Serialize, JsonSchema)]
struct WeatherOutput {
temperature: f64,
conditions: String,
}
async fn get_weather(args: WeatherArgs, _extra: RequestHandlerExtra) -> pmcp::Result {
// Validate
if args.city.is_empty() {
return Err(Error::validation("City cannot be empty"));
}
let days = args.days.unwrap_or(1);
if !(1..=5).contains(&days) {
return Err(Error::validation("Days must be 1-5"));
}
// Call weather API...
Ok(WeatherOutput {
temperature: 72.0,
conditions: "Sunny".to_string(),
})
}
#[tokio::main]
async fn main() -> pmcp::Result {
let server = ServerBuilder::new()
.name("weather-server")
.version("1.0.0")
.tool("get-weather", TypedTool::new("get-weather", |args, extra| {
Box::pin(get_weather(args, extra))
}).with_description("Get weather forecast for a city"))
.build()?;
server.run_stdio().await?;
Ok(())
}
Learn more: pmcp-book | pmcp-course | API Documentation
PMCP Ecosystem Components
🦀 pmcp SDK (The Crate)
High-performance Rust implementation of the MCP protocol.
Key Features:
- Type-Safe Tools: Automatic JSON schema generation from Rust types
- Multiple Transports: stdio, HTTP/SSE, WebSocket, WASM
- OAuth Support: Full auth context pass-through
- Workflows: Multi-step orchestration with array indexing support
- MCP Apps: Rich HTML UI widgets with live preview and browser DevTools
- MCP Tasks: Shared client/server state with task lifecycle management
- Agent Skills (SEP-2640): Register an Agent Skill in ~5 lines and serve it on BOTH a SEP-2640 skill surface AND a parallel MCP prompt fallback — byte-equal by construction (
skillsfeature, opt-in) - Tower Middleware: DNS rebinding protection, CORS, security headers
- Typed Client Helpers:
call_tool_typed,get_prompt_typed, and auto-paginatinglist_all_*with bounded safety cap - Performance: 16x faster than TypeScript, SIMD-accelerated parsing
- Quality: Zero
unwrap(), comprehensive error handling
Latest Version: pmcp = "2.9"
Documentation:
- API Reference
- pmcp-book
- [Examples](examples/)
⚡ cargo-pmcp (CLI Toolkit)
Full-lifecycle development toolkit — from scaffolding to production deployment.
cargo install cargo-pmcp
cargo pmcp new my-workspace # Scaffold a new workspace
cargo pmcp add server my-server # Add a server with best-practice template
cargo pmcp dev --server my-server # Dev server with hot-reload
cargo pmcp test --server my-server # Auto-generated scenario tests
cargo pmcp loadtest run # Load test with latency percentiles
cargo pmcp pentest run # Security audit (32 checks, SARIF output)
cargo pmcp preview --open # Browser-based widget preview
cargo pmcp workbook explain wb.xlsx # Preview an Excel workbook's MCP tool surface
cargo pmcp deploy --target aws-lambda # Deploy to AWS Lambda, GCR, or Cloudflare
cargo pmcp deploy logs --tail # Stream production logs
Covers the full development lifecycle: scaffolding, dev mode, testing, load testing, security pentesting, MCP Apps preview, schema management, multi-target deployment, secrets, and OAuth setup.
Full command reference: [cargo-pmcp Guide](cargo-pmcp/README.md)
🧩 Config-Driven Servers (No Rust)
Build production MCP servers over SQL and HTTP backends from a config.toml alone — the toolkit synthesizes curated tools + a Code Mode long tail, so exposing organizational data over MCP no longer needs a Rust programmer.
| Crate | What it is | | ----- | ---------- | | [pmcp-server-toolkit](crates/pmcp-server-toolkit) | The backend-agnostic library: config types, the [[tools]] synthesizer, Code Mode wiring, and the connector/auth seams that the binaries below build on. | | [pmcp-sql-server](crates/pmcp-sql-server) | Shape-A binary serving a SQL database (SQLite / Postgres / MySQL / Athena) from config.toml + a schema file. Ships a runnable [sqlite-explorer](crates/pmcp-sql-server/examples/sqlite-explorer.toml) example. | | [pmcp-openapi-server](crates/pmcp-openapi-server) | Shape-A binary serving any OpenAPI / HTTP backend, with six outgoing-auth models (incl. OAuth passthrough). Ships [london-tube](crates/pmcp-openapi-server/examples/london-tube.toml) (apikey) and [contoso-m365](crates/pmcp-openapi-server/examples/contoso-m365.toml) (oauthpassthrough, Microsoft Graph + Excel) examples. | | [pmcp-workbook-server](crates/pmcp-workbook-server) | Shape-A binary serving a governed Excel workbook as one named MCP tool per output table (e.g. calculate_tax, estimate_refund) plus infrastructure tools (explain / get_manifest / diff_version / render_workbook) from a compiled bundle@version directory alone — no config.toml, no schema. The Excel reader and JS code-mode are compile-time only and absent from the served binary (purity gate). | | [pmcp-toolkit-postgres](crates/pmcp-toolkit-postgres) / [-mysql](crates/pmcp-toolkit-mysql) / [-athena](crates/pmcp-toolkit-athena) | Per-backend SQL connectors for the toolkit. |
These binaries have cargo pmcp new --kind {sql-server,openapi-server,workbook-server} scaffold siblings that generate the same config-driven server as a small, deployable crate. See Path 1 above and the Config-Driven SQL Servers / OpenAPI / Config-Driven Workbook Servers chapters in the pmcp-book.
📚 pmcp-book (Reference Guide)
27-chapter comprehensive reference guide to building MCP servers with pmcp.
Coverage:
- Getting Started: Installation, first server, quick start tutorial
- Core Concepts: Tools, resources, prompts, error handling
- Advanced Features: Auth, transports, middleware, progress tracking
- Real-World: Production servers, testing, deployment, performance
- Examples & Patterns: Complete examples and design patterns
- TypeScript Migration: Complete compatibility guide
- Advanced Topics: Custom transports, AI-assisted development
Local development:
make book-serve # Serve at http://localhost:3000
make book-open # Build and open in browser
🎓 pmcp-course (Hands-On Learning)
Interactive course with quizzes, exercises, and real-world projects for mastering MCP development.
Course Structure:
- Part I: Foundations - MCP concepts, first server, typed tools
- Part II: Core Concepts - Tools, resources, prompts, validation
- Part III: Deployment - AWS Lambda, Cloudflare Workers, Google Cloud Run
- Part IV: Testing - Local testing, CI/CD, regression testing
- Part V: Security - OAuth 2.0, identity providers, multi-tenant
- Part VI: AI-Assisted Dev - Claude Code, feedback loops, collaboration
- Part VII: Observability - Middleware, logging, metrics
- Part VIII: Advanced - Server composition, MCP Apps (experimental)
Features:
- Interactive quizzes after each chapter
- Hands-on exercises with solutions
- Real-world project examples
- Best practices from production servers
Local development:
cd pmcp-course && mdbook serve # Serve at http://localhost:3000
🤖 ai-agents (AI-Assisted Development)
AI agent configurations that teach Kiro and Claude Code how to build MCP servers.
Supported AI Assistants:
Kiro (Steering Files) - 10,876 lines of persistent MCP expertise
- Always-active knowledge in every conversation
- Comprehensive testing and observability guidance
- [Installation Guide](ai-agents/kiro/mcp-developer-power/)
Claude Code (Subagent) - ~750 lines of focused MCP knowledge
- On-demand invocation for MCP tasks
- Quick scaffolding and implementation
- [Installation Guide](ai-agents/claude-code/)
What AI agents know:
- MCP protocol concepts and patterns
- cargo-pmcp workflow (never creates files manually)
- Type-safe tool implementation
- Testing strategies (unit, integration, property, fuzz)
- Production observability (logging, metrics)
- Toyota Way quality standards
Community implementations welcome:
- GitHub Copilot, Cursor, Cline, and others
- [Contribution Guide](ai-agents/README.md)
Learn more: AI-Assisted Development Course | [ai-agents/](ai-agents/)
🎨 MCP Apps (Rich UI Widgets)
Build rich HTML UI widgets served from MCP servers — works with ChatGPT, Claude, and other MCP clients.
What it does:
- Preview: Live widget preview with dual proxy/WASM bridge modes
- Author: File-based widgets in
widgets/directory with hot-reload - Scaffold:
cargo pmcp app newgenerates a complete MCP Apps project - Publish: ChatGPT-compatible manifest and standalone demo landing pages
- Test: 20 E2E browser tests via chromiumoxide CDP
Quick start:
# Scaffold a new MCP Apps project
cargo pmcp app new my-widget-app
cd my-widget-app
# Run the server
cargo run
# Preview in browser (separate terminal)
cargo pmcp preview --url http://localhost:3000 --open
# Generate deployment artifacts
cargo pmcp app build --url https://my-server.example.com
Examples:
- [Chess App](examples/mcp-apps-chess/) — Interactive chess board with move validation
- [Map App](examples/mcp-apps-map/) — Leaflet.js geospatial city explorer
- [Data Viz App](examples/mcp-apps-dataviz/) — Chart.js dashboard with SQL queries
Learn more: [Widget Runtime](packages/widget-runtime/) | [Preview Server](crates/mcp-preview/) | [E2E Tests](crates/mcp-e2e-tests/)
Latest Release: v2.0.0
PMCP v2.0 — aligned with the MCP TypeScript SDK v2.0 release (2026-03-22):
- Protocol v2025-11-25: Full alignment with the latest MCP specification, backward compatible with
2024-11-05 - MCP Apps: Rich interactive HTML UI widgets served from MCP servers — works with ChatGPT, Claude Desktop, and other MCP clients. Live preview with browser-style DevTools (resizable panel, network/events/protocol/bridge tabs)
- MCP Tasks: Experimental shared client/server state with DynamoDB-backed task lifecycle management and task variables
- Conformance Test Suite: 19-scenario conformance engine across 5 domains with
cargo pmcp test conformanceandmcp-tester conformanceCLI integration - Tower Middleware: DNS rebinding protection, CORS with origin-locked headers, configurable security headers — production-ready HTTP stack
- PMCP Server: MCP server exposing SDK developer tools (test, scaffold, schema export) via Streamable HTTP, deployed on AWS Lambda
- Uniform Constructor DX: Default impls, builders, and constructors for all protocol types — dramatically improved ergonomics
- 60+ Examples: Comprehensive coverage of all SDK features
Full changelog: [CHANGELOG.md](CHANGELOG.md)
Core Features
🚀 Transport Layer
- stdio: Standard input/output for CLI integration
- HTTP/SSE: Streamable HTTP with Server-Sent Events
- WebSocket: Full-duplex with auto-reconnection
- WASM: Browser and Cloudflare Workers support
🛠️ **Type-S
…
Source & license
This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: paiml
- Source: paiml/rust-mcp-sdk
- License: MIT
- Homepage: https://paiml.github.io/rust-mcp-sdk/
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.