diff --git a/codex-rs/mcp-types/generate_mcp_types.py b/codex-rs/mcp-types/generate_mcp_types.py index 6066423f55..c597836be6 100755 --- a/codex-rs/mcp-types/generate_mcp_types.py +++ b/codex-rs/mcp-types/generate_mcp_types.py @@ -50,7 +50,7 @@ def main() -> int: DEFINITIONS = schema_json["definitions"] out = [ - """ + f""" // @generated // DO NOT EDIT THIS FILE DIRECTLY. // Run the following in the crate root to regenerate this file: @@ -67,17 +67,19 @@ pub const MCP_SCHEMA_VERSION: &str = "{SCHEMA_VERSION}"; pub const JSONRPC_VERSION: &str = "{JSONRPC_VERSION}"; /// Paired request/response types for the Model Context Protocol (MCP). -pub trait ModelContextProtocolRequest { +pub trait ModelContextProtocolRequest {{ const METHOD: &'static str; type Params: DeserializeOwned + Serialize + Send + Sync + 'static; type Result: DeserializeOwned + Serialize + Send + Sync + 'static; -} +}} /// One-way message in the Model Context Protocol (MCP). -pub trait ModelContextProtocolNotification { +pub trait ModelContextProtocolNotification {{ const METHOD: &'static str; type Params: DeserializeOwned + Serialize + Send + Sync + 'static; -} +}} + +fn default_jsonrpc() -> String {{ JSONRPC_VERSION.to_owned() }} fn default_jsonrpc() -> String {{ JSONRPC_VERSION.to_owned() }}