[package]
edition = "2024"
rust-version = "1.98"
name = "protocol-droid"
version = "0.5.0"
build = false
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "A Model Context Protocol toolkit that speaks every published spec revision, with one canonical IR behind many per-revision codecs."
documentation = "https://docs.rs/protocol-droid"
readme = "README.md"
keywords = [
"mcp",
"jsonrpc",
"model-context",
"protocol",
]
categories = [
"network-programming",
"parser-implementations",
"web-programming::http-server",
"web-programming::http-client",
]
license = "MIT OR Apache-2.0"
repository = "https://github.com/greysquirr3l/protocol-droid"
[package.metadata.docs.rs]
all-features = true
[features]
a2a = [
"http",
"dep:url",
"url/serde",
]
acp-experimental = [
"dep:futures-core",
"dep:tokio",
"tokio/io-std",
"tokio/io-util",
"tokio/process",
"tokio/rt",
"tokio/sync",
"tokio/time",
"tokio/macros",
]
default = [
"serde",
"stdio",
]
http = [
"dep:axum",
"dep:base64",
"dep:futures-core",
"dep:futures-util",
"dep:reqwest",
"dep:tower",
"dep:tokio",
"tokio/net",
"tokio/rt",
"tokio/sync",
"tokio/macros",
]
legacy-sse = ["http"]
oauth = [
"http",
"dep:jsonwebtoken",
"dep:base64",
"dep:url",
]
random-ids = ["dep:getrandom"]
serde = []
stdio = ["dep:tokio"]
[lib]
name = "protocol_droid"
path = "src/lib.rs"
[[example]]
name = "a2a_client"
path = "examples/a2a_client.rs"
required-features = [
"a2a",
"http",
]
[[example]]
name = "a2a_minimal_server"
path = "examples/a2a_minimal_server.rs"
required-features = [
"a2a",
"http",
]
[[example]]
name = "a2a_server"
path = "examples/a2a_server.rs"
required-features = [
"a2a",
"http",
]
[[example]]
name = "a2a_typed_client"
path = "examples/a2a_typed_client.rs"
required-features = [
"a2a",
"http",
]
[[example]]
name = "conformance_reference_client"
path = "examples/conformance_reference_client/main.rs"
required-features = [
"http",
"oauth",
"random-ids",
]
[[example]]
name = "conformance_reference_server"
path = "examples/conformance_reference_server/main.rs"
required-features = [
"http",
"random-ids",
]
[[example]]
name = "http_client"
path = "examples/http_client.rs"
required-features = ["http"]
[[example]]
name = "http_server"
path = "examples/http_server.rs"
required-features = ["http"]
[[example]]
name = "mcp_client"
path = "examples/mcp_client.rs"
required-features = ["stdio"]
[[example]]
name = "oauth_resource_server"
path = "examples/oauth_resource_server.rs"
required-features = [
"http",
"oauth",
]
[[example]]
name = "protected_resource_server"
path = "examples/protected_resource_server.rs"
required-features = ["http"]
[[example]]
name = "server"
path = "examples/server.rs"
required-features = ["http"]
[[example]]
name = "stdio_server"
path = "examples/stdio_server.rs"
required-features = ["stdio"]
[[test]]
name = "a2a_client_wire"
path = "tests/a2a_client_wire.rs"
[[test]]
name = "a2a_conformance"
path = "tests/a2a_conformance.rs"
[[test]]
name = "a2a_js_interop"
path = "tests/a2a_js_interop.rs"
[[test]]
name = "a2a_serving_wire"
path = "tests/a2a_serving_wire.rs"
[[test]]
name = "acp_schema_validation"
path = "tests/acp_schema_validation.rs"
[[test]]
name = "acp_stdio_interop"
path = "tests/acp_stdio_interop.rs"
[[test]]
name = "bench_gate"
path = "tests/bench_gate.rs"
[[test]]
name = "bridge_content"
path = "tests/bridge_content.rs"
[[test]]
name = "codec_round_trip"
path = "tests/codec_round_trip.rs"
[[test]]
name = "conformance_content_tools"
path = "tests/conformance_content_tools.rs"
[[test]]
name = "dynamic_registry"
path = "tests/dynamic_registry.rs"
[[test]]
name = "feature_matrix_golden"
path = "tests/feature_matrix_golden.rs"
[[test]]
name = "feature_table_doc_consistency"
path = "tests/feature_table_doc_consistency.rs"
[[test]]
name = "feature_variant_coverage"
path = "tests/feature_variant_coverage.rs"
[[test]]
name = "http_bridge_push_wire"
path = "tests/http_bridge_push_wire.rs"
[[test]]
name = "http_bridge_upstream_wire"
path = "tests/http_bridge_upstream_wire.rs"
[[test]]
name = "http_bridge_wire"
path = "tests/http_bridge_wire.rs"
[[test]]
name = "http_transport_wire"
path = "tests/http_transport_wire.rs"
[[test]]
name = "in_process_exchange"
path = "tests/in_process_exchange.rs"
[[test]]
name = "jsonrpc_fuzz"
path = "tests/jsonrpc_fuzz.rs"
[[test]]
name = "jsonrpc_router"
path = "tests/jsonrpc_router.rs"
[[test]]
name = "lowering_properties"
path = "tests/lowering_properties.rs"
[[test]]
name = "macros"
path = "tests/macros.rs"
[[test]]
name = "mcp_stdio_interop"
path = "tests/mcp_stdio_interop.rs"
[[test]]
name = "negotiation_golden"
path = "tests/negotiation_golden.rs"
[[test]]
name = "oauth_wiring"
path = "tests/oauth_wiring.rs"
[[test]]
name = "port_trait_wiring"
path = "tests/port_trait_wiring.rs"
[[test]]
name = "published_docs_consistency"
path = "tests/published_docs_consistency.rs"
[[test]]
name = "resource_and_prompt_reads"
path = "tests/resource_and_prompt_reads.rs"
[[test]]
name = "stdio_end_to_end"
path = "tests/stdio_end_to_end.rs"
[[test]]
name = "ui"
path = "tests/ui.rs"
[[bench]]
name = "a2a_serving"
path = "benches/a2a_serving.rs"
harness = false
required-features = ["a2a"]
[[bench]]
name = "jsonrpc_hot_path"
path = "benches/jsonrpc_hot_path.rs"
harness = false
[[bench]]
name = "registry"
path = "benches/registry.rs"
harness = false
[dependencies.arc-swap]
version = "1.9.2"
[dependencies.axum]
version = "0.8.9"
features = [
"http1",
"json",
"query",
"tokio",
]
optional = true
default-features = false
[dependencies.base64]
version = "0.22.1"
features = ["alloc"]
optional = true
default-features = false
[dependencies.futures-core]
version = "0.3.31"
optional = true
[dependencies.futures-util]
version = "0.3.31"
optional = true
[dependencies.getrandom]
version = "0.4.3"
features = ["std"]
optional = true
[dependencies.hmac]
version = "0.13.0"
[dependencies.jsonwebtoken]
version = "11.1.0"
features = ["rust_crypto"]
optional = true
default-features = false
[dependencies.protocol-droid-macros]
version = "0.5.0"
[dependencies.protocol-droid-schema]
version = "0.5.0"
[dependencies.reqwest]
version = "0.12.24"
features = [
"rustls-tls",
"stream",
]
optional = true
default-features = false
[dependencies.schemars]
version = "1.2.2"
[dependencies.serde]
version = "1.0.229"
features = [
"derive",
"rc",
]
[dependencies.serde_json]
version = "1.0.151"
features = ["raw_value"]
[dependencies.sha2]
version = "0.11.1"
[dependencies.thiserror]
version = "2.0.21"
[dependencies.tokio]
version = "1.48.0"
features = [
"macros",
"net",
"rt",
"sync",
"time",
"test-util",
"io-std",
"io-util",
"process",
]
optional = true
default-features = false
[dependencies.tower]
version = "0.5.2"
features = [
"limit",
"timeout",
"util",
]
optional = true
default-features = false
[dependencies.url]
version = "2.5.8"
optional = true
[dev-dependencies.assert_matches]
version = "1.5.0"
[dev-dependencies.base64]
version = "0.22.1"
features = ["alloc"]
default-features = false
[dev-dependencies.divan]
version = "0.1.21"
default-features = false
[dev-dependencies.futures-util]
version = "0.3.31"
features = ["std"]
default-features = false
[dev-dependencies.insta]
version = "1.43.0"
default-features = false
[dev-dependencies.jsonschema]
version = "0.58.5"
default-features = false
[dev-dependencies.proptest]
version = "1.11.0"
features = [
"std",
"bit-set",
]
default-features = false
[dev-dependencies.serde_json]
version = "1.0.151"
features = ["raw_value"]
[dev-dependencies.tokio]
version = "1.48.0"
features = [
"macros",
"net",
"rt",
"sync",
"time",
"test-util",
"rt",
"time",
]
default-features = false
[dev-dependencies.tower]
version = "0.5.2"
features = ["util"]
default-features = false
[dev-dependencies.trybuild]
version = "1.0.121"
[lints.clippy]
cast_ptr_alignment = "deny"
expect_used = "deny"
indexing_slicing = "deny"
missing_errors_doc = "allow"
missing_panics_doc = "allow"
module_name_repetitions = "allow"
multiple_crate_versions = "allow"
must_use_candidate = "allow"
panic = "deny"
struct_excessive_bools = "allow"
unwrap_used = "deny"
[lints.clippy.all]
level = "warn"
priority = -1
[lints.clippy.cargo]
level = "warn"
priority = -1
[lints.clippy.nursery]
level = "warn"
priority = -1
[lints.clippy.pedantic]
level = "warn"
priority = -1
[lints.clippy.perf]
level = "warn"
priority = -1
[lints.clippy.suspicious]
level = "deny"
priority = -1
[lints.rust]
ambiguous_glob_imported_traits = "deny"
dead_code_pub_in_binary = "warn"
missing_debug_implementations = "warn"
missing_docs = "deny"
uninhabited_static = "deny"
unreachable_pub = "warn"
warnings = "deny"
[lints.rust.rust_2018_idioms]
level = "warn"
priority = -1