Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
MCP_HOSTNoAddress on which the HTTP server listens.0.0.0.0
MCP_PATHNoMCP endpoint path. It must be an absolute, static, non-root path and must not overlap /health./mcp
MCP_PORTNoHTTP listen port (1-65535). Keep this consistent with expose, any ports mapping, and the client URL.8000
LOG_LEVELNoUvicorn log level, such as debug, info, warning, or error.INFO
MCP_SCOPESNoComma-separated tool groups to register. Allowed values are read, write, admin, and destructive. Destructive tools require both the destructive scope and their feature flag.read,write,admin
ANKI_SYNC_HOSTNoCustom sync-server HTTP(S) base URL. Non-loopback servers require HTTPS; credentials, query strings, and fragments are rejected.
MCP_AUTH_TOKENNoBearer token supplied directly. Use exactly one of this setting and MCP_AUTH_TOKEN_FILE; the Compose setup uses the file variant.
ANKI_SYNC_ON_READNoSynchronize before coordinated reads. Individual read tools can still request a sync with sync_before=true.false
MCP_ALLOWED_HOSTSNoComma-separated HTTP Host patterns accepted by MCP DNS-rebinding protection. Add the service name or hostname used by remote clients.testserver,localhost,localhost:*,127.0.0.1,127.0.0.1:*,anki-mcp,anki-mcp:*
MCP_MAX_PAGE_SIZENoMaximum limit accepted by paginated tools (1-1000).100
ANKI_SYNC_ON_WRITENoSynchronize before and after coordinated mutations. Disabling this permits local changes to remain unsynchronized.true
ANKI_SYNC_PASSWORDNoSync password supplied directly. It is optional after authentication has been persisted; do not set it together with ANKI_SYNC_PASSWORD_FILE.
ANKI_SYNC_USERNAMENoAnkiWeb username or self-hosted sync username. Required for anki_sync_login and for bootstrap when no persisted authentication exists.
ANKI_BOOTSTRAP_MODENoStartup behavior: disabled, or download_if_empty to authenticate and perform a download-only initialization when the local collection is empty. Startup fails rather than uploading if the server requests a full upload.disabled
ANKI_MAX_BATCH_SIZENoMaximum notes accepted by one atomic batch-create operation (1-500).50
MCP_ALLOWED_ORIGINSNoComma-separated browser origins accepted by MCP transport security. Add explicit trusted origins when using a browser-based client.http://localhost:*,http://127.0.0.1:*
MCP_AUTH_TOKEN_FILENoPath to a file containing the bearer token. One trailing newline is ignored. Compose mounts ./secrets/anki_mcp_token at /run/secrets/anki_mcp_token.
MCP_MAX_CARD_FIELDSNoMaximum fields or templates returned for a note or note type (1-1000); omitted counts are reported.100
MCP_MAX_SEARCH_SCANNoMaximum collection items that bounded list/search and tag operations may scan (1-1000000).10000
ANKI_ALLOW_FULL_SYNCNoRegisters explicit full-download and full-upload recovery tools. It must also be enabled for schema-changing tools.false
ANKI_COLLECTION_PATHNoLocal Anki collection file. Compose persists its parent directory in the anki_data volume; do not point multiple processes at the same file./data/collection.anki2
ANKI_MAX_MEDIA_BYTESNoMaximum decoded size of a media file read, written, or renamed (1-16777216 bytes).1048576
MCP_MAX_REQUEST_BYTESNoMaximum MCP request-body size (1024-16777216 bytes); larger requests receive HTTP 413.1048576
ANKI_ALLOW_DESTRUCTIVENoRegisters delete and FSRS rescheduling preview/apply tools when MCP_SCOPES also includes destructive. Applying destructive changes requires a preview token and verified fresh backup.false
MCP_MAX_RESPONSE_BYTESNoMaximum serialized tool-result size (1024-16777216 bytes). It must be at least MCP_MAX_RENDERED_FIELD_BYTES + 4096.1048576
ANKI_SYNC_PASSWORD_FILENoPath to the sync-password file. Compose mounts ./secrets/anki_sync_password at /run/secrets/anki_sync_password. Remove the setting and secret after login if automatic reauthentication is not needed.
ANKI_ALLOW_REVIEW_ANSWERSNoRegisters the administrative card-answering tool, which changes scheduling state.false
ANKI_ALLOW_SCHEMA_CHANGESNoRegisters note-type and template mutation tools when ANKI_ALLOW_FULL_SYNC is also enabled. Note-type deletion additionally requires destructive access.false
ANKI_SYNC_TIMEOUT_SECONDSNoMaximum wait for media synchronization (> 0, up to 3600 seconds).300
MCP_MAX_RENDERED_FIELD_BYTESNoUTF-8 byte limit for each rendered text field in responses (1-4194304); oversized values are truncated and marked.262144
ANKI_CONFIRMATION_TTL_SECONDSNoLifetime of destructive-operation preview tokens (30-3600 seconds). Tokens are single-use.300

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Server capabilities have not been inspected yet.

Tools

Functions exposed to the LLM to take actions

NameDescription

No tools

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources