Skip to content

bug(ux): MCP, tool discovery and ast_edit are hard-disabled in the app with no surfacing #161

Closed

Description

@devswha

The app hard-disables MCP discovery, project .mcp.json, tool discovery and ast_edit for every session, and tells the user nothing. A user whose MCP servers work in the GJC CLI finds them silently absent in the app.

Evidence

server/gjc-bun-sdk-adapter.ts:254-273, applied to every app session:

export function applyGjcToolSettingsPolicy(settings: Settings): void {
  settings.override('goal.enabled', false);
  settings.override('astEdit.enabled', false);
  settings.override('tools.discoveryMode', 'off');
  settings.override('mcp.discoveryMode', false);
  settings.override('mcp.enableProjectConfig', false);
}

The overrides are correct as a security boundary and the inline comments justify them well. The problem is purely that nothing surfaces them.

On this machine the user has two MCP servers configured for the CLI. The CLI loads them (and logs the failures); the app never attempts them at all:

~/.gjc/logs/gjc.2026-09-17.log   (CLI process)
  14× GJC plugin MCP connect failed  path=mcp:stylegallery
      GJC plugin MCP connect failed  path=mcp:stylegallery-material

Nothing equivalent in the app session. The tools simply are not there.

UI search for any surfacing of this:

$ grep -rnE 'discoveryMode|mcp\.|MCP' src/components/ src/i18n/locales/en/
src/components/sidebar/view/SidebarModals.tsx:53:
  // Settings expects project identity/path fields to be present for dropdown labels
  // and local-scope MCP config.

One comment. No badge, no notice, no disabled-state copy, no i18n string.

Observable consequences

astEdit.enabled: false means app sessions fall back to plain text replacement for structural edits. In the 681-turn session measured:

26  Edit rejected: N anchors do not match the current file (marked *). The edit was NOT applied.

And the goal.enabled: false default means goal is absent unless separately re-admitted, which also is not indicated anywhere in the UI.

Why this is a problem

"Works in the CLI, missing in the app, no error message" is an unanswerable support question. The boundary is a deliberate product decision; users are entitled to know it exists.

Expected

Keep the overrides. Add surfacing:

  • Settings shows MCP/tool-discovery as explicitly unavailable in the app, with the reason, instead of implying configurability.
  • A session that would have loaded user MCP servers reports that they were withheld.
  • Document the app-vs-CLI capability delta in docs/ so the difference is discoverable without reading the adapter.

Activity

  1. added
    bug
    on Sep 16, 2026
  2. devswha commented on Sep 17, 2026

    @devswha
    OwnerAuthor

    Checked how the bundled runtime itself handles these before deciding (SDK source in @gajae-code/coding-agent):

    • mcp.enableProjectConfig defaults to false in GJC too (config/settings-schema.ts). The CLI does not load a project's .mcp.json unless the user sets that key; user-level servers (~/.gjc scope) load by default. There is no per-project trust prompt in the runtime — it is a global settings switch, and loadAllMCPConfigs simply filters _source.level === "project" out when the key is false (runtime-mcp/config.ts:130,157).
    • mcp.discoveryMode defaults to false. tools.discoveryMode defaults to "all" (non-essential built-ins hidden behind search_tool_bm25 to save tokens); the app pins "off", which lists every built-in up front and removes the discovery door entirely.
    • So the app's policy is stricter than the CLI's default in exactly two places: it also refuses user-level MCP servers, and it disables built-in tool discovery. Project .mcp.json is off in both.

    Owner is reviewing this before deciding; no change yet.

  3. devswha commented on Sep 17, 2026

    @devswha
    OwnerAuthor

    Correction to my previous comment, after testing against the real SDK rather than reading the schema: the app does not refuse user-level MCP servers. It never did.

    server/gjc-mcp-autoload.bun.test.ts (PR #170) registers a real stdio MCP server in both scopes and opens a session the way the app does — explicit toolNames, applyGjcToolSettingsPolicy applied:

    scope file app session CLI session
    user (gjc mcp add) ~/.gjc/agent/mcp.json loads, tool is active and executable loads
    project <repo>/.gjc/mcp.json refused loads (runtime reads an unset mcp.enableProjectConfig as true)

    The runtime's conventional autoload connects user-scope servers before the session exists and surfaces their tools as always-on, independent of toolNames and of discovery mode. Only delegated children opt out (enableMcpAutoload: false). So the schema default I quoted (false) is not what the session code does with an unset value, and the Settings row from #165 — "Servers from your GJC settings and a project .mcp.json are not loaded" — was wrong about the first half and named the wrong file for the second (.mcp.json is a Claude Code import source; the runtime file is .gjc/mcp.json).

    Owner decision (2026-09-18): keep exactly this split — option B. User scope loads as in the CLI, project scope never does, discovery stays off. #170 pins both halves, corrects the Settings wording in all ten locales, and adds an MCP servers section to GJC-LIVE-SPEC.md. Nothing about the behaviour changes.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions