Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
REDIS_URLNoRedis URL used for caching full load_chat_context responses when set.
HF_HUB_OFFLINENoSet to 1 to disable Hugging Face downloads entirely.
CONTEXT_BROKER_PORTNoPort for network transports; serve defaults to 8771.8771
TRANSFORMERS_OFFLINENoSet to 1 to disable Transformers downloads entirely.
CONTEXT_BROKER_DEVICENoTorch device for the embedding model.cpu
CONTEXT_BROKER_LLM_MODELNoOptional LLM model identifier exposed to MCP clients.
CONTEXT_BROKER_REDIS_URLNoRedis URL when backend is redis.
CONTEXT_BROKER_TRANSPORTNoTransport: stdio (default), sse, or streamable-http.stdio
CONTEXT_BROKER_AUTH_TOKENNoBearer token required on WS transport and dashboard when set.
CONTEXT_BROKER_LOCAL_ONLYNoPrefer cache-only loading, with one bootstrap download if missing.0
CONTEXT_BROKER_LLM_API_KEYNoOptional LLM API key.
CONTEXT_BROKER_STORAGE_DIRNoBase directory for global storage.~/.context-broker
CONTEXT_BROKER_LLM_BASE_URLNoOptional LLM API endpoint URL.
CONTEXT_BROKER_PROJECT_ROOTNoDefault project root.Auto-detected
CONTEXT_BROKER_STORAGE_MODENoStorage mode: global, in-project, or both.both
CONTEXT_BROKER_AUTO_LOAD_ENVNoLoad the nearest .env file at startup.1
CONTEXT_BROKER_DEFAULT_QUERYNoDefault auto-context query.main entry point configuration setup
CONTEXT_BROKER_DASHBOARD_HOSTNoDashboard bind host.127.0.0.1
CONTEXT_BROKER_DASHBOARD_PORTNoDashboard bind port.8770
CONTEXT_BROKER_MEMORY_POOL_MBNoBounds estimated retained cache payloads for the shared service.256
CONTEXT_BROKER_CONTEXT_BACKENDNoCross-chat backend: none, honcho, or redis.none
CONTEXT_BROKER_EMBEDDING_MODELNoSentence-transformers model for embeddings.all-MiniLM-L6-v2
CONTEXT_BROKER_INDEX_DISK_CACHENoPersist corpus embeddings under .cache/.1
CONTEXT_BROKER_REDIS_KEY_PREFIXNoRedis key prefix.context-broker
CONTEXT_BROKER_USE_ACCOUNT_NAMENoUse the OS account name as default user peer id.0
CONTEXT_BROKER_SHARED_RUNTIME_DIRNoRelocates the shared service runtime descriptor directory.~/.cache/context-broker/service
CONTEXT_BROKER_HONCHO_WORKSPACE_IDNoHoncho workspace id.context-broker
CONTEXT_BROKER_INDEX_MAX_FILE_BYTESNoSkip files larger than N bytes (0 disables).2000000
CONTEXT_BROKER_WORKTREE_SHARED_ROOTNoShare index/cache/storage across linked git worktrees.1
CONTEXT_BROKER_ACCOUNT_NAME_OVERRIDENoExplicit override for the resolved user peer id.
CONTEXT_BROKER_EXIT_WHEN_PARENT_DIESNoExit when the launching editor/AI process disappears.1
CONTEXT_BROKER_HONCHO_CONTEXT_TOKENSNoDefault Honcho context token budget.2000
CONTEXT_BROKER_HONCHO_SESSION_PREFIXNoHoncho session id prefix.context-broker
CONTEXT_BROKER_INDEX_FOLLOW_SYMLINKSNoFollow symlinks while collecting files.0
CONTEXT_BROKER_CHAT_CACHE_TTL_SECONDSNoTTL for the Redis chat-payload cache (0 disables).300
CONTEXT_BROKER_AUTO_WARM_CACHE_ON_SAVENoInvalidates then warms the default-params chat cache on save.1
CONTEXT_BROKER_HONCHO_LIMIT_TO_SESSIONNoLimit Honcho context/search to selected session.1
CONTEXT_BROKER_QUERY_CACHE_MAX_ENTRIESNoQueries keep at most this many entries per project.128
CONTEXT_BROKER_REGEX_MAX_PATTERN_CHARSNoMax caller regex length for find_in_codebase.2000
CONTEXT_BROKER_UCR_PUBLIC_SURFACE_ONLYNoExpose only the minimal UCR router surface.0
CONTEXT_BROKER_ALLOW_UNAUTHENTICATED_BINDNoPermit non-loopback binds without AUTH_TOKEN.0
CONTEXT_BROKER_QUERY_CACHE_MAX_FILE_BYTESNoCap for disk query-cache files.4000000
CONTEXT_BROKER_REGEX_MATCH_TIMEOUT_SECONDSNoPer-file regex timeout (ReDoS guard).2.0
CONTEXT_BROKER_PARENT_POLL_INTERVAL_SECONDSNoOrphan-process poll interval.3
CONTEXT_BROKER_ENABLE_PROGRESS_NOTIFICATIONSNoPer-call MCP progress updates.0
CONTEXT_BROKER_IDLE_RESOURCE_TIMEOUT_SECONDSNoRelease in-memory caches after this idle time (0 disables).900
CONTEXT_BROKER_ROUTER_PLAN_CACHE_MAX_ENTRIESNoMax in-memory routing plans (0 disables).128
CONTEXT_BROKER_IDLE_RESOURCE_CLEANUP_INTERVAL_SECONDSNoIdle cleanup check interval.30

Instructions

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

For user-facing command help, open context-broker://commands or select the context-broker prompt. Terminal help: context-broker --help.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}
logging
{}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
extensions
{
  "io.modelcontextprotocol/ui": {}
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
delegate_large_taskA

Offer to split a large task into 2–4 independent agents, then review the results.

Call only for a large task with a user-specified exact model. Include the original goal, conversation decisions, constraints, relevant files, and acceptance criteria. This tool asks the user whether to split BEFORE starting agents. Decline/cancel or unavailable elicitation starts no agents. Workers return proposals; the host must integrate and execute verification before claiming completion. Never split dependent work or drop context to fit the input limit.

save_model_handoffA

Save before switching models. Pass exact messages and all known project state.

State requires goal, messages (string-valued objects), decisions, constraints, facts, tasks, acceptance_criteria, and open_questions. Each task has task/status, failure_reason if failed, and evidence if completed. Include relevant file paths. Give the returned handoff_id to the next model. Existing snapshots are immutable.

load_model_handoffA

Load saved context before the new model continues. Never silently trims memory.

Choose a byte budget fitting the host's output/context limits. A stale checkpoint or insufficient budget returns failed; recover context before continuing work. This restores supplied memory, not a model's private reasoning or unsaved history.

configure_history_indexingB

Ask the user Index / No index for this project's MCP history folder.

No index still checks history directly for relevant prior issues. It deletes only the optional derived index, never chat records or handoffs. Call at setup or when the user wants to change this preference. Unsupported consent changes nothing.

lookup_project_historyB

Check this specific issue before new work. Return at most three relevant excerpts.

Always reads/checks project history, even with indexing disabled. No match means no history is injected. Similarity is conservative keyword overlap, not a claim of semantic equivalence. Partial indicates scan limits or unreadable records.

search_codebase_toolC

Search the codebase using semantic similarity.

auto_searchC

Auto-search for entry points and configuration.

find_in_codebaseA

Find exact literal or regex pattern matches in the codebase.

Runs entirely locally — no embedding model, no external LLM call. Returns file paths, line numbers, and context snippets for each match. Use this instead of search_codebase_tool when you need precise text matches (e.g. "session_id", "def authenticate", a specific import).

save_search_resultsC

Search and save results to JSON.

list_saved_resultsC

List saved JSON results for a project.

load_saved_resultsC

Load previously saved search results.

get_storage_configB

Get current storage configuration.

token_counterC

Get latest token usage report for editor integrations.

token_historyC

Show graph-ready token savings history across search requests.

token_integration_manifestC

Return integration options for GraphQL, LangGraph, and other agent runtimes.

route_taskC

Route a task to the smallest relevant MCP tool slice.

execute_planC

Execute a UCR plan through safety gates, delegating downstream calls as needed.

search_contextC

Search relevant project context through the UCR public surface.

explain_planC

Explain a UCR plan in client-neutral JSON.

execute_selected_toolC

Backward-compatible helper: run one selected tool through the safety gate.

get_route_metricsB

Return UCR route/execution metrics for observability dashboards.

benchmark_routerC

Run a lightweight in-process router benchmark.

context_backend_statusB

Show configured cross-chat context backend status.

save_chat_contextC

Save chat messages to the configured cross-chat context backend.

record_sessionA

Persist an ENTIRE chat history in one call.

turns is a list of {"user": "...", "assistant": "..."} dicts in chronological order — pass every exchange you have. Each turn is appended to the session (never overwriting prior turns), mirrored to the local JSON ledger, and the chat cache is warmed at the end so the next load is an immediate cached hit.

Prefer this over a flurry of record_turn calls when you have the full conversation in context (e.g. when the user asks you to save the whole chat).

record_turnA

Persist the most recent (user, assistant) exchange.

Call this after EVERY response you give in a conversation, with the user's question and your reply, so the chat history accumulates across sessions. Each call APPENDS — prior turns are never overwritten. The same exchange is mirrored to a local JSON ledger under .context-broker/ chats/, and the chat cache is warmed automatically so the next load_chat_context is a cached hit.

Use a stable session_id per conversation (e.g. the editor's chat id or the date). Different conversations should use different session_ids. For dumping an entire conversation at once, prefer record_session.

list_user_activityA

Show when each user last asked something in this project.

Without peer_id: returns the per-user summary list — peer_id, first_seen, last_seen, request_count for everyone who has talked in this project. With peer_id: returns that user's full audit log, i.e. the last limit requests as {timestamp, session_id} entries. Requires CONTEXT_BROKER_CONTEXT_BACKEND=redis.

load_cross_session_contextA

Search every session of one project and return the most important matching turns across all of them.

"Important" means: messages whose content matches search_query (case- insensitive substring), ranked by recency descending. Each result is annotated with the originating session_id so the dashboard can deep-link back. Requires CONTEXT_BROKER_CONTEXT_BACKEND=redis.

load_chat_contextC

Load cross-chat context from the configured context backend.

ensure_agents_md_toolB

Ensure AGENTS.md exists for a project. Creates it if missing.

validate_agents_md_toolB

Validate AGENTS.md for a project and report missing information.

generate_agents_md_toolB

Generate AGENTS.md for a project. Overwrites existing if force=True.

scan_projects_for_agents_mdC

Scan for projects missing AGENTS.md.

ensure_changelog_toolA

Ensure CHANGELOG.md exists and is up to date with git history.

Creates CHANGELOG.md if missing, or appends new commits since the last update. Parses conventional commits (feat:, fix:, security:, etc.) and categorizes them.

validate_changelog_toolA

Validate that CHANGELOG.md is up to date with git history.

Checks for undocumented commits and reports how many are missing.

generate_version_changelogC

Generate a changelog section for a specific version release.

get_changelog_stats_toolA

Get statistics about the current CHANGELOG.md.

ensure_feature_docs_toolB

Ensure documentation exists for all recent feature changes.

Creates docs/{feature}/{feature}-{fix-type}.md for each detected feature change, or docs/{feature}/{fix-type}.md if no related docs exist yet.

scan_missing_docs_toolC

Scan for feature changes that are missing documentation.

get_docs_stats_toolC

Get statistics about feature documentation.

check_environmentA

Check this machine for everything context-broker needs to run.

Reports missing required/optional dependencies (Python version, packages, embedding model cache, external tools). Nothing is installed by default. To install missing required Python packages, call again with install_missing=True; the tool then asks for explicit confirmation and only proceeds when confirm="yes".

Prompts

Interactive templates invoked by user choice

NameDescription
context-brokerShow Context Broker commands, history controls, and model handoffs.
auto-searchPrompt requiring semantic code search before answer.

Resources

Contextual data attached and managed by the client

NameDescription
commands_resourceRead the installed Context Broker commands without loading project memory.
auto_context_resourceAuto-provide code context on requests.
token_counter_resourceProvide latest token counter for editor dashboards.

TDQS

C2.6/5.0

Scored across 41 tools

Disambiguation2/5

Several tool clusters overlap heavily: record_turn, record_session, and save_chat_context all persist chat context; search_codebase_tool, find_in_codebase, auto_search, and search_context all search; and ensure/generate/validate variants exist across docs. Descriptions help somewhat, but an agent can easily misselect among similar persistence, search, and documentation tools.

Naming Consistency3/5

Most names use snake_case with verb_noun structure, which is readable. However, the convention is inconsistent: several tools carry a redundant _tool suffix while others do not, and some names are noun-only (token_counter) or vague (auto_search, benchmark_router).

Tool Count2/5

With 41 tools, the server is far beyond a typical well-scoped set and mixes context storage, search, model handoffs, documentation generation, UCR routing, token analytics, benchmarking, and environment checks. This breadth makes the surface feel heavy and harder to navigate than the core purpose requires.

Completeness3/5

The surface covers many operations across context recording/loading, search, handoffs, docs, token metrics, and environment checks. Notable lifecycle gaps remain, such as no delete/prune for saved context or saved results, no update for saved results, and no cleanup/removal operations for generated docs.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues