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, server-tls, di, tasksAll server capabilities
client-fullclient-macros, tracing, http-client, client-tls, tasksAll client capabilities

Server Features

FeatureIncludesDescription
serverCore server runtime: tool, resource, and prompt handler registration, stdio transport
server-macrosserver, macrosAdds attribute macros (#[tool], #[resource], #[prompt], etc.)
http-serverserverStreamable HTTP transport with authentication support
server-tlsTLS support for the HTTP server, including automatic dev certificate generation

Client Features

FeatureIncludesDescription
clientCore 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-tlsTLS support for the HTTP client (rustls)

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
tracingStructured logging via the tracing ecosystem and MCP log notifications

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", "tracing", "di", "tasks"] }

HTTP transport without TLS — suitable for local or internal deployments behind a reverse proxy.

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
│ │ └── server
│ ├── server-tls
│ ├── tracing
│ ├── di
│ └── tasks
└── client-full
├── client-macros
│ ├── client
│ └── macros
├── http-client
│ └── client
├── client-tls
├── tracing
└── tasks