Skip to main content

Feature Flags

Neva uses Cargo feature flags to keep compile times low and binary size minimal — only the code you actually need gets compiled. This page explains all available features and how to combine them for common scenarios.

Quick Start​

For most projects, the bundled presets are all you need:

[dependencies]
# Full-featured MCP server
neva = { version = "...", features = ["server-full"] }

# Full-featured MCP client
neva = { version = "...", features = ["client-full"] }

# Both server and client
neva = { version = "...", features = ["full"] }

Feature Reference​

Presets​

FeatureIncludesDescription
fullserver-full + client-fullEverything — for apps that run both a server and a client
server-fullserver-macros, tracing, http-server-volga, server-tls, server-oauth, di, tasks, apps, registryAll server capabilities, including the default Volga-based HTTP server
client-fullclient-macros, tracing, http-client, client-tls, client-oauth, client-oauth-jwt, client-oauth-dpop, tasks, appsAll client capabilities

Note that full is every feature except two: the protocol-generation flag below, and svir, which stays opt-in while svir is 0.x. full is the default build; docs.rs publishes it with svir on top.

Server Features​

FeatureIncludesDescription
server—Core server runtime: tool, resource, and prompt handler registration, stdio transport
server-macrosserver, macrosAdds attribute macros (#[tool], #[resource], #[prompt], etc.)
http-serverserverEngine-agnostic Streamable HTTP abstractions — pulls in no HTTP framework. Plug in your own stack (axum, hyper, actix-web, …) by implementing HttpEngine
http-server-volgahttp-serverDefault Volga-based HTTP server adapter, including JWT auth
server-tlshttp-server-volgaTLS support for the default HTTP server, including automatic dev certificate generation
server-oauthhttp-serverOAuth 2.1 protected-resource metadata and token validation on the server
registryserverserver.json manifests for the MCP Registry, generated from the app and the crate, and validated before the upload. Types and a validator only — no new dependencies

Client Features​

FeatureIncludesDescription
client—Core client runtime: tool calls, resource reads, prompt fetching, stdio transport
client-macrosclient, macrosAdds attribute macros (#[sampling], #[elicitation])
http-clientclientStreamable HTTP transport and SSE stream support
client-tls—TLS support for the HTTP client (rustls)
client-oauthhttp-clientClient-side OAuth 2.1 authorization: discovery, all three registration mechanisms, authorization code + PKCE, client credentials and JWT bearer
client-oauth-jwtclient-oauthprivate_key_jwt client authentication — the client signs a short-lived assertion with its own key instead of presenting a shared secret. The only part of the OAuth client that needs a JWS backend, which is why it is separate
client-oauth-dpopclient-oauthDPoP sender-constrained tokens (RFC 9449) — every token is bound to a key the client holds and proved on each request

Shared Features​

FeatureDescription
macrosProcedural macro infrastructure (shared between server-macros and client-macros)
diDependency injection — service container with singleton, scoped, and transient lifetimes
tasksTask-augmented requests — long-running async tool execution with polling
appsMCP Apps (SEP-1865) — ui:// HTML resources and the _meta.ui blocks that bind a tool to one. Additive, and pulls in no new dependencies. The server half needs the default protocol generation; the client half works in both
tracingStructured logging via the tracing ecosystem and MCP log notifications

The svir Bridge​

FeatureDescription
svirHands MCP tools to a model as a svir Toolbox — a connected server's through RemoteTools, a server's own through App::into_toolbox and ctx.tools().toolbox() — and turns prompts, resources and sampling into svir's types. Works with the server, the client, or both. svir comes in without its default features, so add svir to your own dependencies to call a model

svir is in no preset: svir is still 0.x, and a preset that included it would make each breaking svir release a breaking neva one. Name it next to the preset:

neva = { version = "...", features = ["full", "svir"] }
svir = "0.1.4"

Protocol Generation​

FeatureDescription
legacy-specSwitches the build from MCP 2026-07-28 (the default) back to the previous generation, MCP 2024-11-05 … 2025-11-25
legacy-spec is a switch, not an addition

Enabling legacy-spec compiles the 2026-07-28 surface out — the two generations never coexist in one build. And because Cargo features are additive, --all-features turns it on and therefore exercises the legacy profile; the default profile needs an explicit list such as --features "server-full client-full". See Legacy spec.

Common Configurations​

Minimal stdio server (no macros)​

neva = { version = "...", features = ["server"] }

Use this when you prefer to register handlers manually with map_tool(), map_resource(), and map_prompt() instead of attribute macros.

Server with macros, without HTTP​

neva = { version = "...", features = ["server-macros", "tracing"] }

Attribute macros and logging, but no HTTP transport compiled in. Useful for stdio-only servers.

HTTP server without TLS​

neva = { version = "...", features = ["server-macros", "http-server-volga", "tracing", "di", "tasks"] }

Default (Volga-based) HTTP transport without TLS — suitable for local or internal deployments behind a reverse proxy.

HTTP server on a custom stack (axum / hyper / actix-web)​

neva = { version = "...", features = ["server-macros", "http-server", "tracing", "di", "tasks"] }
# plus your framework of choice
axum = "0.8"

The http-server feature ships the engine-agnostic abstractions only — no Volga, no framework dependency. You implement HttpEngine for your stack and wire it in via HttpServer::from_engine(...). See Custom HTTP Stack for a complete walk-through.

Minimal HTTP client​

neva = { version = "...", features = ["http-client"] }

A lightweight client that connects to remote MCP servers over HTTP, without macros or tracing.

Server + embedded client (agent pattern)​

neva = { version = "...", features = ["server-full", "http-client"] }

An MCP server that also acts as a client — for example, a server that delegates sampling requests or fans out to other MCP servers.

Feature Composition​

The diagram below shows how features build on each other:

full
├── server-full
│ ├── server-macros
│ │ ├── server
│ │ └── macros
│ ├── http-server-volga
│ │ └── http-server
│ │ └── server
│ ├── server-tls
│ │ └── http-server-volga
│ ├── server-oauth
│ │ └── http-server
│ ├── tracing
│ ├── di
│ ├── tasks
│ ├── apps
│ └── registry
│ └── server
└── client-full
├── client-macros
│ ├── client
│ └── macros
├── http-client
│ └── client
├── client-tls
├── client-oauth
│ └── http-client
├── client-oauth-jwt
│ └── client-oauth
├── client-oauth-dpop
│ └── client-oauth
├── tracing
├── tasks
└── apps

svir (opt-in, in no preset: the bridge to a model, for the server, the client or both)
legacy-spec (orthogonal: selects the protocol generation, not a capability)