[package]
edition = "2021"
rust-version = "1.83.0"
name = "pmcp"
version = "2.3.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]
features = [
"composition",
"http",
"http-client",
"jwt-auth",
"macros",
"mcp-apps",
"oauth",
"rayon",
"resource-watcher",
"schema-generation",
"simd",
"sse",
"streamable-http",
"validation",
"websocket",
]
targets = [
"x86_64-unknown-linux-gnu",
"aarch64-unknown-linux-gnu",
]
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 = "c01_client_initialize"
path = "examples/c01_client_initialize.rs"
[[example]]
name = "c02_client_tools"
path = "examples/c02_client_tools.rs"
[[example]]
name = "c03_client_resources"
path = "examples/c03_client_resources.rs"
[[example]]
name = "c04_client_prompts"
path = "examples/c04_client_prompts.rs"
[[example]]
name = "c05_client"
path = "examples/c05_client.rs"
[[example]]
name = "c06_multiple_clients_parallel"
path = "examples/c06_multiple_clients_parallel.rs"
[[example]]
name = "c07_oidc_discovery"
path = "examples/c07_oidc_discovery.rs"
required-features = ["http-client"]
[[example]]
name = "m01_basic_middleware"
path = "examples/m01_basic_middleware.rs"
[[example]]
name = "m02_enhanced_middleware"
path = "examples/m02_enhanced_middleware.rs"
required-features = ["full"]
[[example]]
name = "m03_middleware_demo"
path = "examples/m03_middleware_demo.rs"
[[example]]
name = "m04_server_http_middleware"
path = "examples/m04_server_http_middleware.rs"
required-features = ["streamable-http"]
[[example]]
name = "m05_tool_middleware_oauth"
path = "examples/m05_tool_middleware_oauth.rs"
[[example]]
name = "m06_oauth_transport_to_tools"
path = "examples/m06_oauth_transport_to_tools.rs"
[[example]]
name = "m07_advanced_error_recovery"
path = "examples/m07_advanced_error_recovery.rs"
required-features = ["full"]
[[example]]
name = "m08_observability_middleware"
path = "examples/m08_observability_middleware.rs"
[[example]]
name = "s01_basic_server"
path = "examples/s01_basic_server.rs"
[[example]]
name = "s02_server"
path = "examples/s02_server.rs"
[[example]]
name = "s03_server_resources"
path = "examples/s03_server_resources.rs"
[[example]]
name = "s04_server_resources_collection"
path = "examples/s04_server_resources_collection.rs"
[[example]]
name = "s05_server_prompts"
path = "examples/s05_server_prompts.rs"
[[example]]
name = "s06_completable_prompts"
path = "examples/s06_completable_prompts.rs"
[[example]]
name = "s07_logging"
path = "examples/s07_logging.rs"
[[example]]
name = "s08_progress_notifications"
path = "examples/s08_progress_notifications.rs"
required-features = ["progress_example"]
[[example]]
name = "s09_progress_countdown"
path = "examples/s09_progress_countdown.rs"
[[example]]
name = "s10_request_cancellation"
path = "examples/s10_request_cancellation.rs"
required-features = ["cancellation_example"]
[[example]]
name = "s11_error_handling"
path = "examples/s11_error_handling.rs"
[[example]]
name = "s12_sampling_llm"
path = "examples/s12_sampling_llm.rs"
[[example]]
name = "s13_elicit_input"
path = "examples/s13_elicit_input.rs"
[[example]]
name = "s14_resource_watcher"
path = "examples/s14_resource_watcher.rs"
required-features = ["resource-watcher"]
[[example]]
name = "s15_dynamic_resources"
path = "examples/s15_dynamic_resources.rs"
[[example]]
name = "s16_typed_tools"
path = "examples/s16_typed_tools.rs"
required-features = ["schema-generation"]
[[example]]
name = "s17_advanced_typed_tools"
path = "examples/s17_advanced_typed_tools.rs"
required-features = ["schema-generation"]
[[example]]
name = "s18_serverbuilder_typed"
path = "examples/s18_serverbuilder_typed.rs"
required-features = ["schema-generation"]
[[example]]
name = "s19_wasm_typed_tools"
path = "examples/s19_wasm_typed_tools.rs"
required-features = ["schema-generation"]
[[example]]
name = "s20_typed_tool_v2"
path = "examples/s20_typed_tool_v2.rs"
required-features = ["schema-generation"]
[[example]]
name = "s21_description_variants"
path = "examples/s21_description_variants.rs"
required-features = ["schema-generation"]
[[example]]
name = "s22_structured_output_schema"
path = "examples/s22_structured_output_schema.rs"
[[example]]
name = "s23_mcp_tool_macro"
path = "examples/s23_mcp_tool_macro.rs"
required-features = ["full"]
[[example]]
name = "s24_mcp_prompt_macro"
path = "examples/s24_mcp_prompt_macro.rs"
required-features = ["full"]
[[example]]
name = "s25_refactored_server"
path = "examples/s25_refactored_server.rs"
[[example]]
name = "s26_currency_server"
path = "examples/s26_currency_server.rs"
[[example]]
name = "s27_test_currency_server"
path = "examples/s27_test_currency_server.rs"
[[example]]
name = "s28_authentication"
path = "examples/s28_authentication.rs"
required-features = ["authentication_example"]
[[example]]
name = "s29_oauth_server"
path = "examples/s29_oauth_server.rs"
[[example]]
name = "s30_tool_with_sampling"
path = "examples/s30_tool_with_sampling.rs"
required-features = ["full"]
[[example]]
name = "s31_workflow_minimal"
path = "examples/s31_workflow_minimal.rs"
[[example]]
name = "s32_workflow_error_messages"
path = "examples/s32_workflow_error_messages.rs"
[[example]]
name = "s33_workflow_dsl_cookbook"
path = "examples/s33_workflow_dsl_cookbook.rs"
[[example]]
name = "s34_typed_tools_workflow"
path = "examples/s34_typed_tools_workflow.rs"
required-features = ["schema-generation"]
[[example]]
name = "s35_hybrid_workflow"
path = "examples/s35_hybrid_workflow.rs"
[[example]]
name = "s36_dynamic_resource_workflow"
path = "examples/s36_dynamic_resource_workflow.rs"
[[example]]
name = "s37_resource_only_steps"
path = "examples/s37_resource_only_steps.rs"
[[example]]
name = "s38_prompt_workflow_progress"
path = "examples/s38_prompt_workflow_progress.rs"
[[example]]
name = "s39_mcp_app_venue_map"
path = "examples/s39_mcp_app_venue_map.rs"
required-features = ["schema-generation"]
[[example]]
name = "s40_mcp_app_hotel_gallery"
path = "examples/s40_mcp_app_hotel_gallery.rs"
required-features = ["schema-generation"]
[[example]]
name = "s41_code_mode_graphql"
path = "examples/s41_code_mode_graphql.rs"
required-features = ["full"]
[[example]]
name = "t01_websocket_transport"
path = "examples/t01_websocket_transport.rs"
required-features = ["websocket"]
[[example]]
name = "t02_websocket_server_enhanced"
path = "examples/t02_websocket_server_enhanced.rs"
required-features = ["websocket"]
[[example]]
name = "t03_sse_optimized"
path = "examples/t03_sse_optimized.rs"
required-features = ["sse"]
[[example]]
name = "t04_streamable_http_stateful"
path = "examples/t04_streamable_http_stateful.rs"
required-features = ["streamable-http"]
[[example]]
name = "t05_streamable_http_stateless"
path = "examples/t05_streamable_http_stateless.rs"
required-features = ["streamable-http"]
[[example]]
name = "t06_streamable_http_client"
path = "examples/t06_streamable_http_client.rs"
required-features = ["streamable-http"]
[[example]]
name = "t07_connection_pool"
path = "examples/t07_connection_pool.rs"
required-features = ["full"]
[[example]]
name = "t08_simd_parsing_performance"
path = "examples/t08_simd_parsing_performance.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.5.0"
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-code-mode]
version = "0.2.0"
[dev-dependencies.pmcp-code-mode-derive]
version = "0.1.0"
[dev-dependencies.pmcp-macros]
version = "0.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.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