Skip to content

When using "codex mcp" as an mcp server, the "method" attribute of the notification does not comply with the mcp specification #4223

Closed

Description

@dayeguilaiye

What version of Codex is running?

0.40.0

Which model were you using?

qwen3-next

What platform is your computer?

macos

What steps can reproduce the bug?

When using uv run codex mcp as an mcp server to integrate with the agent in agno, the functionality works normally, but the logs keep reporting errors saying "WARNING:root:Failed to validate notification: 13 validation errors for ServerNotification". I found that this error comes from the mcp Python SDK, where the notification's method field should only have a few fixed types and should not include codex/event.

What is the expected behavior?

mcp works without error or warning

What do you see instead?

Got logs like below:

WARNING:root:Failed to validate notification: 13 validation errors for ServerNotification
CancelledNotification.method
  Input should be 'notifications/cancelled' [type=literal_error, input_value='codex/event', input_type=str]
    For further information visit https://errors.pydantic.dev/2.11/v/literal_error
CancelledNotification.params.requestId
  Field required [type=missing, input_value={'_meta': {'requestId': 2...f4-5ded18f9fa15.jsonl'}}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.11/v/missing
ProgressNotification.method
  Input should be 'notifications/progress' [type=literal_error, input_value='codex/event', input_type=str]
    For further information visit https://errors.pydantic.dev/2.11/v/literal_error
ProgressNotification.params.progressToken
  Field required [type=missing, input_value={'_meta': {'requestId': 2...f4-5ded18f9fa15.jsonl'}}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.11/v/missing
ProgressNotification.params.progress
  Field required [type=missing, input_value={'_meta': {'requestId': 2...f4-5ded18f9fa15.jsonl'}}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.11/v/missing
LoggingMessageNotification.method
  Input should be 'notifications/message' [type=literal_error, input_value='codex/event', input_type=str]
    For further information visit https://errors.pydantic.dev/2.11/v/literal_error
LoggingMessageNotification.params.level
  Field required [type=missing, input_value={'_meta': {'requestId': 2...f4-5ded18f9fa15.jsonl'}}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.11/v/missing
LoggingMessageNotification.params.data
  Field required [type=missing, input_value={'_meta': {'requestId': 2...f4-5ded18f9fa15.jsonl'}}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.11/v/missing
ResourceUpdatedNotification.method
  Input should be 'notifications/resources/updated' [type=literal_error, input_value='codex/event', input_type=str]
    For further information visit https://errors.pydantic.dev/2.11/v/literal_error
ResourceUpdatedNotification.params.uri
  Field required [type=missing, input_value={'_meta': {'requestId': 2...f4-5ded18f9fa15.jsonl'}}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.11/v/missing
ResourceListChangedNotification.method
  Input should be 'notifications/resources/list_changed' [type=literal_error, input_value='codex/event', input_type=str]
    For further information visit https://errors.pydantic.dev/2.11/v/literal_error
ToolListChangedNotification.method
  Input should be 'notifications/tools/list_changed' [type=literal_error, input_value='codex/event', input_type=str]
    For further information visit https://errors.pydantic.dev/2.11/v/literal_error
PromptListChangedNotification.method
  Input should be 'notifications/prompts/list_changed' [type=literal_error, input_value='codex/event', input_type=str]
    For further information visit https://errors.pydantic.dev/2.11/v/literal_error. Message was: method='codex/event' params={'_meta': {'requestId': 2}, 'id': '', 'msg': {'type': 'session_configured', 'session_id': '01997eb4-74f6-7762-b0f4-5ded18f9fa15', 'model': 'Qwen/Qwen3-Coder-30B-A3B-Instruct-FP8', 'history_log_id': 75073889, 'history_entry_count': 10, 'rollout_path': '/Users/xxxx/.codex/sessions/2025/09/25/rollout-2025-09-25T10-29-39-01997eb4-74f6-7762-b0f4-5ded18f9fa15.jsonl'}} jsonrpc='2.0'

Additional information

In the mcp documentation https://modelcontextprotocol.io/specification/2025-06-18/schema#notifications%2Fmessage, it seems there are indeed only a few fixed types of notifications

Activity

  1. added
    bug
    on Sep 25, 2025
  2. added
    mcp
    on Sep 26, 2025
  3. added
    mcp-server
    and removed
    mcp
    on Nov 11, 2025
  4. etraut-openai commented on Jan 17, 2026

    @etraut-openai
    Contributor

    Closing out old bugs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmcp-server

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions