Skip to content

fix(api): load local MCP config in personal mode - #295

Open
dimtas wants to merge 1 commit into
SAP:mainfrom
dimtas:fix/mcp-config-personal-mode-fallback
Open

fix(api): load local MCP config in personal mode#295
dimtas wants to merge 1 commit into
SAP:mainfrom
dimtas:fix/mcp-config-personal-mode-fallback

Conversation

@dimtas

@dimtas dimtas commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

loadMCPConfigForRequest now falls back to loading the local mcp_config.json when 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.json were 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.json settings.

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.
@schardosin

Copy link
Copy Markdown
Contributor

Hi @dimtas,
thank you for digging into this.

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

@dimtas

dimtas commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

I'm currently running astonish agent locally and I had difficulties with loading a local stdio mcp-server.
Did I do something wrong?

@schardosin

Copy link
Copy Markdown
Contributor

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants