WebAuthn MCP
A security-first WebAuthn/passkey MCP server that generates registration and sign-in options, verifies authenticator responses, and manages credentials locally
文件
webauthn-mcp
A security-first WebAuthn / passkeys relying party exposed as a Model Context Protocol (MCP) server, written in Rust.
You can use it from Claude, from Claude Code or from any MCP client. It generates registration and sign-in options, verifies the responses your browser or Android app sends back, and keeps a credential store. Every check runs in vetted, constant-time crypto. This is the Rust sibling of @xkid1/webauthn: same concepts, same JSON shapes and same error codes.
- Small: a single binary of about 1 MB. Its only direct dependencies are
ring(crypto, CSPRNG, SHA-2) andserde/serde_json(the wire format). CBOR, COSE, ASN.1/X.509, base64url, the MCP protocol and the stdio transport are all written in-crate. - Hardened:
#![forbid(unsafe_code)]- no
unwrap,expect,panicor slice indexing in library code (enforced by clippy) - overflow checks on in release builds
- per-request panic isolation
- a 1 MiB message cap
- strict parsers that reject trailing bytes, indefinite lengths, duplicate keys and length bombs
- Spec-current: it speaks MCP 2026-07-28 (stateless, with per-request
_meta,server/discover,resultTypeand cache hints). It is also dual-era, so legacy clients that use theinitializehandshake (2025-11-25, 2025-06-18 and 2025-03-26) keep working. - WebAuthn Level 3: it implements the §7.1 registration and §7.2 authentication checks in full.
- Algorithms: EdDSA/Ed25519, ES256, ES384, RS256/384/512 and PS256/384/512.
- Attestation formats:
none,packed(self and x5c) andfido-u2f, with X.509 chain validation. - Credentials: backup-state (BE/BS) tracking and clone detection through the signature counter.
- Android-ready: it supports
android:apk-key-hash:origins and can generateassetlinks.json.
Install
cargo install webauthn-mcp # from crates.io
# or download a release binary from GitHub Releases:
# Linux and macOS (x86_64, arm64), Windows (x86_64)
Docker:
docker run -i --rm --mount type=volume,src=webauthn-mcp-data,dst=/data \
-e WEBAUTHN_RP_ID=example.com -e WEBAUTHN_RP_NAME="Example Inc." \
-e WEBAUTHN_ORIGINS=https://example.com \
ghcr.io/xkid1/webauthn-mcp:0.1
WEBAUTHN_RP_ID,WEBAUTHN_RP_NAMEandWEBAUTHN_ORIGINSare required; without them the container exits with code 78.- Mount a named volume. The image keeps its credential store at
/data/credentials.json(WEBAUTHN_CREDENTIALS_FILE). Without--mount/-v, Docker creates an anonymous/datavolume and--rmdeletes it when the container exits. Registered passkeys, revocations and tombstones are then lost on every exit. The server cannot tell the two cases apart, so it prints no warning. - One running server per volume. The store does not lock the credentials file. Two containers sharing one volume (for example two MCP clients both using the registry install's
webauthn-mcp-datavolume) overwrite each other's writes: a deletion or revocation can be undone and signature counters rolled back. Give each concurrently running client its own volume name, or don't run two at once. - The image runs as the non-root distroless user (uid/gid 65532) and has no shell.
/datais owned by that user. - Base images (
rust:*-slim-bookworm,gcr.io/distroless/cc-debian12:nonroot) are pinned by version and digest. - Releases push the tags
X.Y.Z,X.Yandlatest(prereleases get onlyX.Y.Z). A publishedX.Y.Ztag is never overwritten;X.Yandlatestmove with each release, so pinX.Y.Z(or a digest) for reproducible installs.
MCP registry: the server is listed as io.github.xkid1/webauthn-mcp. Its server.json package is the OCI image ghcr.io/xkid1/webauthn-mcp:X.Y.Z over stdio. It declares the three required env vars above and a required named volume (--mount type=volume,src=webauthn-mcp-data,dst=/data), so registry clients start it the same way as the command above. Every client installed this way uses the same volume name, so don't run two such clients at the same time (see "One running server per volume" above). The image carries the label io.modelcontextprotocol.server.name="io.github.xkid1/webauthn-mcp" so the registry can verify ownership.
webauthn-mcp --help and --version print to stdout and exit. When the server runs, stdout carries only the MCP JSON-RPC stream; everything else goes to stderr.
Build from source:
git clone https://github.com/xkid1/webauthn-mcp && cd webauthn-mcp
cargo build --release # → target/release/webauthn-mcp
Configure
Configuration comes from a JSON file (--config), WEBAUTHN_* environment variables, or both. Environment variables win. Only rpId, rpName and origins are required; everything else has a secure default.
WEBAUTHN_RP_ID=example.com \
WEBAUTHN_RP_NAME="Example Inc." \
WEBAUTHN_ORIGINS=https://example.com,http://localhost:3000 \
webauthn-mcp --check-config # validate and print the resolved config
| Key (file) | Env | Default | Notes |
|---|---|---|---|
rpId | WEBAUTHN_RP_ID | required | Lowercase domain; no scheme or port. |
rpName | WEBAUTHN_RP_NAME | required | |
origins | WEBAUTHN_ORIGINS | required | Exact allowlist: https://…, http://localhost… or android:apk-key-hash:…. Web origins must sit within rpId. |
timeoutMs | WEBAUTHN_TIMEOUT_MS | 300000 | 10 s – 10 min; also the ceremony TTL. |
userVerification | WEBAUTHN_USER_VERIFICATION | preferred | What is requested. |
requireUserVerification | WEBAUTHN_REQUIRE_USER_VERIFICATION | userVerification == required | What is enforced. It is a floor: a tool call's requireUserVerification can tighten it but never relax it, and when it is on, generated options advertise userVerification: "required". |
attestation | WEBAUTHN_ATTESTATION | none | |
supportedAlgorithms | WEBAUTHN_ALGORITHMS | [-8, -7, -257] | COSE IDs. RS1 and ES512 are rejected. |
authenticatorSelection | — | { residentKey: preferred } | |
hints | — | [] | |
challengeSize | — | 32 | Bytes, 16–64. |
allowCrossOrigin / allowedTopOrigins | — | false / [] | Turning on cross-origin requires a top-origin allowlist. |
counterPolicy | WEBAUTHN_COUNTER_POLICY | strict | lenient reports counterWarning instead of failing. |
trustAnchors | WEBAUTHN_TRUST_ANCHORS | [] | Paths to PEM or DER root certificates. |
requireTrustedAttestation | WEBAUTHN_REQUIRE_TRUSTED_ATTESTATION | false | |
credentialsFile | WEBAUTHN_CREDENTIALS_FILE | in-memory | JSON store, written atomically with mode 0600 on Unix. |
maxPendingCeremonies | — | 10000 | Oldest ceremonies are evicted first. |
allowCallerCredentials | WEBAUTHN_ALLOW_CALLER_CREDENTIALS | false | Lets webauthn_verify_authentication use a caller-supplied credential for an ID that is not in the server store. Leave it off unless you keep your own credential store. |
existingUserEnrollment | WEBAUTHN_EXISTING_USER_ENROLLMENT | grant | Adding a passkey to a user who already has one. grant requires an enrollmentGrant from a fresh sign-in. deny refuses it. |
allowExplicitChallenge | WEBAUTHN_ALLOW_EXPLICIT_CHALLENGE | false | Lets the verify tools take a caller-held expectedChallenge (16–1024 bytes) instead of a ceremonyId. That path has no server-side replay protection. |
Boolean env vars accept 1/true/yes or 0/false/no. Unknown keys are rejected, including keys inside authenticatorSelection. A bad config, including an unknown existingUserEnrollment value, exits with code 78.
Credentials file. The file is written as format version 2:
{ "version": 2, "credentials": [ … ], "revokedCredentialIds": [ … ], "tombstonedUserIds": [ … ] }
revokedCredentialIdslists deleted credential IDs.tombstonedUserIdslists users whose last credential was deleted. Each list holds at most 10,000 entries and never drops one: when a list is full, deleting fails withSTORE_LIMIT_REACHED(see Store limits), and a file over either limit is refused at startup (exit code 78).- Every change is written to a new, randomly named temporary file (
<file>.<24 hex digits>.tmp, created exclusively with mode0600on Unix), synced and renamed over the file. Memory is updated only after the write succeeds, so a failed write changes nothing and returnsSTORAGE_ERROR. At startup, temporary files of exactly that pattern older than 60 seconds (left by a crash) are removed. - The directory must be writable: an unwritable credentials directory fails at startup (also with
--check-config) with exit code 78. Run one server process per file: the store does not lock it, and two processes sharing a file can undo each other's deletions and revocations and roll back counters. - Windows: the
0600mode is Unix only. On Windows the file inherits its directory's ACL, so keep it in a directory only the server's account can read. - Loading is strict. The
versionis checked first (1 or 2). Unknown top-level keys, duplicate credential IDs and more than 100,000 credentials are refused. A credential that is both stored and revoked is treated as deleted. - Version 1 files still load and are rewritten as version 2 on the next change.
- Builds without the revocation list refuse a version 2 file. Builds with the revocation list but without tombstones read it, but drop
tombstonedUserIdson their next write.
See examples/config.example.json. For local development use rpId: "localhost" with http://localhost:<port> origins. Origins outside the rpId are rejected at startup.
Connect a client
First build or install the server. MCP desktop clients start it as a local stdio process,
so command must point to the executable on the same machine as the client. Use absolute paths
for desktop apps, which may not inherit your terminal's PATH. Set WEBAUTHN_CREDENTIALS_FILE
to a writable path so credentials persist across restarts; its parent directory must already
exist. The rpId and each origin must match the web app that will call WebAuthn (the examples
below are for a local app on port 3000).
Build from this repository with cargo build --release --locked. Replace
/absolute/path/to/webauthn-mcp below with the resulting binary path
(target/release/webauthn-mcp, or target/release/webauthn-mcp.exe on Windows). On Windows,
forward slashes are accepted in JSON paths.
Claude Code
claude mcp add webauthn --env WEBAUTHN_RP_ID=localhost --env WEBAUTHN_RP_NAME=Dev \
--env WEBAUTHN_ORIGINS=http://localhost:3000 \
--env WEBAUTHN_CREDENTIALS_FILE=/absolute/path/to/webauthn-credentials.json \
-- /absolute/path/to/webauthn-mcp
VS Code workspace file (.vscode/mcp.json)
For VS Code's editor-managed stdio configuration, create .vscode/mcp.json in your workspace
with this VS Code-specific servers format:
{
"servers": {
"webauthn": {
"type": "stdio",
"command": "/absolute/path/to/webauthn-mcp",
"args": [],
"env": {
"WEBAUTHN_RP_ID": "localhost",
"WEBAUTHN_RP_NAME": "Local Dev",
"WEBAUTHN_ORIGINS": "http://localhost:3000",
"WEBAUTHN_CREDENTIALS_FILE": "/absolute/path/to/webauthn-credentials.json"
}
}
}
}
Open the workspace in VS Code, then use MCP: List Servers or Chat: Open Customizations →
MCP Servers to start and inspect it. VS Code currently recommends the Copilot harness for new
setups; .vscode/mcp.json is the editor-managed Local-harness format and is deprecated. For the
Copilot harness, use the portable config format instead: put the mcpServers object from
examples/mcp.json in a workspace-root .mcp.json, or in
~/.copilot/mcp-config.json for a user-level setup. See the VS Code MCP configuration
reference for the current
formats and migration details.
Claude Desktop (claude_desktop_config.json)
Open Settings → Developer → Edit Config in Claude Desktop. Add this server entry under the
existing top-level mcpServers object (merge it with other entries rather than replacing them):
{
"mcpServers": {
"webauthn": {
"command": "/absolute/path/to/webauthn-mcp",
"args": [],
"env": {
"WEBAUTHN_RP_ID": "localhost",
"WEBAUTHN_RP_NAME": "Local Dev",
"WEBAUTHN_ORIGINS": "http://localhost:3000",
"WEBAUTHN_CREDENTIALS_FILE": "/absolute/path/to/webauthn-credentials.json"
}
}
}
}
Claude Desktop's config file is ~/Library/Application Support/Claude/claude_desktop_config.json
on macOS and %APPDATA%\Claude\claude_desktop_config.json on Windows. Use the full path to
the executable (including .exe on Windows), save the file, then fully quit and restart Claude
Desktop. The MCP quickstart shows the
Desktop setup flow and platform-specific config paths.
The same WEBAUTHN_* environment entries can be added to the JSON in either client. For a
production relying party, replace localhost and the local origin with your real RP ID and exact
web origin. WEBAUTHN_CREDENTIALS_FILE should point to a private, writable file location; do not
run two server processes against the same credentials file at once.
Tools
| Tool | Purpose |
|---|---|
webauthn_generate_registration_options | Creates PublicKeyCredentialCreationOptionsJSON and a single-use ceremonyId. Excludes credentials the user already has. A new user needs nothing else. For a user.id that already has a passkey, pass enrollmentGrant (exactly 22 base64url characters, else INVALID_INPUT). Without a valid grant, under the deny policy, or for a tombstoned user, the call fails with ENROLLMENT_NOT_AUTHORIZED. |
webauthn_verify_registration | Runs the full §7.1 verification and, by default, stores the credential as a new sign-in method. It is marked destructive, so hosts should confirm with the user first. The enrollment rules are checked again before storing. expectedChallenge is refused (INVALID_INPUT) unless allowExplicitChallenge is on; on that path nothing is stored. |
webauthn_generate_authentication_options | Creates PublicKeyCredentialRequestOptionsJSON and a single-use ceremonyId. Omit userId for passkey autofill. Pass userId to restrict the ceremony to that user: verification then succeeds only for a credential that user owns, and an empty allowCredentials is filled from their stored credentials. |
webauthn_verify_authentication | Runs the full §7.2 verification. The server store always wins: if response.id is stored, that record's key, counter and owner are used, and its counter is updated. The output userId is the verified identity, meaning the credential's owner. userHandle is an unverified client claim, so never use it for identity. A caller-supplied credential is used only when allowCallerCredentials is on and the ID is not stored. Even then it is refused for a user who has, or had, stored credentials. A user-verified sign-in (UV flag set, no counter warning) with a stored credential on a ceremonyId, under the grant policy, also returns enrollmentGrant and enrollmentGrantExpiresAtMs. Without UV the sign-in still succeeds but returns no grant. requireUserVerification on the call can only tighten the configured requirement. expectedChallenge is refused unless allowExplicitChallenge is on, and never earns a grant. |
webauthn_list_credentials | Lists stored credentials, optionally filtered by owner userId. |
webauthn_delete_credential | Permanently deletes a credential and revokes its ID, so it can no longer sign in on any path and cannot be registered again. When the revocation list (or a needed tombstone slot) is full, the delete is refused with STORE_LIMIT_REACHED and nothing changes. Deleting a user's last credential tombstones the user: no passkey can be registered for that user.id until an operator clears the tombstone through the library (CredentialStore::clear_tombstone, deliberately not a tool). |
webauthn_inspect | Decodes exactly one of: a response, attestationObject, authenticatorData or clientDataJSON. It does no verification. Each field has a size limit, published in the schema (clientDataJSON 16 KiB, authenticatorData 8 KiB, attestationObject 64 KiB, signature 1 KiB, public key 2 KiB, at most 16 transports); larger input is INVALID_INPUT. |
webauthn_android_origin | Converts between an APK certificate fingerprint and an android:apk-key-hash: origin (exactly one input). |
webauthn_build_asset_links | Builds /.well-known/assetlinks.json (up to 32 apps and 32 fingerprints per app). |
webauthn_get_config | Shows the active configuration, including allowCallerCredentials, existingUserEnrollment and allowExplicitChallenge, plus store usage: revokedCredentials / maxRevokedCredentials and tombstonedUsers / maxTombstonedUsers. It contains no secrets. |
Resources: webauthn://config, webauthn://error-codes and webauthn://guide.
Typical flow
model ── webauthn_generate_registration_options {user:{name:"ada@example.com"}}
◀─ { ceremonyId, options }
browser: navigator.credentials.create({ publicKey: PublicKeyCredential.parseCreationOptionsFromJSON(options) })
→ credential.toJSON() (or @xkid1/webauthn/client startRegistration)
model ── webauthn_verify_registration { ceremonyId, response }
◀─ { credential, userId, stored: true, attestation, userVerified }
The server mints ceremonyId as a 128-bit handle, following the MCP 2026-07-28 pattern for explicit cross-call state. It is single use and expires after timeoutMs. A failed verification consumes it too, so a challenge issued through a ceremonyId cannot be retried or replayed. A registration handle cannot be used for sign-in.
Adding a second passkey
A user who already has a passkey can only add another one right after a user-verified sign-in (PIN or biometric, UV flag set) with an existing one. Request it with userVerification: "required":
model ── webauthn_generate_authentication_options { userId, userVerification: "required" }
◀─ { ceremonyId, options } → navigator.credentials.get(...)
model ── webauthn_verify_authentication { ceremonyId, response }
◀─ { userId, enrollmentGrant, enrollmentGrantExpiresAtMs, ... }
model ── webauthn_generate_registration_options { user: { id: userId, name }, enrollmentGrant }
◀─ { ceremonyId, options } → navigator.credentials.create(...)
model ── webauthn_verify_registration { ceremonyId, response }
A sign-in without UV, or one with a counter warning (counterPolicy: lenient), succeeds but returns no grant, so a stolen security key used without its PIN cannot add a passkey. A user has at most one outstanding grant: a newer sign-in's grant replaces the previous one. The grant is a 128-bit secret. It is single use (even a failed attempt consumes it), expires after 5 minutes, and lives in memory only, so a restart voids it. At most 10,000 grants are outstanding; when that store is full, the oldest grant is dropped and grant_store_full is logged (this can only deny someone their grant, never grant extra access). It is bound to the signed-in user and the credential that signed in, and becomes void if that credential is deleted. Treat it like a session secret: never log it or show it to the end user.
Caller-held challenges
With allowExplicitChallenge on, the verify tools accept expectedChallenge (16–1024 bytes, base64url) in place of ceremonyId, for callers that store the challenge themselves. On that path the server keeps no state, so it cannot enforce single use or expiry. You must delete the challenge after the first verification attempt and enforce its timeout yourself. On the authentication path, the signature counter is the only replay signal left, and synced passkeys usually report a counter of 0. This path never stores a registration and never issues an enrollment grant.
Errors
Problems with the protocol itself, such as an unknown method or an unsupported protocol version, come back as JSON-RPC errors. WebAuthn failures come back as tool results with isError: true and a stable code:
{ "isError": true, "structuredContent": { "error": { "code": "SIGNATURE_INVALID", "message": "Signature verification failed" } } }
These are the same codes the TypeScript package uses: CHALLENGE_MISMATCH, ORIGIN_MISMATCH, RP_ID_MISMATCH, USER_VERIFICATION_REQUIRED, COUNTER_REGRESSION, ATTESTATION_UNTRUSTED and others. The full table is in webauthn://error-codes.
Use as a Rust library
use webauthn_mcp::apps::server_side::{load_config, resolve, ChallengeSource, RelyingParty};
let cfg = resolve(load_config(None, &|k| std::env::var(k).ok())?)?;
let mut rp = RelyingParty::new(cfg)?;
let started = rp.start_registration(serde_json::from_value(serde_json::json!({ "user": { "name": "ada" } }))?)?;
// send started.options to the client, receive `response` …
let done = rp.finish_registration(ChallengeSource::Ceremony(&started.ceremony_id), &response, None, true)?;
The library also exposes the stateless primitives generate_*_options and verify_*_response. You can add custom attestation formats (tpm, android-key, apple…) by inserting into ResolvedConfig::attestation_verifiers.
- Identity: after
RelyingParty::finish_authentication, the signed-in account isFinishedAuthentication::user_id, which is the credential owner.verified.user_handleis the unverified client claim. - Enrollment:
RelyingParty::start_registrationapplies the enrollment rules.CredentialStore::insert(throughcredentials_mut()) is the raw store operation and bypasses them.CredentialStore::clear_tombstoneandCredentialStore::clear_revocationare operator actions: call them only after an out-of-band review. - Store limits:
CredentialStore::deletereturnsSTORE_LIMIT_REACHEDwhen the revocation list, or a needed tombstone slot, is full; nothing changes and the call can be retried after a prune. - Startup:
RelyingParty::startup_warnings()returns the warnings the binary prints at startup. - Stateless verification:
verify_authentication_responseignoresallowCallerCredentials,allowExplicitChallengeand the revocation list. Callers that keep their own store must refuse credentials they have deleted. - Input rules:
user.id,userIdandexpectedUserHandlemust be base64url user handles of 1–64 bytes.- Credential IDs must be 1–1023 bytes. A caller-supplied
credential.publicKeymust be at most 2048 bytes (MAX_COSE_KEY_BYTES);RelyingPartyenforces this too, not only the MCP tool. - An explicit challenge must be 16–1024 bytes, and an
enrollmentGrantexactly 16 bytes. user.nameanduser.displayNamemust each be at most 256 characters.excludeCredentialsandallowCredentialstake at most 256 entries.timeoutMsmust be 10000–600000.- These input types deserialise from JSON objects only (no positional arrays):
RegistrationOptionsInput,AuthenticationOptionsInput,UserInput,CredentialDescriptorInput,StoredCredential,AuthenticatorSelectionCriteria,RegistrationResponseJson,AuthenticationResponseJsonand theirresponseobjects.
- Exported limits: the constants are public, so you can check input before calling. They include:
MAX_DESCRIPTORS,MAX_USER_HANDLE_BYTES,MAX_USER_NAME_CHARS,MAX_DISPLAY_NAME_CHARSandlibs::cose::MAX_COSE_KEY_BYTES;MIN_TIMEOUT_MS,MAX_TIMEOUT_MS,MIN_EXPLICIT_CHALLENGE_BYTESandMAX_EXPLICIT_CHALLENGE_BYTES;MAX_CREDENTIALS,MAX_REVOKED,MAX_TOMBSTONED_USERS,ENROLLMENT_GRANT_BYTES,ENROLLMENT_GRANT_TTL_MSandMAX_PENDING_ENROLLMENT_GRANTS;MAX_PACKAGE_NAME_LENandMAX_FINGERPRINTS. The helpersvalidate_user_handle,validate_base64url_bytesandcheck_descriptor_countare public too.
Security notes
- Only a successful
webauthn_verify_*result means a user is authenticated. The identity is itsuserId, the credential owner, and neveruserHandle. - Adding a passkey to an existing account needs proof of a fresh, user-verified sign-in (
enrollmentGrant), so a registration response alone cannot attach an attacker's key to someone else's account. allowCallerCredentialsandallowExplicitChallengeweaken these guarantees. Both are off by default; see SECURITY.md.- Everything the model passes in is treated as untrusted:
- Arguments are deserialised into strict types with
deny_unknown_fields, and nested objects must be JSON objects. - Every limit a tool's input schema advertises is also enforced by the server.
- Error messages never echo client-supplied values.
- Arguments are deserialised into strict types with
- The server writes logs only to stderr and never logs challenges, keys, signatures, grants or raw user handles and credential IDs (see Security log).
- Certificate revocation (CRL/OCSP) and FIDO MDS lookups are out of scope. Credential revocation is handled by
webauthn_delete_credential. - ES512 (P-521) is unsupported because
ringdoes not implement it. Almost no authenticator uses it.
Report vulnerabilities privately; see SECURITY.md.
Operating the server
Startup warnings
At startup (and with --check-config) the server prints a [webauthn-mcp] warning: … line on stderr for each weaker setting: an in-memory credential store (lost on restart), allowCallerCredentials on, and allowExplicitChallenge on.
Security log
Security events are written to stderr, one line each, as [webauthn-mcp] security event=<name> key=value …:
| Event | Fields |
|---|---|
credential_registered | credential, user, grant=yes|no |
credential_deleted, revoked_credential_used, revocation_cleared | credential |
user_tombstoned, tombstone_cleared, enrollment_grant_issued, enrollment_grant_redeemed | user |
authentication_succeeded | credential, user (or unknown), uv=yes|no |
authentication_failed | reason (the stable error code only) |
enrollment_refused | reason (a fixed category, such as grant_required) |
store_limit_reached, store_near_limit | list=revoked|tombstoned |
grant_store_full | none |
credential and user are 8-hex-digit fingerprints: the first 4 bytes of SHA-256 over a per-process random salt and the value. They correlate events within one run, but cannot be reversed or matched against another run's logs or against entries in the credentials file. Lines never contain challenges, keys, signatures, grants, user names, raw user handles or raw credential IDs. revoked_credential_used means a deleted credential ID was presented. It is logged before any signature check (the key is gone, so possession cannot be verified), so it is worth investigating but is not proof that anyone holds the key.
Store limits
The revocation and tombstone lists hold at most 10,000 entries each and fail closed instead of forgetting old entries:
- At 90% of either limit, the server logs
store_near_limit(once per process run). - When a list is full,
webauthn_delete_credential(andCredentialStore::delete) fails withSTORE_LIMIT_REACHEDand logsstore_limit_reached. Memory and file stay unchanged. This blocks every delete, including revoking a compromised key, until an operator makes room. - Pruning is an operator action through the library only, never an MCP tool:
CredentialStore::clear_revocationremoves a revoked ID (it can then be registered or, withallowCallerCredentials, used again), andCredentialStore::clear_tombstoneremoves a tombstone. Prune only entries you have reviewed out of band; see SECURITY.md.
MCP ping
Legacy-era sessions (initialize handshake) answer ping. In the MCP 2026-07-28 era ping was removed from the spec (SEP-2575), so a modern-era ping returns JSON-RPC error -32601 (method not found) by design.
Development
cargo fmt --all --check
cargo clippy --all-targets --locked -- -D warnings
cargo test --locked # unit tests + every integration target
cargo test --locked --test mcp_tools # one target (see below)
cargo deny check # supply-chain policy (optional, needs cargo-deny)
smoke and e2e start the real server over stdio like an MCP client. To run them against a release binary or an image instead of the test build:
cargo build --release --locked
WEBAUTHN_MCP_CMD=target/release/webauthn-mcp WEBAUTHN_MCP_E2E_HOST_FILES=1 \
cargo test --locked --test smoke --test e2e
docker build -t webauthn-mcp:test .
bash scripts/test-image.sh webauthn-mcp:test
Inherited WEBAUTHN_* variables are removed from the child, so your shell cannot change a test. Against an image, tests that need host files (credentials file, config file, restarts) are skipped unless WEBAUTHN_MCP_E2E_HOST_FILES=1 says the runner mounted them.
Integration test targets in tests/:
| Target | Covers |
|---|---|
ceremonies | End-to-end registration and sign-in with a software authenticator. |
registration | Focused registration failures, each with its exact error code. |
credential_store | Revocation, tombstones and the on-disk credentials file. |
mcp | MCP lifecycle (both protocol eras), tool calls, resources and transport limits. |
enrollment | Enrollment grants, expiry, the registration race, the deny policy, tombstones and explicit challenges. |
map_only | Library input types reject positional arrays. |
mcp_tools | Table-driven tests for every tool: valid, missing, wrong-type and oversized input, schema enforcement, identity, allowCallerCredentials, revocation, enrollment grants, user verification, store saturation and error messages. |
security_log | The stderr security log over a real session contains no raw IDs, grants or challenges. |
server_manifest | server.json agrees with the Dockerfile and Cargo.toml and declares the required env vars and volume. |
smoke | The real binary starts, completes the MCP handshake and exits cleanly (fast; runs first). |
e2e | User journeys against the real binary: passkeys, credentials, persistence, config, errors, session, log safety. |
src/
├── apps/ mcp/ (protocol, server, tools, resources, transport) · server_side/ · android/
├── libs/ cbor · cose · crypto · asn1 · authenticator_data · client_data · attestation
├── utils/ helpers (base64url, bytes, crypto, guards, time, errors, user_handle)
├── types/ shared types (WebAuthn JSON, config, CBOR model, error codes, map_only)
├── lib.rs
└── main.rs
Release
Push a vX.Y.Z tag on main. .github/workflows/publish.yml then:
- runs the full CI and checks that the tag,
Cargo.toml,server.json(versions, names and the OCI package) and a## [X.Y.Z]CHANGELOG heading agree; - builds the five release archives, runs the
smokesuite against each binary, writesSHA256SUMSand attests every file (build provenance); - waits for approval by the reviewers of the
releaseenvironment; - pushes the multi-arch image to GHCR by digest, runs
smokeande2eagainst that digest, then tags it (with provenance, SBOM and an attestation), and creates a draft GitHub Release; - publishes the crate to crates.io after a second
releaseapproval. The first publish uses the one-timeCRATES_IO_BOOTSTRAP_TOKENActions secret; later publishes use OIDC trusted publishing; - publishes the GitHub Release.
The design and the one-time repository settings (including the first-publish token and trusted publisher) are in .github/CI_BUILD_STRATEGY.md. To verify a download, see SECURITY.md.
Community
License
MIT © xkid1