Skip to content

[connectors] Support connectors part 1 - App server & MCP#9667

Merged
mzeng-openai merged 12 commits intomainfrom
dev/mzeng/connectors_codex_cli_3
Jan 23, 2026
Merged

[connectors] Support connectors part 1 - App server & MCP#9667
mzeng-openai merged 12 commits intomainfrom
dev/mzeng/connectors_codex_cli_3

Conversation

@mzeng-openai
Copy link
Contributor

@mzeng-openai mzeng-openai commented Jan 22, 2026

In order to make Codex work with connectors, we add a built-in gateway MCP that acts as a transparent proxy between the client and the connectors. The gateway MCP collects actions that are accessible to the user and sends them down to the user, when a connector action is chosen to be called, the client invokes the action through the gateway MCP as well.

  • Add the system built-in gateway MCP to list and run connectors.
  • Add the app server methods and protocol

connectors: Vec<ConnectorInfo>,
}

pub async fn list_connectors(config: &Config) -> anyhow::Result<Vec<ConnectorInfo>> {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two types of connectors:

  1. Connectors that are already connected by the user, and we have a link that we can use to authenticate it
  2. Connectors that have not been installed by the user. We need the user to install it on ChatGPT UI.
    In the UI we mix them together and use is_accessible to distinguish them. This methods does the merge.

Ok(merge_connectors(connectors, accessible))
}

pub async fn list_all_connectors(config: &Config) -> anyhow::Result<Vec<ConnectorInfo>> {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

List all available connectors regardless of whether they are installed or not.

servers
}

pub(crate) fn effective_mcp_servers(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add codex apps MCP as an always on built-in MCP.


connectors
.into_iter()
.filter(|connector| connector_inserted_in_messages(connector, &user_messages))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Include connectors mentioned in the user messages as tools.

})
}

fn filter_codex_apps_mcp_tools(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Find the mcp tools that are associated with connectors.

pub is_accessible: bool,
}

pub async fn list_accessible_connectors_from_mcp_tools(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We collect the actually accessible mcp tools from the gateway MCP tool list.

@mzeng-openai mzeng-openai marked this pull request as ready for review January 22, 2026 18:42
Copy link
Collaborator

@owenlin0 owenlin0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bunch of API nits

@mzeng-openai mzeng-openai requested a review from owenlin0 January 22, 2026 19:57
params: v2::SkillsListParams,
response: v2::SkillsListResponse,
},
AppsList => "app/list" {
Copy link
Collaborator

@apanasenko-oai apanasenko-oai Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: apps/list similar to skills/list

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ironically @owenlin0 just said the other way, because all the other protocols are singular.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it reads very strangely: App*s*List => "app/list"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it does read strangely, but only for /list methods

thread/list
thread/start
thread/archive
... etc.

Copy link
Collaborator

@owenlin0 owenlin0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we also add some integration tests at codex-rs/app-server/tests/suite/v2/app_list.rs? can probably ask codex to generate some

params: v2::SkillsListParams,
response: v2::SkillsListResponse,
},
AppsList => "app/list" {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: AppsList -> AppList

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
pub struct AppInfo {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: should we just call this App? AppInfo sounds redundant (like ThreadInfo for a thread/list API)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm mostly trying to avoid confusing this with the actual codex app itself.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's ok, you get to own the word "app" in the app-server API

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
pub struct AppsListResponse {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AppListResponse

@mzeng-openai mzeng-openai merged commit a2c829a into main Jan 23, 2026
64 checks passed
@mzeng-openai mzeng-openai deleted the dev/mzeng/connectors_codex_cli_3 branch January 23, 2026 00:48
@github-actions github-actions bot locked and limited conversation to collaborators Jan 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants