Skip to content

async-trait: make it an optional dependency #1112

Description

@bug-ops

Problem

async-trait is declared as an unconditional dependency in crates/rmcp/Cargo.toml, but
every use of it sits behind non-default features:

  • CredentialStore / StateStore (transport/auth.rs) — feature auth
  • EventStore / SessionStore (session/store.rs) — feature transport-streamable-http-server-session

Default features (base64, macros, server) pull in neither, yet the proc-macro crate
still compiles for every consumer:

$ cargo tree -p rmcp -e normal --no-default-features --features base64,macros,server -i async-trait
async-trait (proc-macro)
└── rmcp

Proposal

# crates/rmcp/Cargo.toml
async-trait = { version = "0.1.89", optional = true }

[features]
auth = [..., "dep:async-trait"]
transport-streamable-http-server-session = [..., "dep:async-trait"]

Dev-dependency stays as-is (used directly by the event/session store integration tests).
Non-breaking, no public API change — trims the default build graph only.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions