From 6203384c63d8e99bf19a6ffed37ce1b225084463 Mon Sep 17 00:00:00 2001 From: Jose Antonio Alatorre Date: Mon, 23 Nov 2026 12:01:52 +0100 Subject: [PATCH] Linux: pass the desktop session bus to the MCP server (0.7.19) Codex starts a plugin's MCP server with HOME, USER and PATH only. On Linux the shared sign-in is read with secret-tool, which reaches the Secret Service over the desktop's session bus, so every read failed with STORE_ERROR ("The machine session could not be read") and Codex showed "Couldn't display MainSequence". .mcp.json now passes DBUS_SESSION_BUS_ADDRESS and XDG_RUNTIME_DIR on to the server. Co-Authored-By: Claude Opus 5.5 --- docs/agents-tools-panel.md | 6 ++++++ manifests/codex/.codex-plugin/plugin.json | 2 +- manifests/codex/.mcp.json | 4 +++- package-lock.json | 4 ++-- package.json | 2 +- tests/panel-server.test.cjs | 2 ++ 6 files changed, 15 insertions(+), 5 deletions(-) diff --git a/docs/agents-tools-panel.md b/docs/agents-tools-panel.md index 85b132b..fe45f72 100644 --- a/docs/agents-tools-panel.md +++ b/docs/agents-tools-panel.md @@ -51,6 +51,12 @@ first release once wrote one after a 773 s refresh and reported nothing). `MAINSEQUENCE_CODEX_TOOL_CATALOG=off` stops a server from reading or writing the catalog on its own (the packaged test uses it); cached tools are still listed. +Codex starts a plugin's MCP server with `HOME`, `USER` and `PATH` only. On Linux the shared +sign-in is read with `secret-tool`, which reaches the Secret Service over the desktop's session +bus, so `.mcp.json` passes `DBUS_SESSION_BUS_ADDRESS` and `XDG_RUNTIME_DIR` on to the server. +Without them every read fails with `STORE_ERROR` ("The machine session could not be read") +and Codex shows "Couldn't display MainSequence". + Project MCP requests are slow when the project has scaled to zero: a first call to the Production CRM measured 53–71 s, a warm one 7–10 s. `.mcp.json` therefore sets `tool_timeout_sec: 300` (Codex's default is 60 s) and the server's own per-request limit is diff --git a/manifests/codex/.codex-plugin/plugin.json b/manifests/codex/.codex-plugin/plugin.json index c4e03c3..d281f9a 100644 --- a/manifests/codex/.codex-plugin/plugin.json +++ b/manifests/codex/.codex-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "mainsequence", - "version": "0.7.18", + "version": "0.7.19", "description": "Message MainSequence agents in Codex chat, recover saved replies, discover project MCPs and run developer commands using your shared session.", "author": { "name": "MainSequence" diff --git a/manifests/codex/.mcp.json b/manifests/codex/.mcp.json index 0d3205c..f055613 100644 --- a/manifests/codex/.mcp.json +++ b/manifests/codex/.mcp.json @@ -9,7 +9,9 @@ "env_vars": [ "MAINSEQUENCE_ENDPOINT", "MAINSEQUENCE_ACCESS_TOKEN", - "MAINSEQUENCE_REFRESH_TOKEN" + "MAINSEQUENCE_REFRESH_TOKEN", + "DBUS_SESSION_BUS_ADDRESS", + "XDG_RUNTIME_DIR" ], "tool_timeout_sec": 300 } diff --git a/package-lock.json b/package-lock.json index de1516c..4a2d70c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@dev-mainsequence/codex-plugin", - "version": "0.7.18", + "version": "0.7.19", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@dev-mainsequence/codex-plugin", - "version": "0.7.18", + "version": "0.7.19", "license": "MIT", "dependencies": { "@dev-mainsequence/devtools": "0.3.22" diff --git a/package.json b/package.json index 34dcbf8..b310b06 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@dev-mainsequence/codex-plugin", - "version": "0.7.18", + "version": "0.7.19", "description": "MainSequence for Codex: durable agent messaging in native chat, Agents and Tools discovery, developer commands and conversational MCPs", "license": "MIT", "engines": { diff --git a/tests/panel-server.test.cjs b/tests/panel-server.test.cjs index 07ad5a6..a8544b2 100644 --- a/tests/panel-server.test.cjs +++ b/tests/panel-server.test.cjs @@ -14,6 +14,8 @@ test('detached packaged MCP server: tools, immutable UI, validation, no startup const mcp = JSON.parse(fs.readFileSync(path.join(installed, '.mcp.json'))).mcpServers.mainsequence; assert.deepEqual(mcp.args, ['./dist/panel-server.js']); assert.ok(mcp.tool_timeout_sec >= 120, 'cold project MCP calls exceed the host default of 60 s'); + // Codex starts the server with HOME, USER and PATH only; on Linux secret-tool needs the desktop's session bus to read the shared sign-in. + for (const name of ['DBUS_SESSION_BUS_ADDRESS', 'XDG_RUNTIME_DIR']) assert.ok(mcp.env_vars.includes(name), `${name} must reach the server`); // A catalog written by an earlier chat's server, beside the shared CLI state of this HOME. const { projectToolName: toolName } = require('@dev-mainsequence/devtools'); const stateDir = process.platform === 'darwin' ? path.join(temporary, 'Library', 'Application Support', 'MainSequenceCLI') : process.platform === 'win32' ? path.join(temporary, 'MainSequenceCLI') : path.join(temporary, '.config', 'mainsequence');