跳到主要内容

Configuration file (config.toml)

Agent Store manages persistent configurations within ~/.agent-store/config.toml (TOML format), serving as the central manifest for default models, API provider definitions, model aliases, and default marketplace sources.

  • Default path: ~/.agent-store/config.toml (%USERPROFILE%\.agent-store\config.toml on Windows).
  • Loading behavior: The configuration file is optional. When absent, the App Server runs normally, requiring manual provider creation in the Web UI; when present, declared providers, default model parameters, and marketplace sources register automatically at startup.

This configuration adheres to standard user-level config.toml conventions ([providers.<name>] and [models."<provider>/<model>"] namespaces). The parser adopts a permissive strategy that tolerates unrecognized top-level and nested keys to maintain compatibility with shared configuration files.

The adjacent optional mcp.json file independently maintains MCP service definitions, as detailed in mcp.json: declaring MCP servers.

Full example​

default_model = "opencode/mimo-v2.5-free"

[providers.opencode]
type = "openai"
api_key = "sk-..."
base_url = "https://opencode.ai/zen/v1"

[providers.mimo]
type = "openai"
base_url = "https://api.xiaomimimo.com/v1"

[models."opencode/mimo-v2.5-free"]
provider = "opencode"
model = "mimo-v2.5-free"
display_name = "MiMo V2.5 Free"
max_context_size = 200000
max_output_size = 8000
capabilities = ["thinking", "tool_use"]

[models."opencode/laguna-s-2.1-free"]
provider = "opencode"
model = "laguna-s-2.1-free"
max_context_size = 256000
display_name = "Laguna S 2.1 Free"

# Default marketplace sources (auto-registered on first store/market call; each official market is an index.json on ModelScope)
[default_marketplaces.experts]
source_kind = "index"
source = "https://www.modelscope.cn/models/me9rez/flowy-marketplace/resolve/master/wb-market/experts/index.json"

Official marketplaces (experts / skills / connectors) are published on ModelScope as index-type sources (index.json + a shared payload archive or per-entry tar.gz). Clients fetch the small index.json first (HTTP HEAD against X-Linked-Etag, the content sha256, for incremental caching), then download entry payloads on demand, verifying integrity against payload.sha256 / per-entry sha256.

[default_marketplaces] declares custom marketplace sources. Configuration rules:

  • Override behavior: Explicit declarations supersede built-in defaults; runtime registers only declared sources. Removing or emptying this table restores default sources.
  • Distribution format: Official marketplaces use index-type distribution (source_kind = "index"); zip remains a supported source kind (third-party archives and frozen legacy bundles), and the legacy /source/<market>/... static directory trees are deprecated.
  • Fault tolerance: Sync failures retain the most recent valid local snapshot without invalidating installed entries.

Top-level fields​

FieldTypeDescription
default_modelstringDefault model alias in "<provider>/<model>" format; must resolve in [models]; applied when requests omit an explicit model
providerstableAPI provider mapping table → providers
modelstableModel alias configuration table → models
default_marketplacestableMarketplace sources registered automatically at startup → default_marketplaces
memorytableLocal file-based memory system policy: enabled sets global availability, distill_enabled controls post-turn distillation → memory
marketplacetableBackground update polling cadence → marketplace
toolstableHost-level tool policy (subtractive only) → tools
connector_proxytableAuthorization policy for external connector invocation proxying (disabled by default) → connector_proxy
credentialstableMapping table for secret:NAME references; local-only and excluded from network APIs

providers​

Table keyed by unique provider identifier. Credentials resolve strictly from this configuration table rather than implicit shell environment fallbacks.

FieldTypeRequiredDescription
typestringnoProvider protocol type mapping to runtime engines (e.g. openai, anthropic); recognized enums detailed below
api_keystringnoAPI authentication key stored in plaintext within the configuration file
base_urlstringnoBase API endpoint URL
enabledbooleannoEnables provider registration; defaults to true

Key security: api_key values are loaded solely into memory during client instantiation and excluded from system tracing and persistent logs. Restricting file permissions (e.g. chmod 600) is recommended.

What type actually accepts​

Omitting type or assigning "" defaults to custom (OpenAI Chat Completions-compatible protocol). Specific enums map as follows:

Declared value (type)Resolved protocolNotes
omitted / "" / custom / openai / kimiOpenAI Chat CompletionsServices adhering to the OpenAI wire specification (kimi, mimo, deepseek) map to this category
anthropicAnthropic MessagesRequires strict adherence to the Anthropic specification; enforces mandatory max_output_size declarations
openai_responsesOpenAI Chat Completions (not Responses)To enable the OpenAI Responses protocol, specify protocol = "openai-responses" at the model level
google-genai / vertexaiOpenAI Chat Completions (wrong protocol)Supported provider types for Google platforms are gemini and gemini-vertex-ai

Model-level protocol overrides (protocol field under [models]) apply with varying precedence: "openai-responses" takes effect globally across all platforms, while "anthropic" overrides apply exclusively to new-api gateway adapters.

models​

Table keyed by "<provider>/<model>". The provider identifier must match a valid entry in [providers].

FieldTypeDescription
providerstringOwning provider identifier (required)
modelstringUpstream model identifier (required)
display_namestringDisplay name rendered in the UI
max_context_sizeintegerMaximum context window token capacity
max_output_sizeintegerMaximum output generation token limit; required for anthropic protocols and subject to context limits
protocolstringModel-level protocol override (e.g. "openai-responses", "anthropic")
capabilitiesarray<string>Capability feature flags (e.g. ["thinking", "tool_use", "image_in"]); parsed for configuration compatibility
reasoning_keystringKey name mapping reasoning content within responses (e.g. reasoning_content); parsed for compatibility

Output ceiling (max_output_size)​

The anthropic protocol requires an explicit max_tokens parameter on outgoing requests. Models omitting this output ceiling fail request compilation:

Bad request: the anthropic protocol requires an explicit output ceiling;
set Max output tokens on the <provider>/<model> model in Settings -> Models
Protocolmax_output_size omittedDeclared explicitly
anthropicError: Request construction fails with BAD_REQUESTEmitted as max_tokens payload argument
OpenAI Chat CompletionsAllowed: Request omits parameter, deferring to server defaultsEmitted as max_tokens (or max_completion_tokens)
OpenAI ResponsesAllowed: Same as aboveEmitted as max_output_tokens

Dynamic downward convergence constraints on output ceiling​

The effective max_output_size parameter is subject to two downward convergence constraints:

1. Context Window Ratio Constraint (Local Clamping)

Outbound requests clamp maximum output tokens to min(declared_value, max_context_size / 4) to preserve adequate context margins:

Context windowDeclared max_output_sizeValue sent
1,000,00080008000 (1/4 equals 250,000; threshold unreached)
8,00081922000 (clamped to 1/4 context window threshold)

2. Upstream Range Negotiation (OpenAI Chat Completions only)

When an upstream endpoint rejects requests with a supported range is from L to U payload, the client extracts the maximum allowed ceiling, clamps the value, executes a single retry, and caches the negotiated limit for the lifetime of the process:

  • Cached limits persist in process memory and reset upon host restart.
  • Negotiation requires strict error message format matching; unsupported formats propagate immediately.
  • The OpenAI Responses protocol excludes this auto-negotiation mechanism.

Model registration and legacy backfill semantics​

  • Non-destructive writes: Model registration populates output limits only when unconfigured, preserving adjustments made via the Web UI.
  • Legacy backfilling: Models registered in earlier versions without explicit output limits are backfilled automatically during subsequent evaluation without requiring record recreation.

The runtime does not generate synthetic default output limits when unconfigured, preventing unexpected truncation. Values <= 0 are evaluated as undeclared.

default_marketplaces​

Marketplace source definitions. Registered on the first invocation of store or market APIs; duplicate IDs update existing entries with the new source.

If the configuration file is omitted or lacks [default_marketplaces], official defaults load automatically.

