Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 30 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,23 @@
This repository is the **MainSequence Codex plugin**. Its production code lives in
`src/`, its Codex manifest in `manifests/codex/`, and its installable bundle in `codex/`.

The **0.4.2 development build** provides a native Agents/Tools panel with account and
environment status, agent search, project MCP discovery, saved-connection status and read-only schema inspection.
Ask Codex to **open MainSequence**. The plugin uses the existing devtools **0.3.2** session
and APIs; devtools remains the head. See [panel behavior and validation](docs/agents-tools-panel.md).
The **0.7.1 development build** follows Claude's MainSequence panel layout using
Codex theme tokens: Home, Code, Projects, Agents, Tools, Activity and Settings.
It includes repository setup and maintenance, project setup and links, deployment
history/stages/logs, shared account/settings controls, direct messages and agent tasks.
Replies and task results use native MCP tools and remain in Codex conversation context.

Ask Codex to **open MainSequence**. Shared devtools **0.3.5** owns authentication,
account binding, domain APIs, local project operations, authenticated assets and durable
delivery. Claude's repository and dependency remain unchanged. See the
[capability matrix and verification](docs/agents-tools-panel.md), including the stock
Codex host differences. No probe or custom Codex build is shipped.

Choose **Talk**, select **Message** or **Task** when the agent supports both, write a
message, then **Send in Codex**. The reply returns through a native
MCP tool and stays in chat context. After Stop, use **Messages and recovery → Recover in
Codex** on the original request. Recovery reuses saved work; an unknown remote outcome
blocks resend. Browsing or selecting an example never sends a message automatically.

The plugin also registers the `ms` slash-menu entry for explicit developer commands and
the `mainsequence-mcp` skill for conversational project MCP access. The independent
Expand Down Expand Up @@ -89,6 +102,19 @@ metatable-mcp", "Use it to list my tables." See
[conversational project MCP connections](docs/conversational-mcp.md) and
[ADR 0002](docs/adr/0002-conversational-project-mcp-client.md).

Every saved project MCP's tools are also registered directly, as the Claude Desktop
plugin registers them: `ms_<tool>_<hash>` (for example `ms_crm_contacts_list_…`), each
with the project's own schema and bound to one saved connection and environment. Codex
calls them like any other tool, with no `contextId` or environment selection. The list
comes from devtools' shared project-tool catalog (`project-tool-catalog.json` beside the
shared CLI state, the same names, schemas and results as the Claude Desktop plugin; devtools
ADR 0004) and is refreshed in the background; a connection saved in the current chat appears
in the next chat, and is usable at once through `mainsequence_tools` /
`mainsequence_call_tool`. A cold project MCP can take over a minute to answer: devtools gives
project requests 120 s and honours a tool's advertised timeout up to 300 s, and the plugin's
server allows Codex tool calls 300 seconds (`tool_timeout_sec` in `.mcp.json`) instead of
the host default of 60.

## Architecture and development

Shared functionality comes from the exact `@dev-mainsequence/devtools` package API. The
Expand Down
465 changes: 453 additions & 12 deletions docs/agents-tools-panel.md

Large diffs are not rendered by default.

568 changes: 568 additions & 0 deletions docs/codex-desktop-parity-plan.md

Large diffs are not rendered by default.

280 changes: 280 additions & 0 deletions docs/codex-host-probe-results.md

Large diffs are not rendered by default.

17 changes: 15 additions & 2 deletions docs/conversational-mcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@ Codex discovers the directory, saves your selection, reads that project's curren

Connections are owned by the plugin. They do not create separate entries in Codex's native MCP list. Installing or updating the plugin itself still follows the host's plugin lifecycle.

Since plugin 0.7.8 every saved connection's tools are also registered directly as `ms_<tool>_<hash>` tools with the project's own schemas, the way the Claude Desktop plugin registers them, so "list my contacts" is one tool call with no contextId or environment argument. Since 0.7.9 the registration comes from devtools' shared project-tool catalog (`project-tool-catalog.json` beside `mcp-connections.json`, shared with the Claude Desktop plugin) that is refreshed in the background; a connection saved in the current chat is registered from the next chat on, and is usable at once through `mainsequence_tools` / `mainsequence_call_tool`. The plugin's server also allows Codex tool calls 300 seconds, because a cold project MCP has taken more than the host's 60-second default to answer.

## Runner and library

