[package]
edition = "2021"
rust-version = "1.83.0"
name = "pmcp"
version = "2.2.0"
authors = ["PAIML Team"]
build = false
exclude = [
"docs/",
"packages/",
"tests/playwright/",
"benches/*.bak",
"fuzz/",
"examples/mcp-apps-chess/",
"examples/mcp-apps-map/",
"examples/wasm-client/",
"examples/wasm-mcp-server/",
"examples/cloudflare-worker-mcp/",
"examples/26-server-tester/",
"examples/27-course-server-minimal/",
"examples/25-oauth-basic/",
"examples/test-basic/",
"examples/wasm/",
"pmcp-book/",
"pmcp-course/",
"examples/60_tasks_basic.rs",
"examples/62_task_workflow_lifecycle.rs",
"examples/65_durable_mcp_agent.rs",
".pmat/",
".pv/",
"contracts/",
".planning/",
"presentations/",
]
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "High-quality Rust SDK for Model Context Protocol (MCP) with full TypeScript SDK compatibility"
homepage = "https://github.com/paiml/pmcp"
documentation = "https://docs.rs/pmcp"
readme = "README.md"
keywords = [
"mcp",
"model-context",
"sdk",
"ai",
"llm",
]
categories = [
"api-bindings",
"asynchronous",
"network-programming",
]
license = "MIT"
repository = "https://github.com/paiml/pmcp"
[package.metadata.docs.rs]
all-features = true
rustdoc-args = [
"--cfg",
"docsrs",
]
[features]
authentication_example = []
cancellation_example = []
composition = ["streamable-http"]
default = ["logging"]
full = [
"websocket",
"http",
"streamable-http",
"sse",
"validation",
"resource-watcher",
"rayon",
"schema-generation",
"jwt-auth",
"composition",
"mcp-apps",
"http-client",
"logging",
"macros",
]
http = [
"dep:hyper",
"dep:hyper-util",
"dep:bytes",
]
http-client = ["dep:reqwest"]
jwt-auth = [
"http-client",
"dep:jsonwebtoken",
]
logging = ["dep:tracing-subscriber"]
macros = [
"dep:pmcp-macros",
"schema-generation",
]
mcp-apps = []
oauth = [
"http-client",
"dep:webbrowser",
"dep:dirs",
"dep:rand",
]
progress_example = []
rayon = ["dep:rayon"]
resource-watcher = [
"dep:notify",
"dep:glob-match",
]
schema-generation = ["dep:schemars"]
simd = []
sse = [
"http-client",
"dep:bytes",
]
streamable-http = [
"dep:hyper",
"dep:hyper-util",
"dep:hyper-rustls",
"dep:rustls",
"dep:futures-util",
"dep:bytes",
"dep:axum",
"dep:tower",
"dep:tower-http",
]
test-helpers = []
unstable = []
validation = [
"dep:jsonschema",
"dep:garde",
]
wasi-http = []
wasm = [
"websocket-wasm",
"uuid/js",
"dep:futures-channel",
"dep:futures-locks",
]
wasm-tokio = []
websocket = ["dep:tokio-tungstenite"]
websocket-wasm = []
[lib]
name = "pmcp"
path = "src/lib.rs"
[[example]]
name = "01_client_initialize"
path = "examples/01_client_initialize.rs"
[[example]]
name = "02_server_basic"
path = "examples/02_server_basic.rs"
[[example]]
name = "03_client_tools"
path = "examples/03_client_tools.rs"
[[example]]
name = "04_server_resources"
path = "examples/04_server_resources.rs"
[[example]]
name = "05_client_resources"
path = "examples/05_client_resources.rs"
[[example]]
name = "06_server_prompts"
path = "examples/06_server_prompts.rs"
[[example]]
name = "07_client_prompts"
path = "examples/07_client_prompts.rs"
[[example]]
name = "08_logging"
path = "examples/08_logging.rs"
[[example]]
name = "08_server_resources"
path = "examples/08_server_resources.rs"
[[example]]
name = "09_authentication"
path = "examples/09_authentication.rs"
required-features = ["authentication_example"]
[[example]]
name = "10_progress_notifications"
path = "examples/10_progress_notifications.rs"
required-features = ["progress_example"]
[[example]]
name = "11_progress_countdown"
path = "examples/11_progress_countdown.rs"
[[example]]
name = "11_request_cancellation"
path = "examples/11_request_cancellation.rs"
required-features = ["cancellation_example"]
[[example]]
name = "12_error_handling"
path = "examples/12_error_handling.rs"
[[example]]
name = "12_prompt_workflow_progress"
path = "examples/12_prompt_workflow_progress.rs"
[[example]]
name = "13_websocket_transport"
path = "examples/13_websocket_transport.rs"
required-features = ["websocket"]
[[example]]
name = "14_sampling_llm"
path = "examples/14_sampling_llm.rs"
[[example]]
name = "15_middleware"
path = "examples/15_middleware.rs"
[[example]]
name = "16_oauth_server"
path = "examples/16_oauth_server.rs"
[[example]]
name = "17_completable_prompts"
path = "examples/17_completable_prompts.rs"
[[example]]
name = "18_resource_watcher"
path = "examples/18_resource_watcher.rs"
required-features = ["resource-watcher"]
[[example]]
name = "19_elicit_input"
path = "examples/19_elicit_input.rs"
[[example]]
name = "20_oidc_discovery"
path = "examples/20_oidc_discovery.rs"
required-features = ["http-client"]
[[example]]
name = "22_streamable_http_server_stateful"
path = "examples/22_streamable_http_server_stateful.rs"
required-features = ["streamable-http"]
[[example]]
name = "23_streamable_http_server_stateless"
path = "examples/23_streamable_http_server_stateless.rs"
required-features = ["streamable-http"]
[[example]]
name = "24_streamable_http_client"
path = "examples/24_streamable_http_client.rs"
required-features = ["streamable-http"]
[[example]]
name = "27_websocket_server_enhanced"
path = "examples/27_websocket_server_enhanced.rs"
required-features = ["websocket"]
[[example]]
name = "28_sse_optimized"
path = "examples/28_sse_optimized.rs"
required-features = ["sse"]
[[example]]
name = "29_connection_pool"
path = "examples/29_connection_pool.rs"
required-features = ["full"]
[[example]]
name = "30_enhanced_middleware"
path = "examples/30_enhanced_middleware.rs"
required-features = ["full"]
[[example]]
name = "31_advanced_error_recovery"
path = "examples/31_advanced_error_recovery.rs"
required-features = ["full"]
[[example]]
name = "32_simd_parsing_performance"
path = "examples/32_simd_parsing_performance.rs"
[[example]]
name = "32_typed_tools"
path = "examples/32_typed_tools.rs"
required-features = ["schema-generation"]
[[example]]
name = "33_advanced_typed_tools"
path = "examples/33_advanced_typed_tools.rs"
required-features = ["schema-generation"]
[[example]]
name = "34_serverbuilder_typed"
path = "examples/34_serverbuilder_typed.rs"
required-features = ["schema-generation"]
[[example]]
name = "35_wasm_typed_tools"
path = "examples/35_wasm_typed_tools.rs"
required-features = ["schema-generation"]
[[example]]
name = "36_typed_tool_v2_example"
path = "examples/36_typed_tool_v2_example.rs"
required-features = ["schema-generation"]
[[example]]
name = "37_description_variants_example"
path = "examples/37_description_variants_example.rs"
required-features = ["schema-generation"]
[[example]]
name = "40_middleware_demo"
path = "examples/40_middleware_demo.rs"
[[example]]
name = "47_multiple_clients_parallel"
path = "examples/47_multiple_clients_parallel.rs"
[[example]]
name = "48_structured_output_schema"
path = "examples/48_structured_output_schema.rs"
[[example]]
name = "49_tool_with_sampling_server"
path = "examples/49_tool_with_sampling_server.rs"
required-features = ["full"]
[[example]]
name = "50_workflow_minimal"
path = "examples/50_workflow_minimal.rs"
[[example]]
name = "51_workflow_error_messages"
path = "examples/51_workflow_error_messages.rs"
[[example]]
name = "52_workflow_dsl_cookbook"
path = "examples/52_workflow_dsl_cookbook.rs"
[[example]]
name = "53_typed_tools_workflow_integration"
path = "examples/53_typed_tools_workflow_integration.rs"
required-features = ["schema-generation"]
[[example]]
name = "54_hybrid_workflow_execution"
path = "examples/54_hybrid_workflow_execution.rs"
[[example]]
name = "55_server_middleware"
path = "examples/55_server_middleware.rs"
required-features = ["streamable-http"]
[[example]]
name = "56_dynamic_resources"
path = "examples/56_dynamic_resources.rs"
[[example]]
name = "57_tool_middleware_oauth"
path = "examples/57_tool_middleware_oauth.rs"
[[example]]
name = "58_oauth_transport_to_tools"
path = "examples/58_oauth_transport_to_tools.rs"
[[example]]
name = "59_dynamic_resource_workflow"
path = "examples/59_dynamic_resource_workflow.rs"
[[example]]
name = "60_resource_only_steps"
path = "examples/60_resource_only_steps.rs"
[[example]]
name = "61_observability_middleware"
path = "examples/61_observability_middleware.rs"
[[example]]
name = "63_mcp_tool_macro"
path = "examples/63_mcp_tool_macro.rs"
required-features = ["full"]
[[example]]
name = "64_mcp_prompt_macro"
path = "examples/64_mcp_prompt_macro.rs"
required-features = ["full"]
[[example]]
name = "client"
path = "examples/client.rs"
[[example]]
name = "conference_venue_map"
path = "examples/conference_venue_map.rs"
required-features = ["schema-generation"]
[[example]]
name = "currency_server"
path = "examples/currency_server.rs"
[[example]]
name = "hotel_gallery"
path = "examples/hotel_gallery.rs"
required-features = ["schema-generation"]
[[example]]
name = "refactored_server_example"
path = "examples/refactored_server_example.rs"
[[example]]
name = "server"
path = "examples/server.rs"
[[example]]
name = "test_currency_server"
path = "examples/test_currency_server.rs"
[[test]]
name = "advanced_error_recovery_tests"
path = "tests/advanced_error_recovery_tests.rs"
[[test]]
name = "auth_context_integration_test"
path = "tests/auth_context_integration_test.rs"
[[test]]
name = "connection_pool_tests"
path = "tests/connection_pool_tests.rs"
[[test]]
name = "enhanced_middleware_tests"
path = "tests/enhanced_middleware_tests.rs"
[[test]]
name = "http_json_rpc_compatibility"
path = "tests/http_json_rpc_compatibility.rs"
[[test]]
name = "http_middleware_integration"
path = "tests/http_middleware_integration.rs"
[[test]]
name = "json_rpc_compatibility"
path = "tests/json_rpc_compatibility.rs"
[[test]]
name = "new_features"
path = "tests/new_features.rs"
[[test]]
name = "notification_properties"
path = "tests/notification_properties.rs"
[[test]]
name = "prompt_info_serialization_test"
path = "tests/prompt_info_serialization_test.rs"
[[test]]
name = "property_tests"
path = "tests/property_tests.rs"
[[test]]
name = "protect_tool_fix"
path = "tests/protect_tool_fix.rs"
[[test]]
name = "protocol_invariants"
path = "tests/protocol_invariants.rs"
[[test]]
name = "server_protocol_ordering_tests"
path = "tests/server_protocol_ordering_tests.rs"
[[test]]
name = "server_subscriptions"
path = "tests/server_subscriptions.rs"
[[test]]
name = "session_validation_tests"
path = "tests/session_validation_tests.rs"
[[test]]
name = "simd_parsing_tests"
path = "tests/simd_parsing_tests.rs"
[[test]]
name = "sse_middleware_integration"
path = "tests/sse_middleware_integration.rs"
[[test]]
name = "sse_optimization_tests"
path = "tests/sse_optimization_tests.rs"
[[test]]
name = "sse_parser_tests"
path = "tests/sse_parser_tests.rs"
[[test]]
name = "state_machine_properties"
path = "tests/state_machine_properties.rs"
[[test]]
name = "streamable_http_integration"
path = "tests/streamable_http_integration.rs"
[[test]]
name = "streamable_http_oauth_integration"
path = "tests/streamable_http_oauth_integration.rs"
[[test]]
name = "streamable_http_properties"
path = "tests/streamable_http_properties.rs"
[[test]]
name = "streamable_http_server_tests"
path = "tests/streamable_http_server_tests.rs"
[[test]]
name = "streamable_http_spec_compliance"
path = "tests/streamable_http_spec_compliance.rs"
[[test]]
name = "streamable_http_unit_tests"
path = "tests/streamable_http_unit_tests.rs"
[[test]]
name = "test_batch_requests"
path = "tests/test_batch_requests.rs"
[[test]]
name = "test_cancellation"
path = "tests/test_cancellation.rs"
[[test]]
name = "test_roots"
path = "tests/test_roots.rs"
[[test]]
name = "test_websocket_server"
path = "tests/test_websocket_server.rs"
[[test]]
name = "tool_annotations_test"
path = "tests/tool_annotations_test.rs"
[[test]]
name = "tool_with_sampling_tests"
path = "tests/tool_with_sampling_tests.rs"
[[test]]
name = "toolresult_export_tests"
path = "tests/toolresult_export_tests.rs"
[[test]]
name = "toolresult_property_tests"
path = "tests/toolresult_property_tests.rs"
[[test]]
name = "transport"
path = "tests/transport.rs"
[[test]]
name = "transport_isolation_properties"
path = "tests/transport_isolation_properties.rs"
[[test]]
name = "transport_properties"
path = "tests/transport_properties.rs"
[[test]]
name = "typed_tool_sse_test"
path = "tests/typed_tool_sse_test.rs"
[[test]]
name = "typed_tool_tests"
path = "tests/typed_tool_tests.rs"
[[test]]
name = "typed_tool_transport_e2e"
path = "tests/typed_tool_transport_e2e.rs"
[[test]]
name = "typescript_interop"
path = "tests/typescript_interop.rs"
[[test]]
name = "websocket_property_tests"
path = "tests/websocket_property_tests.rs"
[[test]]
name = "workflow_prompt_e2e_test"
path = "tests/workflow_prompt_e2e_test.rs"
[[bench]]
name = "client_server_operations"
path = "benches/client_server_operations.rs"
harness = false
[[bench]]
name = "comprehensive_benchmarks"
path = "benches/comprehensive_benchmarks.rs"
harness = false
[[bench]]
name = "json_performance"
path = "benches/json_performance.rs"
harness = false
[[bench]]
name = "protocol_serialization"
path = "benches/protocol_serialization.rs"
harness = false
[[bench]]
name = "simd_performance"
path = "benches/simd_performance.rs"
harness = false
[[bench]]
name = "simple_test"
path = "benches/simple_test.rs"
harness = false
[[bench]]
name = "transport_performance"
path = "benches/transport_performance.rs"
harness = false
[dependencies.anyhow]
version = "1.0"
[dependencies.async-trait]
version = "0.1"
[dependencies.axum]
version = "0.8.5"
optional = true
[dependencies.base64]
version = "0.22"
[dependencies.bytes]
version = "1.10"
optional = true
[dependencies.chrono]
version = "0.4"
features = [
"clock",
"serde",
"std",
]
default-features = false
[dependencies.dashmap]
version = "6.1"
[dependencies.dirs]
version = "6"
optional = true
[dependencies.futures]
version = "0.3"
[dependencies.futures-channel]
version = "0.3"
optional = true
[dependencies.futures-locks]
version = "0.7"
optional = true
default-features = false
[dependencies.futures-util]
version = "0.3"
optional = true
[dependencies.garde]
version = "0.22"
optional = true
[dependencies.glob]
version = "0.3"
[dependencies.glob-match]
version = "0.2"
optional = true
[dependencies.http]
version = "1.1"
[dependencies.http-body-util]
version = "0.1"
[dependencies.hyper]
version = "1.6"
features = [
"http1",
"server",
]
optional = true
[dependencies.hyper-rustls]
version = "0.27"
features = [
"http1",
"http2",
"tls12",
"ring",
"native-tokio",
]
optional = true
default-features = false
[dependencies.hyper-util]
version = "0.1"
features = [
"tokio",
"http1",
"server-auto",
"client-legacy",
]
optional = true
[dependencies.indexmap]
version = "2.10"
features = ["serde"]
[dependencies.jsonschema]
version = "0.45"
optional = true
default-features = false
[dependencies.jsonwebtoken]
version = "10.3"
optional = true
[dependencies.notify]
version = "8.2"
optional = true
[dependencies.parking_lot]
version = "0.12"
[dependencies.pmcp-macros]
version = "0.4.1"
optional = true
[dependencies.pmcp-widget-utils]
version = "0.1.0"
[dependencies.rand]
version = "0.10"
optional = true
[dependencies.rayon]
version = "1.10"
optional = true
[dependencies.regex]
version = "1.11"
[dependencies.rustls]
version = "0.23"
features = [
"ring",
"std",
"tls12",
]
optional = true
default-features = false
[dependencies.schemars]
version = "1.0"
optional = true
[dependencies.serde]
version = "1.0"
features = ["derive"]
[dependencies.serde_json]
version = "1.0"
features = [
"raw_value",
"preserve_order",
]
[dependencies.sha2]
version = "0.11"
[dependencies.smallvec]
version = "1.13"
features = [
"serde",
"union",
]
[dependencies.thiserror]
version = "2.0"
[dependencies.tokio-tungstenite]
version = "0.29"
optional = true
[dependencies.toml]
version = "1.0"
[dependencies.tower]
version = "0.5"
optional = true
[dependencies.tower-http]
version = "0.6"
features = [
"cors",
"set-header",
]
optional = true
[dependencies.tracing]
version = "0.1"
[dependencies.tracing-subscriber]
version = "0.3.20"
features = ["env-filter"]
optional = true
[dependencies.url]
version = "2.5"
[dependencies.urlencoding]
version = "2.1"
[dependencies.uuid]
version = "1.17"
features = [
"v4",
"serde",
"js",
]
[dependencies.webbrowser]
version = "1"
optional = true
[dev-dependencies.clap]
version = "4.5"
features = ["derive"]
[dev-dependencies.criterion]
version = "0.8"
features = ["html_reports"]
[dev-dependencies.dashmap]
version = "6.1"
[dev-dependencies.env_logger]
version = "0.11"
[dev-dependencies.insta]
version = "1.43"
features = [
"json",
"redactions",
]
[dev-dependencies.mockall]
version = "0.14"
[dev-dependencies.mockito]
version = "1.5.0"
[dev-dependencies.pmcp-macros]
version = "0.4.1"
[dev-dependencies.pretty_assertions]
version = "1.4"
[dev-dependencies.proptest]
version = "1.7"
[dev-dependencies.quickcheck]
version = "1.0"
[dev-dependencies.quickcheck_macros]
version = "1.1"
[dev-dependencies.rstest]
version = "0.26"
[dev-dependencies.tempfile]
version = "3.19"
[dev-dependencies.test-case]
version = "3.3"
[dev-dependencies.tokio-util]
version = "0.7"
features = ["rt"]
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.reqwest]
version = "0.13"
features = [
"json",
"rustls",
"form",
]
optional = true
default-features = false
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.tokio]
version = "1.46"
features = [
"rt-multi-thread",
"macros",
"net",
"io-util",
"io-std",
"fs",
"sync",
"time",
"process",
"signal",
]
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.tokio-stream]
version = "0.1.15"
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.tokio-util]
version = "0.7"
features = ["rt"]
[target.'cfg(target_arch = "wasm32")'.dependencies.futures-channel]
version = "0.3"
[target.'cfg(target_arch = "wasm32")'.dependencies.futures-locks]
version = "0.7"
default-features = false
[target.'cfg(target_arch = "wasm32")'.dependencies.getrandom]
version = "0.4"
features = ["wasm_js"]
[target.'cfg(target_arch = "wasm32")'.dependencies.js-sys]
version = "0.3"
[target.'cfg(target_arch = "wasm32")'.dependencies.wasm-bindgen]
version = "0.2"
[target.'cfg(target_arch = "wasm32")'.dependencies.wasm-bindgen-futures]
version = "0.4"
[target.'cfg(target_arch = "wasm32")'.dependencies.web-sys]
version = "0.3"
features = [
"console",
"Window",
"Document",
"WebSocket",
"MessageEvent",
"CloseEvent",
"ErrorEvent",
"BinaryType",
"Headers",
"Request",
"RequestInit",
"Response",
]
[profile.bench]
opt-level = 3
codegen-units = 1
debug = 2
[profile.release]
opt-level = 3
codegen-units = 1
strip = true