FieldTypeDescription
source_kindstringProtocol kind: index | zip | url | github | git | directory
sourcestringTarget URI; index points to an HTTP(S) index.json, zip accepts HTTP(S) URLs
[default_marketplaces.experts]
source_kind = "index"
source = "https://www.modelscope.cn/models/me9rez/flowy-marketplace/resolve/master/wb-market/experts/index.json"

[default_marketplaces.skills]
source_kind = "index"
source = "https://www.modelscope.cn/models/me9rez/flowy-marketplace/resolve/master/wb-market/skills/index.json"

[default_marketplaces.connectors]
source_kind = "index"
source = "https://www.modelscope.cn/models/me9rez/flowy-marketplace/resolve/master/wb-market/connectors/index.json"

Changing only source under the same [default_marketplaces.<id>] reactivates that marketplace and replaces its index and {market_root}/<id>/live cache, but it does not upgrade installed entries: installed snapshots stay as they are. Use an explicit store/update-entry (SDK store.update(item)) to move an installed resource to the new version; update before exporting too, because export reads the installed snapshot (the SDK's syncToMarketVersion does this — see TypeScript SDK §4.4).

memory​

Configures policies for the local file-based memory system across two independent scopes:

enabled: master switch for built-in memory​

FieldTypeDescription
enabledbooleanSet to false to disable the built-in memory system; defaults to true

Disabling this switch simultaneously halts the following subsystems:

Controlled subsystemDisabled behavior
System prompt memory injectionSuspends injection (excludes MEMORY.md index references)
remember toolUnregistered; models cannot persist new memory entries
Post-turn distillationBypasses post-session model extraction routines
Citation resolutionCeases parsing <nomi-mem-citation> tags and reference count increments
# Completely disable built-in memory
[memory]
enabled = false
  • Enabled by default. Existing local memory files are preserved and reactivated when toggled on.
  • Operates independently from distill_enabled; enabled = false invalidates distillation settings.
  • Enforced exclusively by the Agent Store host process; requires a process restart to take effect.

distill_enabled: disable post-turn memory distillation​

Memory distillation extracts salient dialogue facts asynchronously at the conclusion of an interaction turn. This extra invocation occurs prior to turn completion, introducing 6~15 seconds of latency. Setting this field to false removes this overhead.

FieldTypeDescription
distill_enabledbooleanSet to false to disable distillation; defaults to true
# Disable post-turn memory distillation
[memory]
distill_enabled = false

Priority resolution: NOMIFUN_MEMORY_DISTILL environment variable > [memory].distill_enabled configuration > default (enabled).

marketplace​

Configures background update polling intervals. Disabled by default.

FieldTypeDescription
auto_update_interval_hoursintegerPolling frequency in hours. 0 or omitted disables polling; positive integers enable it
# Check official marketplace sources every 6 hours
[marketplace]
auto_update_interval_hours = 6

Background updates apply exclusively to official marketplace endpoints flagged for automated syncing. Checks use HTTP ETag and SHA256 validation to prevent unnecessary payload transfers.

tools​

Host-level tool configuration defining the tool catalog exposed to sessions. Supports subtractive restriction only; disabled capabilities remain unavailable across all host sessions.

Applies exclusively to the Agent Store host; read once at process startup.

FieldTypeDescription
enabledarray<string>Whitelist: Retains only declared tools when non-empty; empty or omitted indicates no whitelist constraint
disabledarray<string>Blacklist: Evaluated after the whitelist; matches exact tool names or mcp__ wildcards
webbooleanWebSearch / WebExtract tooling switch; defaults to true
computerbooleanComputer desktop control tooling switch; defaults to true
browserbooleanBrowser automation tooling switch; defaults to true
planbooleanEnterPlanMode / ExitPlanMode planning tooling switch; defaults to true
lspbooleanLsp language service tooling switch; defaults to true
domainstableFunctional domain switches mapping to tools.domains; each defaults to true

Core filesystem tools (Read / Write / Edit / Glob / Grep / Bash) are unaffected by boolean flags and must be excluded via disabled explicitly.

tools.domains​

Business domain (domain)Disabled capability and impact
cronScheduled task execution (cron_create / cron_list / cron_delete)
meetingMeeting audio analysis and listening contexts (meeting.*)
knowledgeKnowledge base search and retrieval tools (knowledge_*)
learningCourse generation and tracking tools (learning_*)
mediaMedia synthesis capabilities (image_generate)
companionCompanion memory recall and active suggestion tools (companion_*)
requirementRequirement pipeline tracking (requirement_*)
goalGoal-directed autonomous multi-turn loops (update_goal)

Disabling a domain revokes tool access and detaches associated host context listeners.

# Retain core engineering tools; disable auxiliary domain capabilities
[tools]
web = true
computer = false
browser = false

[tools.domains]
cron = false
meeting = false
knowledge = false
learning = false
media = false
companion = false
requirement = false

Environment variable override (AGENT_STORE_TOOLS)​

The host supports overriding tool configurations dynamically via environment variables:

PropertyRule and operational behavior
FormatJSON string matching the [tools] table schema; {} resets to permissive defaults
PrecedenceAGENT_STORE_TOOLS env variable > config.toml > default permissive policy
ScopeCompletely replaces the [tools] table rather than merging fields
FallbackParsing errors trigger warning logs and revert to the configuration file
LifecycleEvaluated once during process initialization
AGENT_STORE_TOOLS='{"computer":false,"domains":{"knowledge":false}}' agent-store

For complete integration examples, refer to the TypeScript SDK cookbook §5.4.

connector_proxy​

Authorization policies for proxying external tool calls to installed MCP connectors. Proxying keeps credentials and network sockets isolated within the local host environment.

Evaluated exclusively by the Agent Store host; excluded from remote APIs and loaded at startup.

FieldTypeDescription
enabledbooleanMaster proxy switch; set to true to enable proxying, defaults to false
allowarray<string>Whitelist: Permits only matching tools; omitted allows all active connectors
denyarray<string>Blacklist: Evaluated after the whitelist

Tool identifiers use the format mcp__<connector>__<tool>, supporting wildcard patterns such as mcp__<connector>__*.

[connector_proxy]
enabled = true # Enable tool proxying
allow = ["mcp__github__*"] # Allow tools from GitHub connector only
deny = ["mcp__*__delete_*"] # Filter destructive operations

Evaluation order:

#Authorization gateFailure error code
1Table absent or enabled != truepolicy_denied
2Target connector not foundnot_found
3Configured allow list matches no itemspolicy_denied
4Matches deny blacklist rulepolicy_denied
5Connector is registered but currently disabledconnector_unavailable

Setting AGENT_STORE_CONNECTOR_PROXY to a valid JSON string entirely replaces this configuration table at runtime.

mcp.json: declaring MCP servers​

mcp.json resides adjacent to config.toml to provide static declarations for local MCP servers:

  • Default path: ~/.agent-store/mcp.json (shares directory with active config.toml).
  • Loading behavior: Optional file; loaded at startup, requiring a restart when modified.
  • Storage semantics: Declarations represent non-persistent runtime views and do not populate the mcp_servers database table.
  • Precedence: Matching names prioritize mcp.json declarations over mcp_servers table rows; runtime invocation bindings take highest precedence.
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/srv/data"],
"env": { "UPSTREAM_TOKEN": "secret:UPSTREAM_TOKEN" },
"cwd": "servers/filesystem",
"toolTimeoutMs": 30000
},
"linear": {
"url": "https://mcp.linear.app/mcp",
"headers": { "X-Tenant": "acme" },
"bearerTokenEnvVar": "LINEAR_TOKEN"
},
"legacy": {
"transport": "sse",
"url": "https://mcp.example.com/sse"
}
}
}

The presence of command defines a stdio process; providing url without transport defines Streamable HTTP; setting "transport": "sse" engages the SSE protocol.

FieldApplies toDescription
commandstdioExecutable path or command
argsstdioCommand-line arguments array; defaults to empty
envstdioEnvironment variables map; supports secret:NAME references
cwdstdioWorking directory; relative paths resolve against the mcp.json directory
urlremoteRemote endpoint URL (defaults to Streamable HTTP)
headersremoteCustom HTTP request headers; supports secret:NAME references
bearerTokenEnvVarremoteEnvironment variable name storing Bearer credentials
transportremoteProtocol override; accepts "sse" only
enabledallToggles server availability; defaults to true
deferred—Unsupported; presence causes item validation to fail
startupTimeoutMsallHandshake and initialization timeout in milliseconds; defaults to 30000
toolTimeoutMsallWall-clock execution timeout per tool invocation in milliseconds
enabledToolsallWhitelist tool pattern array
disabledToolsallBlacklist tool pattern array; evaluated after whitelist

Strict schema validation rejects entries containing unrecognized keys or mismatched transport properties without invalidating surrounding definitions.

Divergences from reference implementation​

Key behavioral differences from standard CLI reference implementations:

  • deferred unsupported: Dynamic tool loading is managed via ToolSearch and subtractive policies; explicit deferred keys trigger validation failure.
  • User-level scope only: Operates strictly on ~/.agent-store/mcp.json, excluding project-level file discovery.
  • Static lifecycle: Configuration parses once during host startup; modifications take effect on restart.
  • No global timeout inheritance: Timeout properties must be configured per server definition.
  • Strict timeout limits: Timeouts are capped at 600,000 ms (10 minutes); entries exceeding this ceiling fail validation.

