Skip to content

chore: remove deprecated mcp-types crate#10357

Merged
bolinfest merged 1 commit intomainfrom
pr10357
Feb 3, 2026
Merged

chore: remove deprecated mcp-types crate#10357
bolinfest merged 1 commit intomainfrom
pr10357

Conversation

@bolinfest
Copy link
Collaborator

@bolinfest bolinfest commented Feb 2, 2026

@bolinfest bolinfest changed the base branch from pr10356 to pr10349 February 2, 2026 03:13
@bolinfest bolinfest force-pushed the pr10349 branch 2 times, most recently from 8ce41a4 to cffa4bc Compare February 2, 2026 05:07
@bolinfest bolinfest force-pushed the pr10357 branch 2 times, most recently from 2063d61 to 4f8662d Compare February 2, 2026 07:46
@bolinfest bolinfest force-pushed the pr10349 branch 2 times, most recently from 3276401 to c40cc5c Compare February 2, 2026 16:17
bolinfest added a commit that referenced this pull request Feb 2, 2026
Currently, types from our custom `mcp-types` crate are part of some of
our APIs:


https://github.com/openai/codex/blob/03fcd12e77fedf4fa327af27e2e476e1ebc5f651/codex-rs/app-server-protocol/src/protocol/v2.rs#L43-L46

To eliminate this crate in #10349 by switching to `rmcp`, we need our
own wrappers for the `rmcp` types that we can use in our API, which is
what this PR does.

Note this PR introduces the new API types, but we do not make use of
them until #10349.





---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/10356).
* #10357
* #10349
* __->__ #10356
@bolinfest bolinfest force-pushed the pr10349 branch 3 times, most recently from 82792e4 to 99abcc3 Compare February 2, 2026 19:10
@bolinfest bolinfest force-pushed the pr10357 branch 2 times, most recently from 9330afb to f882e38 Compare February 2, 2026 19:16
bolinfest added a commit that referenced this pull request Feb 3, 2026
We started working with MCP in Codex before
https://crates.io/crates/rmcp was mature, so we had our own crate for
MCP types that was generated from the MCP schema:


https://github.com/openai/codex/blob/8b95d3e082376f4cb23e92641705a22afb28a9da/codex-rs/mcp-types/README.md

Now that `rmcp` is more mature, it makes more sense to use their MCP
types in Rust, as they handle details (like the `_meta` field) that our
custom version ignored. Though one advantage that our custom types had
is that our generated types implemented `JsonSchema` and `ts_rs::TS`,
whereas the types in `rmcp` do not. As such, part of the work of this PR
is leveraging the adapters between `rmcp` types and the serializable
types that are API for us (app server and MCP) introduced in #10356.

Note this PR results in a number of changes to
`codex-rs/app-server-protocol/schema`, which merit special attention
during review. We must ensure that these changes are still
backwards-compatible, which is possible because we have:

```diff
- export type CallToolResult = { content: Array<ContentBlock>, isError?: boolean, structuredContent?: JsonValue, };
+ export type CallToolResult = { content: Array<JsonValue>, structuredContent?: JsonValue, isError?: boolean, _meta?: JsonValue, };
```

so `ContentBlock` has been replaced with the more general `JsonValue`.
Note that `ContentBlock` was defined as:

```typescript
export type ContentBlock = TextContent | ImageContent | AudioContent | ResourceLink | EmbeddedResource;
```

so the deletion of those individual variants should not be a cause of
great concern.

Similarly, we have the following change in
`codex-rs/app-server-protocol/schema/typescript/Tool.ts`:

```
- export type Tool = { annotations?: ToolAnnotations, description?: string, inputSchema: ToolInputSchema, name: string, outputSchema?: ToolOutputSchema, title?: string, };
+ export type Tool = { name: string, title?: string, description?: string, inputSchema: JsonValue, outputSchema?: JsonValue, annotations?: JsonValue, icons?: Array<JsonValue>, _meta?: JsonValue, };
```

so:

- `annotations?: ToolAnnotations` ➡️ `JsonValue`
- `inputSchema: ToolInputSchema` ➡️ `JsonValue`
- `outputSchema?: ToolOutputSchema` ➡️ `JsonValue`

and two new fields: `icons?: Array<JsonValue>, _meta?: JsonValue`

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/10349).
* #10357
* __->__ #10349
* #10356
Base automatically changed from pr10349 to main February 3, 2026 01:41
@bolinfest bolinfest enabled auto-merge (squash) February 3, 2026 01:43
@bolinfest bolinfest merged commit 891ed87 into main Feb 3, 2026
83 of 85 checks passed
@bolinfest bolinfest deleted the pr10357 branch February 3, 2026 02:33
@github-actions github-actions bot locked and limited conversation to collaborators Feb 3, 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.

2 participants