| 1 | package config |
| 2 | |
| 3 | // PluginEntry declares an external MCP server. Type selects the transport: |
| 4 | // "stdio" (default) launches Command/Args/Env as a subprocess; "http" |
| 5 | // (a.k.a. streamable-http) and "sse" connect to a remote URL with optional |
| 6 | // static Headers. String fields support ${VAR} / ${VAR:-default} expansion so |
| 7 | // secrets (bearer tokens, keys) come from the environment, not the file. The |
| 8 | // fields mirror Claude Code's mcpServers spec, so entries can come from either |
| 9 | // reasonix.toml's [[plugins]] or a project-root .mcp.json (see loadMCPJSON). |
| 10 | type PluginEntry struct { |
| 11 | Name string `toml:"name"` |
| 12 | Type string `toml:"type"` // "stdio" (default) | "http" | "sse" |
| 13 | Command string `toml:"command"` |
| 14 | Args []string `toml:"args"` |
| 15 | Env map[string]string `toml:"env"` |
| 16 | URL string `toml:"url"` |
| 17 | Headers map[string]string `toml:"headers"` |
| 18 | // StartupTimeoutSeconds overrides [tools].mcp_startup_timeout_seconds for |
| 19 | // initialize + tools/list. Zero keeps the global/default cap. |
| 20 | StartupTimeoutSeconds int `toml:"startup_timeout_seconds"` |
| 21 | // CallTimeoutSeconds overrides the default per-call deadline for this MCP |
| 22 | // server. Zero falls back to [tools].mcp_call_timeout_seconds. |
| 23 | CallTimeoutSeconds int `toml:"call_timeout_seconds"` |
| 24 | // ToolTimeoutSeconds overrides the per-call deadline for raw MCP tool names |
| 25 | // from this server. Keys are server-local tool names, not model-visible |
| 26 | // mcp__server__tool names. |
| 27 | ToolTimeoutSeconds map[string]int `toml:"tool_timeout_seconds"` |
| 28 | // Concurrency is "parallel" (default) or "serial"; see SPEC 3.16. |
| 29 | Concurrency string `toml:"concurrency"` |
| 30 | // AutoStart controls whether the server connects during session startup. |
| 31 | // Nil preserves historical behavior: configured servers start automatically. |
| 32 | AutoStart *bool `toml:"auto_start"` |
| 33 | // Tier is a legacy compatibility field. New config rendering omits it; enabled |
| 34 | // MCP servers connect automatically in the background unless auto_start=false. |
| 35 | // Historical values are accepted for old files: |
| 36 | // "eager" — blocks startup until the handshake completes; required for |
| 37 | // servers whose tools the system prompt depends on. |
| 38 | // "lazy" — legacy alias for background. |
| 39 | // "background" — placeholder + spawn fired at boot but not waited on; |
| 40 | // swap happens once the spawn finishes. |
| 41 | // Empty defaults to "background" so enabled MCPs connect automatically |
| 42 | // without blocking chat. Unknown non-empty values fall back to "background". |
| 43 | Tier string `toml:"tier"` |
| 44 | Source MCPConfigSource `toml:"-" json:"-"` |
| 45 | expansionEnv map[string]string |
| 46 | } |
| 47 |