[[bench]]
harness = false
name = "client_server_operations"
path = "benches/client_server_operations.rs"
[[bench]]
harness = false
name = "comprehensive_benchmarks"
path = "benches/comprehensive_benchmarks.rs"
[[bench]]
harness = false
name = "json_performance"
path = "benches/json_performance.rs"
[[bench]]
harness = false
name = "protocol_serialization"
path = "benches/protocol_serialization.rs"
[[bench]]
harness = false
name = "simd_performance"
path = "benches/simd_performance.rs"
[[bench]]
harness = false
name = "simple_test"
path = "benches/simple_test.rs"
[[bench]]
harness = false
name = "transport_performance"
path = "benches/transport_performance.rs"
[dependencies.anyhow]
version = "1.0"
[dependencies.async-trait]
version = "0.1"
[dependencies.axum]
optional = true
version = "0.8.5"
[dependencies.base64]
version = "0.22"
[dependencies.bytes]
optional = true
version = "1.10"
[dependencies.chrono]
features = ["serde"]
version = "0.4"
[dependencies.dashmap]
version = "6.1"
[dependencies.futures]
version = "0.3"
[dependencies.futures-channel]
optional = true
version = "0.3"
[dependencies.futures-locks]
optional = true
version = "0.7"
[dependencies.futures-util]
optional = true
version = "0.3"
[dependencies.glob-match]
optional = true
version = "0.2"
[dependencies.http]
version = "1.1"
[dependencies.http-body-util]
version = "0.1"
[dependencies.hyper]
features = ["full"]
optional = true
version = "1.6"
[dependencies.hyper-util]
features = ["full"]
optional = true
version = "0.1"
[dependencies.indexmap]
features = ["serde"]
version = "2.10"
[dependencies.lazy_static]
version = "1.5"
[dependencies.notify]
optional = true
version = "8.2"
[dependencies.parking_lot]
version = "0.12"
[dependencies.pin-project]
version = "1.1"
[dependencies.regex]
version = "1.11"
[dependencies.schemars]
optional = true
version = "1.0"
[dependencies.serde]
features = ["derive"]
version = "1.0"
[dependencies.serde_json]
features = ["raw_value", "preserve_order"]
version = "1.0"
[dependencies.sha2]
version = "0.10"
[dependencies.smallvec]
features = ["serde", "union"]
version = "1.13"
[dependencies.thiserror]
version = "2.0"
[dependencies.tokio-tungstenite]
features = ["native-tls"]
optional = true
version = "0.28"
[dependencies.tracing]
version = "0.1"
[dependencies.tracing-subscriber]
features = ["env-filter"]
version = "0.3.20"
[dependencies.url]
version = "2.5"
[dependencies.urlencoding]
version = "2.1"
[dependencies.uuid]
features = ["v4", "serde", "js"]
version = "1.17"
[dev-dependencies.clap]
features = ["derive"]
version = "4.5"
[dev-dependencies.criterion]
features = ["html_reports"]
version = "0.7"
[dev-dependencies.dashmap]
version = "6.1"
[dev-dependencies.env_logger]
version = "0.11"
[dev-dependencies.insta]
features = ["json", "redactions"]
version = "1.43"
[dev-dependencies.mockall]
version = "0.13"
[dev-dependencies.mockito]
version = "1.5.0"
[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.test-case]
version = "3.3"
[dev-dependencies.tokio-util]
features = ["rt"]
version = "0.7"
[[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"
[[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 = "client"
path = "examples/client.rs"
[[example]]
name = "currency_server"
path = "examples/currency_server.rs"
[[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"
[features]
authentication_example = []
cancellation_example = []
default = ["validation"]
full = ["websocket", "http", "streamable-http", "sse", "validation", "resource-watcher", "rayon", "schema-generation"]
http = ["dep:hyper", "dep:hyper-util", "dep:bytes"]
progress_example = []
rayon = ["dep:rayon"]
resource-watcher = ["dep:notify", "dep:glob-match"]
schema-generation = ["dep:schemars"]
simd = []
sse = ["dep:bytes"]
streamable-http = ["dep:hyper", "dep:hyper-util", "dep:futures-util", "dep:bytes", "dep:axum"]
test-helpers = []
unstable = []
validation = ["dep:jsonschema", "dep:garde"]
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"
[package]
authors = ["PAIML Team"]
autobenches = false
autobins = false
autoexamples = false
autolib = false
autotests = false
build = false
categories = ["api-bindings", "asynchronous", "network-programming"]
description = "High-quality Rust SDK for Model Context Protocol (MCP) with full TypeScript SDK compatibility"
documentation = "https://docs.rs/pmcp"
edition = "2021"
homepage = "https://github.com/paiml/pmcp"
keywords = ["mcp", "model-context", "sdk", "ai", "llm"]
license = "MIT"
name = "pmcp"
readme = "README.md"
repository = "https://github.com/paiml/pmcp"
rust-version = "1.82.0"
version = "1.8.2"
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
[profile.bench]
codegen-units = 1
debug = 2
opt-level = 3
[profile.release]
codegen-units = 1
opt-level = 3
strip = true
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.reqwest]
default-features = false
features = ["json", "rustls-tls"]
version = "0.12"
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.tokio]
features = ["full"]
version = "1.46"
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.tokio-stream]
version = "0.1.15"
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.tokio-util]
features = ["rt"]
version = "0.7"
[target.'cfg(target_arch = "wasm32")'.dependencies.futures-channel]
version = "0.3"
[target.'cfg(target_arch = "wasm32")'.dependencies.futures-locks]
version = "0.7"
[target.'cfg(target_arch = "wasm32")'.dependencies.garde]
optional = true
version = "0.22"
[target.'cfg(target_arch = "wasm32")'.dependencies.getrandom]
features = ["js"]
version = "0.2"
[target.'cfg(target_arch = "wasm32")'.dependencies.glob-match]
optional = true
version = "0.2"
[target.'cfg(target_arch = "wasm32")'.dependencies.hyper]
features = ["full"]
optional = true
version = "1.6"
[target.'cfg(target_arch = "wasm32")'.dependencies.hyper-util]
features = ["full"]
optional = true
version = "0.1"
[target.'cfg(target_arch = "wasm32")'.dependencies.js-sys]
version = "0.3"
[target.'cfg(target_arch = "wasm32")'.dependencies.jsonschema]
optional = true
version = "0.32"
[target.'cfg(target_arch = "wasm32")'.dependencies.notify]
optional = true
version = "8.2"
[target.'cfg(target_arch = "wasm32")'.dependencies.rayon]
optional = true
version = "1.10"
[target.'cfg(target_arch = "wasm32")'.dependencies.tokio-tungstenite]
optional = true
version = "0.27"
[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]
features = ["console", "Window", "Document", "WebSocket", "MessageEvent", "CloseEvent", "ErrorEvent", "BinaryType", "Headers", "Request", "RequestInit", "Response"]
version = "0.3"
[[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_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"