Server keys, tool names, and tool filtering​

Server keys prefix derived tool identifiers (mcp__<key>__<tool>). Keys must consist of alphanumeric characters, underscores, and hyphens, start and end with an alphanumeric character, and not exceed 40 characters in length.

enabledTools and disabledTools accept two filtering patterns:

  • Prefixing with mcp__: Matches complete runtime tool identifiers including generated hash suffixes;
  • Standard string: Matches local tool names exposed by the server;
  • *: Wildcard matching all tools provided by the server.

To restrict all tools from a server globally, declare the rule in [tools]:

[tools]
disabled = ["mcp__<key>__*"]

Sensitive credential references (secret:NAME)​

The env, headers, and url template sections support secret:NAME or ${NAME} syntax. During process execution, the host resolves references against ~/.agent-store/config.toml's [credentials] table (or process environment variables), preventing plain-text token exposure.

# Adjacent config.toml
[credentials]
UPSTREAM_TOKEN = "…" # Injected into secret:UPSTREAM_TOKEN

Security isolation notice: Standard management endpoints (such as config/get and config/set) strictly mask the [credentials] table to protect against network scanning and credential dumping. For connectors requiring API Keys or tokens, the host exposes a principal-scoped directed write surface (connector/credential/set) that accepts only declared keys from token-schema.json. Stored secrets are permanently masked in network payloads (write-only, never echoed); unresolved secret references trigger fail-closed omission and system warnings.

Web UI management and persistent editing​

The Web UI "MCP Management" interface reflects the status of this configuration directly:

  • Summarizes registered servers, transport modes, active states, and validation error diagnostics.
  • The interface toggles the enabled field using text-level minimal edits, preserving indentation and comments.
  • Saving edits executes schema validation, blocking corrupt writes and highlighting invalid line positions.

Comparison with third-party configurations (Kimi Code / Claude Code)​

DimensionAgent StoreKimi Code and others
File path~/.agent-store/config.tomlTool-specific paths (e.g. ~/.kimi-code/config.toml)
[providers] / [models]Identical schema supporting standard parametersIdentical schema with provider-specific variations
max_output_sizeEnforced with 1/4 context window clamping; mandatory for anthropicInferred automatically from model metadata
default_model"<provider>/<model>" alias syntaxIdentical syntax
Unrecognized keysPermissively preservedPermissively preserved
Environment fallbackRequires explicit configuration file entryFallbacks supported by select tools
Custom additionsdefault_marketplaces, [memory], [marketplace], [tools].domains, [connector_proxy], [credentials]Lacks domain toggles and proxy authorization tables
MCP declarations~/.agent-store/mcp.json (user-level only)Supports project-level .kimi-code/mcp.json overrides

Migration considerations:

  • Provider Enum Compatibility: Unrecognized provider type strings default to OpenAI-compatible handling.
  • Anthropic Output Limits: Integrating anthropic endpoints mandates an explicit max_output_size declaration.