fix(api): load local MCP config in personal mode - #295
Conversation
When no platform context is present (personal/local mode without org/team), loadMCPConfigForRequest now falls back to loading mcp_config.json from the local config directory instead of returning an empty config. Previously MCP servers were silently unavailable in personal mode because the function returned no servers when it found no platform context. This made MCP tools unusable through the Studio API for non-platform sessions.
|
Hi @dimtas, Personal mode is a deprecated mode, we have moved to platform mode only, even when running locally, so we don't have multiple implementations to mantain (but there are still some fallbacks to be removed, which could make a different understanding). Before it used the config file to set the MCP servers, but now it should always live in the database, which for local, usually is sqlite. Are you having a specific issue when setting the MCP server through the UI? Thank you |
|
I'm currently running astonish agent locally and I had difficulties with loading a local stdio mcp-server. |
|
@dimtas Are you running in sandbox mode? Or on the host? Do you mind sharing which MCP server you are having issues? When running in host mode, maybe there are dependencies that are not satisfied, like uvx or npx, when running in sandbox, these dependencies are provided by the custom container. |
Summary
loadMCPConfigForRequestnow falls back to loading the localmcp_config.jsonwhen no platform context (org/team) is present in the request.Problem
In personal mode (running Astonish locally without any org/team context), MCP servers configured in the local
mcp_config.jsonwere silently unavailable. The function returned an empty config with no servers, making all MCP tools unusable through the Studio API.Fix
Instead of returning an empty config when there's no platform context, call
config.LoadMCPConfig()to load the user's local MCP server configuration. If that also fails (file missing, parse error), fall back to the empty config gracefully — same behaviour as before for users with no local config.Impact
Users running Astonish in personal/local mode will now have their locally-configured MCP servers available in Studio, just as they would expect from their
mcp_config.jsonsettings.