Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
CAG_MCP_URLNoAPI base URL.https://api.openai.com/v1
CAG_MCP_MODELNoAnswering model.gpt-6-luna
OPENAI_API_KEYNoFallback OpenAI API key, used when CAG_MCP_API_KEY and the user file's api_key are not set.
XDG_CACHE_HOMENoBase for the default `state_dir` (`$XDG_CACHE_HOME/cag-mcp`).
CAG_MCP_API_KEYNoOpenAI API key. Order: CAG_MCP_API_KEY, then the user file, then OPENAI_API_KEY.
XDG_CONFIG_HOMENoLocation of the user config file (`$XDG_CONFIG_HOME/cag-mcp/config.toml`).
CAG_MCP_PROVIDERNoProvider to use. Only `openai` is implemented; `fake` is an offline test double.openai
CAG_MCP_CACHE_TTLNo`30m` or `12h`, sent as `prompt_cache_options.ttl`.12h
CAG_MCP_STATE_DIRNoWhere snapshots and ledgers live.$XDG_CACHE_HOME/cag-mcp (default ~/.cache/cag-mcp)
CLAUDE_PROJECT_DIRNoThe project directory (exported by Claude Code to the plugin's stdio MCP servers).
CAG_MCP_OVERLAY_ENABLEDNo`false`: any change rebuilds the snapshot.true
CAG_MCP_MAX_INPUT_TOKENSNoA larger corpus (or request) is an error.900000
CAG_MCP_REASONING_EFFORTNoReasoning effort. Unset: `none` for `gpt-6-luna` and `gpt-6.1-terra`; for other models no effort is sent.
CAG_MCP_RESPECT_GITIGNORENoInside git, select tracked files only.true
CAG_MCP_LONG_PROMPT_TOKENSNoA larger corpus is a warning in `status`.272000
CAG_MCP_OVERLAY_MAX_TOKENSNoAbsolute overlay limit in tokens; `0` disables this limit.0
CAG_MCP_OVERLAY_MAX_PERCENTNoOverlay size as % of the snapshot; `0` disables this limit.10
CAG_MCP_CACHE_READ_EXTENDS_TTLNoHow the ledger predicts expiry: from the last write only, or from the later of the last write and the last read.false
CAG_MCP_OVERLAY_WHOLE_FILE_PERCENTNoA changed file whose diff exceeds this % of the new file is sent whole.50

Instructions

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

cag-mcp answers questions about this project's documentation from a cached copy of the whole doc set. Call ask before searching the docs yourself; it replies briefly with file:line citations that the server has verified on disk; read those lines. Citations marked unverified need checking before you rely on them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}

Tools

Functions exposed to the LLM to take actions

NameDescription
askB

Ask a question about the project's documentation.

Returns a brief answer and citations as path:start-end; read the cited lines yourself. A citation the server could not find in the current file is marked unverified. Each question is independent.

statusC

Show files, tokens, the snapshot in use, its predicted cache state, overlay size, usage and cost.

rebuildC

Build a new snapshot of the corpus from this checkout now.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription
skill-ask
skill-init

TDQS

B3.2/5.0

Scored across 3 tools

Disambiguation5/5

ask queries the corpus, status reports state, and rebuild regenerates the snapshot — three clearly distinct operations with no overlap. An agent can pick the right tool without inference from descriptions.

Naming Consistency4/5

All names are single lowercase words with no separators, which is internally consistent and readable. Minor deviation: 'ask' and 'rebuild' are verbs while 'status' is a noun, breaking a strict verb pattern.

Tool Count4/5

Three tools map cleanly onto the query / inspect / maintain lifecycle of a snapshot-backed doc server, with each earning its place. The surface is minimal but not artificially thin given the narrow domain.

Completeness3/5

The query-and-cite loop has a notable dead end: ask returns `path:start-end` citations telling the agent to read the lines itself, but no tool exposes file reads, so unverified citations cannot be resolved. No tool exists to refresh or clear a stale overlay/cache beyond a full rebuild.