The conversational skill calls the same runner/API available to other local hosts:
The conversational skill prefers native `mainsequence_*` tools, which share a
persistent devtools connection cache. It opens account context once, reads saved
connections, inspects schemas, then calls the selected tool. The bundled runner is
a fallback when native tools are unavailable:

| Command | Result |
| --- | --- |
Expand All @@ -33,7 +38,7 @@ The plugin uses the existing developer machine session for central discovery and

If no developer session exists, use the existing Main Sequence hosted login. A central Codex OAuth connection does not automatically provide that session. Browser sign-in may be necessary once; adding subsequent project connections reuses the developer session.

Connection metadata lives in mcp-connections.json beside the existing MainSequence CLI configuration, separated by backend and release UID. Reads/calls recheck release access and fetch the current tool catalog. A changed endpoint requires an explicit add again. Removing a connection does not revoke your login.
Connection metadata lives in mcp-connections.json beside the existing MainSequence CLI configuration, separated by backend and release UID. Since plugin 0.7.3 / devtools 0.3.7, the native process reuses verified release metadata, a release grant and schemas for at most 60 seconds, bounded by credential expiry. A prepared call sends only the business `tools/call` request. Explicit schema reads still fetch the current catalog. Shared login and saved connection changes, expiry and transport failures invalidate the cache; each call keeps its own cancellation signal. Credentials and results are never persisted in this cache. A changed endpoint requires an explicit add again. Removing a connection does not revoke your login. Separate runner processes perform fresh setup.

The release UID identifies a connection. Since devtools 0.3.1, mcp-add also reads the release's name, its repository's name and its repository branch from the release directory and stores them with the connection as `name`, `display_name` and `code_repository_branch_uid`, so mcp-list labels a saved connection without a backend request; a connection saved by an earlier version is completed by the first listing that can read those labels, and a label that cannot be read is left out rather than making the MCP unavailable. Adding a connection and reading or calling its tools work without the labels, and UID-based operations do not repeat discovery to obtain a name. Discovery rows carry `name` and `code_repository_branch_uid` as the platform directory reports them.

Expand All @@ -45,6 +50,14 @@ Access denial, an unavailable release, or a corrupt connection file is reported

A tool call is never retried automatically. A timeout, interrupted stream or cancellation may follow a completed remote operation. If the result reports partial-or-uncertain effects, check the operation's outcome before repeating it. Tool errors retain their server result for diagnosis, with known authentication credentials redacted.

Since plugin 0.7.2 / devtools 0.3.6, a remote tool failure is labelled
`MCP_TOOL_ERROR`, distinct from an HTTP/protocol `API_ERROR`. The native tool result
and panel preserve the original `content`, `structuredContent` and uncertain-effects
warning. A CRM `not_found` or `forbidden` response is therefore visible instead of
being discarded. Cold setup verifies the shared account remotely. Prepared calls
check the selected credentials locally before and after execution; server-side
authorization still applies to every call.

## Validation and release boundary

The protocol, credential-isolation, saved-connection and packaged-client fixtures run in the devtools test suite, where the client lives; this repository's tests cover the skill, the hook and the packaged plugin. None of them access the user's credential store or invoke real project tools. The built plugin and npm archive include the conversational skill and the vendored client without runtime npm dependencies.
Expand Down
28 changes: 28 additions & 0 deletions docs/local-development-backend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Local development backend

For the shared Mac/workstation Django proxy, save these existing workspace
preferences through `mainsequence_settings`:

```json
{
"action": "save",
"backend": "http://local-backend:8000",
"baseDir": "/Users/jose/mainsequence-dev",
"commandCenterUrl": ""
}
```

Settings saves replace the full preference object, so retain the current
repositories folder and optional Command Center URL. This workstation setup
uses the values above. No plugin rebuild or new hardcoded backend is required.

Map `local-backend` to the machine serving the development Django stack with
that stack's `maintenance/switch_local_backend.py` after a stack switch. Refresh
the plugin context afterwards. The installed plugin reads these shared devtools
preferences; source and published packages keep their normal backend-selection
behavior. Historical verification notes retain the addresses actually tested.

Login and saved connections are backend scoped. Use the existing settings login
flow if this hostname has no saved session, and rediscover/reconnect project MCPs
against the selected backend as needed. Never copy tokens or modify credential
storage to migrate a hostname.
1 change: 1 addition & 0 deletions experiments/codex-host-probe/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.local-marketplace/
Loading
Loading