#[cfg(all(feature = "server", feature = "proto-2026-07-28-rc"))]
pub use app::extension::Extension;
#[cfg(all(feature = "server", feature = "proto-2026-07-28-rc", feature = "tasks"))]
pub use app::extension::TasksExtension;
#[cfg(all(feature = "server", feature = "proto-2026-07-28-rc"))]
pub use app::mrtr_store::{InMemoryStateStore, RequestStateStore};
#[cfg(feature = "server")]
pub use app::{App, context::Context};
#[cfg(feature = "client")]
pub use client::Client;
#[cfg(feature = "server")]
pub mod app;
#[cfg(feature = "client")]
pub mod client;
pub mod commands;
#[cfg(feature = "di")]
pub mod di;
pub mod error;
#[cfg(feature = "macros")]
pub mod macros;
#[cfg(feature = "server")]
pub mod middleware;
pub mod shared;
#[cfg(any(feature = "server", feature = "client"))]
pub mod transport;
pub mod types;
#[cfg(feature = "client-macros")]
pub use neva_macros::elicitation;
#[cfg(feature = "macros")]
pub use neva_macros::json_schema;
#[cfg(all(feature = "client-macros", not(feature = "proto-2026-07-28-rc")))]
pub use neva_macros::sampling;
#[cfg(feature = "server-macros")]
pub use neva_macros::{completion, handler, prompt, resource, resources, tool};
pub(crate) const SDK_NAME: &str = "neva";
#[cfg(any(feature = "server", feature = "client"))]
pub(crate) const PROTOCOL_VERSIONS: &[&str] = &[
"2024-11-05",
"2025-03-26",
"2025-06-18",
"2025-11-25",
#[cfg(feature = "proto-2026-07-28-rc")]
"2026-07-28",
];
#[cfg(any(
// all(feature = "proto-2026-07-28-rc", feature = "proto-2027-XX-XX-rc"),
))]
compile_error!("Only one `proto-*` feature flag may be enabled per build");
#[cfg(feature = "http-server")]
pub mod auth {
pub use crate::transport::http::core::types::Claims;
pub use crate::transport::http::core::types::DefaultClaims;
#[cfg(feature = "http-server-volga")]
pub use crate::transport::http::server::volga::auth_config::AuthConfig;
#[cfg(feature = "http-server-volga")]
pub use volga::auth::AuthClaims;
#[cfg(feature = "http-server-volga")]
pub use volga::auth::{Algorithm, Authorizer, Claims as ClaimsDerive};
}
pub mod json {
#[doc(hidden)]
pub use schemars;
pub use schemars::JsonSchema;
}
#[cfg(feature = "proto-2026-07-28-rc")]
#[doc(hidden)]
pub mod __macro_support {
pub use crate::types::schema_2020::{
SchemaProbe, ViaFallback, ViaJsonSchema, object_schema, primitive_subschema,
};
}
pub mod prelude {
pub use crate::error::*;
pub use crate::json::*;
pub use crate::types::*;
#[cfg(feature = "http-server-volga")]
pub use crate::auth::AuthConfig;
#[cfg(feature = "http-server")]
pub use crate::auth::{Claims, DefaultClaims};
#[cfg(all(feature = "http-server", feature = "server-tls"))]
pub use crate::transport::http::{DevCertMode, TlsConfig};
#[cfg(feature = "http-server")]
pub use crate::transport::{
HttpContext, HttpEngine, HttpRequest, HttpResponse, HttpServer, SseResponse, handlers,
};
#[cfg(all(feature = "server", feature = "proto-2026-07-28-rc"))]
pub use crate::app::extension::Extension;
#[cfg(all(feature = "server", feature = "proto-2026-07-28-rc", feature = "tasks"))]
pub use crate::app::extension::TasksExtension;
#[cfg(feature = "server")]
pub use crate::app::{App, context::Context, options};
#[cfg(feature = "server")]
pub use crate::middleware::{MwContext, Next};
#[cfg(feature = "client")]
pub use crate::client::Client;
#[cfg(feature = "client-macros")]
pub use crate::elicitation;
#[cfg(feature = "macros")]
pub use crate::json_schema;
#[cfg(all(feature = "client-macros", not(feature = "proto-2026-07-28-rc")))]
pub use crate::sampling;
#[cfg(feature = "server-macros")]
pub use crate::{completion, handler, prompt, resource, resources, tool};
#[cfg(feature = "di")]
pub use crate::di::Dc;
#[cfg(feature = "tasks")]
pub use crate::shared::TaskApi;
}
#[cfg(test)]
#[cfg(any(feature = "server", feature = "client"))]
mod proto_versions_tests {
use super::PROTOCOL_VERSIONS;
#[test]
fn rc_version_listed_only_under_flag() {
let has_rc = PROTOCOL_VERSIONS.contains(&"2026-07-28");
let flag_on = cfg!(feature = "proto-2026-07-28-rc");
assert_eq!(has_rc, flag_on, "RC version listing must match the flag");
}
#[test]
fn stable_versions_always_listed() {
let stable: Vec<_> = PROTOCOL_VERSIONS
.iter()
.filter(|v| **v != "2026-07-28")
.copied()
.collect();
assert!(
!stable.is_empty(),
"PROTOCOL_VERSIONS must always advertise at least one stable version"
);
assert!(
stable.contains(&"2024-11-05"),
"PROTOCOL_VERSIONS must always advertise the inaugural MCP version 2024-11-05"
);
}
}