
Pmcp
io.github.paiml由 GitHub 帳號 paiml 發布v2.23.0更新於 Oct 30, 2026
High-quality Rust SDK for Model Context Protocol (MCP) with full TypeScript SDK compatibility
概覽
PMCP 是一套 Rust SDK 與命令列工具,用來建置、測試與部署 MCP 伺服器,包含由設定驅動的 SQL、OpenAPI 與 Excel 活頁簿伺服器。
- 可以做什麼
- 透過 cargo-pmcp 命令列建立、執行與測試 MCP 伺服器,含範本、熱重載開發模式、自動產生情境測試、負載測試與安全稽核
- 以 Rust 撰寫型別安全的伺服器,自動產生 JSON schema,支援多種傳輸方式與 OAuth 內容透傳
- 只靠設定檔就把 SQL 資料庫、OpenAPI/HTTP 後端或受治理的 Excel 活頁簿提供為 MCP 工具,不必撰寫 Rust
- 依套件清單建置並執行代理與小型代理團隊,可使用本機或 OpenAI 相容的模型來源
- 預覽與發佈 MCP Apps HTML 元件,並把伺服器部署到 AWS Lambda、Cloud Run 或 Cloudflare
- 適用情境
- 適合需要自行建立、測試、強化或部署 MCP 伺服器的情境,也適合以設定而非寫程式,把現有 SQL 資料庫、REST API 或 Excel 活頁簿暴露成 MCP 工具。
- 執行需求
- 以本機程序方式在使用者電腦上執行。建置與執行工具鏈需要 Rust 工具鏈(Rust 1.83.0 以上)與 Git,命令列工具以 cargo install cargo-pmcp 安裝。設定驅動的伺服器可能需要透過環境變數提供資料庫憑證或後端 API 金鑰,代理連線託管模型時需要模型端點或金鑰。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Pmcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
PMCP - Pragmatic Model Context Protocol
[Quality Gate] [TDG Score] [Complexity] [Technical Debt]
[CI] [Coverage] [Crates.io] [Documentation] [License: MIT] [Rust 1.83+] [MCP Compatible]
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) - 🤝 Agents & Teams - Build deploy-anywhere agents and small teams: the agent loop (
pmcp-agent), four reference team servers (pmcp-team-servers), and a portable AI-Package format (pmcp-package) — driven from thecargo pmcp agent/team/packageverbs - 🦀 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):
OpenAPI / HTTP — any REST backend, with six outgoing-auth models including OAuth passthrough (the server holds no standing credential and forwards the caller's own token, so it can only act as the signed-in user):
Excel workbook — a governed spreadsheet, served as one MCP tool per output table (no config.toml, no schema; the single input is a compiled bundle@version directory). Author inputs and outputs as named Excel Tables and each output table becomes its own well-named, well-typed MCP tool with a DAG-derived input schema:
Want to extend and deploy it? cargo pmcp new my-server --kind sql-server (or --kind openapi-server / --kind workbook-server) scaffolds the same config-driven server as a small crate, ready for cargo pmcp deploy to AWS Lambda / Google Cloud Run / Cloudflare / pmcp.run.
Learn more: the Config-Driven SQL Servers, OpenAPI, and Config-Driven Workbook Servers chapters in the pmcp-book · pmcp-sql-server · pmcp-openapi-server · pmcp-workbook-server · pmcp-server-toolkit
🚀 Path 2: AI-Assisted (Recommended for Rapid Prototyping)
Build production-ready MCP servers with AI assistance in minutes:
Prerequisites:
Install Claude Code AI Agent:
Build your server:
What you get: Production-ready code following Toyota Way principles, with comprehensive tests, structured logging, metrics collection, and zero clippy warnings.
Learn more: AI-Assisted Development Course | AI Agents README
⚡ Path 3: cargo-pmcp Toolkit (Recommended for Manual Development)
Scaffold and build servers using the cargo-pmcp CLI:
Installation:
Create a server:
Available templates (cargo pmcp add server <name> --template <t>):
minimal- Empty structure for custom serverscalculator- Arithmetic operations (learning)complete_calculator- Full-featured reference implementationsqlite_explorer- Hand-coded Rust database browser (escape hatch)
Config-driven kinds (cargo pmcp new <name> --kind <k> — TOML-driven, no per-tool Rust):
sql-server- SQL MCP server over SQLite / Postgres / MySQL / Athena fromconfig.tomlopenapi-server- MCP server over any OpenAPI / HTTP backend fromconfig.tomlworkbook-server- MCP server over a governed Excel workbook, served from a compiledbundle@versiondirectory
Learn more: cargo-pmcp Guide
🦀 Path 4: pmcp SDK Directly (For Fine-Grained Control)
Use the pmcp crate directly for maximum control:
Installation:
Type-safe server example:
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 — see the Task-Augmented Tool Results (SEP-1686) chapter for returning a
CallToolResultthat points at a related task - 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:
⚡ cargo-pmcp (CLI Toolkit)
Full-lifecycle development toolkit — from scaffolding to production deployment.
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
🧩 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.
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:
🎓 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:
🤖 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
Claude Code (Subagent) - ~750 lines of focused MCP knowledge
- On-demand invocation for MCP tasks
- Quick scaffolding and implementation
- Installation Guide
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
Learn more: AI-Assisted Development Course | 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:
Examples:
- Chess App — Interactive chess board with move validation
- Map App — Leaflet.js geospatial city explorer
- Data Viz App — Chart.js dashboard with SQL queries
Learn more: Widget Runtime | Preview Server | E2E Tests
Agents & Teams
Everything so far builds MCP servers — things that wait to be called. An agent is the other side: it owns a decision loop, so it is an MCP client. PMCP ships that loop as a crate and scaffolds it from the CLI, so you can watch an agent make decisions before writing any Rust.
The agent's identity — instructions, model slot, token and iteration limits — lives in
an agent.package.json manifest, not in code, so the same package moves from your
laptop to a deployment unedited. Only --source changes when you swap where completions
come from; the loop does not.
The crates behind it:
- 🤖
pmcp-agent- TheAgentEngineloop over three seams (completion source, tool invoker, store), plusAgentServerfor exposing an agent as an MCP tool that is sampled by its caller - 👥
pmcp-team-servers- Four reference team servers and the in-process composition runtimecargo pmcp team devdrives - 📦
pmcp-package- The portable AI-Package format (AgentPackage,TeamPackage) that makes an agent a description rather than a binary
Learn more: Chapter 12.15: Agents as MCP Clients | pmcp-agent | pmcp-team-servers
Protocol Versions
PMCP speaks two MCP protocol eras out of one binary: v1 (2025-11-25) and v2
(2026-07-28). The era is negotiated per request, not per process — the same server answers a
v1 client with sessions and a v2 client without them, concurrently, on the same port. You do not
run two fleets, and you do not choose an era at build time.
Throughout this project an era is written v1/v2 with its date string, while the crate is always
written with its name attached — "pmcp 2.18". A bare version number never means a protocol era.
Opting in, by role:
- Servers — one explicit call,
ServerBuilder::with_supported_protocol_versions(...), listing your v1 version alongsidePROTOCOL_VERSION_2026_07_28. The default accept-list is v1-only by design, so upgrading the crate alone leaves a server answering v1 only. Seeexamples/s47_v2_stateless_mrtr.rs. - Clients — one explicit call,
ClientBuilder::with_protocol_version(...). Without it a client stays on v1, exactly as before. - Agents — already done for you.
pmcp-agent's invoker prefers v2 and falls back to v1, so an agent scaffolded withcargo pmcp agent newspeaks v2 wherever the server supports it.
There is also a server-side lever in the opposite direction — opting out of v1:
--no-default-features on its own proves nothing (it also strips the HTTP transport, so v1 would
appear severed only because nothing was compiled). full-v2 is the positive feature list: exactly
what full carries, minus v1-compat.
Learn more: Chapter 12.17: Migrating to MCP 2026-07-28 (v2) | v1 sunset policy
Latest Release: pmcp 2.18.0
Published 2026-08-16. The in-flight line is pmcp 2.19.0, still unreleased — its entry at the top of the changelog is the authoritative list of what is landing next.
- Two protocol eras, one binary: pmcp serves both MCP
2025-11-25(v1) and2026-07-28(v2), negotiated per request — see Protocol Versions above - Credential storage (2.18.0): one machine, one credential store —
pmcp::shared::credential_storeaddressed by(issuer, account, server), with an on-diskFileCredentialStorethatcargo pmcp authwrites through - Agents & Teams: the
pmcp-agentloop, four reference team servers, and the portable AI-Package format — see Agents & Teams above - 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: Shared client/server task lifecycle with pluggable stores (in-memory and DynamoDB) and task variables — the v2 shape is an extension and is still provisional
- 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
- 85 examples in
examples/: runnable coverage of the SDK surface (119 example targets across the whole workspace)
Full changelog: 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-Safe Development
- Automatic Schema Generation: From Rust types using
schemars - Compile-Time Validation: Type-checked tool arguments
- Runtime Validation: Against generated JSON schemas
- Zero Unwraps: Explicit error handling throughout
🔐 Security & Auth
- OAuth 2.0: Full auth context pass-through
- OIDC Discovery: Automatic provider configuration
- Bearer Tokens: Standard authentication
- Path Validation: Secure file system access
🧪 Testing & Quality
- mcp-tester: Comprehensive server testing tool
- Scenario Generation: Auto-generate test cases
- Property Testing: Invariant validation
- Quality Gates: fmt, clippy, coverage enforcement
⚡ Performance
- 16x faster than TypeScript SDK
- 50x lower memory usage
- SIMD Parsing: 10.3x SSE speedup with AVX2/SSE4.2
- Connection Pooling: Smart load balancing
🏭 Toyota Way Quality
- Zero Technical Debt: TDG score 0.76
- Jidoka: Stop the line on defects
- Genchi Genbutsu: Go and see (evidence-based)
- Kaizen: Continuous improvement
- No Unwraps: Explicit error handling only
Documentation
📖 Primary Resources
- PMCP Documentation Portal - Landing page for all documentation
- pmcp-book - Comprehensive reference guide (27 chapters)
- pmcp-course - Hands-on course with quizzes and exercises
- API Reference - Complete API documentation
- cargo-pmcp Guide - CLI toolkit documentation
📚 Additional Resources
- Examples - 85 working examples in
examples/(119 example targets workspace-wide) - CHANGELOG - Version history
- Migration Guides - Upgrade instructions
- Contributing - How to contribute
🎯 Quick Links
Examples
The SDK ships 85 runnable examples in examples/ — 119 example targets across the
whole workspace — covering the full SDK surface:
See examples/README.md for complete list.
MCP Server Tester
Comprehensive testing tool for validating MCP server implementations.
Features:
- Protocol compliance validation (JSON-RPC 2.0, MCP spec)
- Multi-transport support (HTTP, HTTPS, WebSocket, stdio)
- Tool discovery and testing
- CI/CD ready with JSON output
Installation:
Usage:
Learn more: examples/26-server-tester/README.md
Quality & Performance
Toyota Way Principles
PMCP is built following Toyota Production System principles:
-
Jidoka (自働化): Automation with human touch
- Quality gates stop builds on defects
- Zero tolerance for
unwrap()in production - Comprehensive error handling with context
-
Genchi Genbutsu (現地現物): Go and see
- Evidence-based decisions with metrics
- PMAT quality analysis (TDG score 0.76)
- Comprehensive testing (unit, property, fuzz)
-
Kaizen (改善): Continuous improvement
- Regular benchmarking and optimization
- Performance regression prevention
- Community-driven enhancements
Quality Metrics
- TDG Score: 0.76 (production-ready)
- Technical Debt: Minimal (436h across entire codebase)
- Complexity: All functions ≤25 complexity
- Coverage: 52% line coverage, 100% function coverage
- Linting: Zero clippy warnings in production code
Performance Benchmarks
Run benchmarks:
WebAssembly Support
Full WASM support for browser and edge deployment:
Targets:
- Cloudflare Workers (wasm32-unknown-unknown)
- WASI Runtimes (wasm32-wasi)
- Browser (wasm-bindgen)
Quick start:
Learn more: WASM Guide | WASM Example
Development
Prerequisites
- Rust 1.83.0 or later
- Git
Setup
Testing
Contributing
We welcome contributions! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Ensure quality gates pass (
make quality-gate) - Commit with conventional commits
- Push and open a Pull Request
See: CONTRIBUTING.md
Compatibility
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Model Context Protocol specification
- TypeScript SDK for reference implementation
- PAIML MCP Agent Toolkit for quality standards
- Community contributors and early adopters
Links
- Documentation Portal: https://paiml.github.io/rust-mcp-sdk/
- Reference Guide: https://paiml.github.io/rust-mcp-sdk/book/
- Course: https://paiml.github.io/rust-mcp-sdk/course/
- Crates.io: https://crates.io/crates/pmcp
- API Docs: https://docs.rs/pmcp
- Issues: https://github.com/paiml/rust-mcp-sdk/issues
- Discussions: https://github.com/paiml/rust-mcp-sdk/discussions
Built with 🦀 Rust and ❤️ following Toyota Way principles
來源:README.md,提交 c639881
工具
0版本歷史
10- v2.23.0最新Oct 29, 2026
- v2.22.7Oct 4, 2026
- v2.22.6Oct 4, 2026
- v2.22.5Oct 3, 2026
- v2.22.4Oct 2, 2026
- v2.22.2Oct 1, 2026
- v2.22.1Sep 30, 2026
- v2.21.1Sep 30, 2026
- v2.21.0Sep 29, 2026
- v1.10.3Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分