Skip to content

mcp/time container crashes due to Pydantic validation error #1290

@brdmllr

Description

@brdmllr

Which version of LM Studio?
LM Studio 0.3.33

Which operating system?
macOS 15.5

What is the bug?
mcp/time container crashes due to Pydantic validation error

Logs
{"jsonrpc":"2.0","id":0,"result":{"protocolVersion":"2024-11-05","capabilities":{"experimental":{},"tools":{"listChanged":false}},"serverInfo":{"name":"mcp-time","version":"1.0.0"}}}
{"jsonrpc":"2.0","id":1,"result":{"tools":[{"name":"get_current_time","description":"Get current time in a specific timezones","inputSchema":{"type":"object","properties":{"timezone":{"type":"string","description":"IANA timezone name (e.g., 'America/New_York', 'Europe/London'). Use 'UTC' as local timezone if no timezone provided by the user."}},"required":["timezone"]}},{"name":"convert_time","description":"Convert time between timezones","inputSchema":{"type":"object","properties":{"source_timezone":{"type":"string","description":"Source IANA timezone name (e.g., 'America/New_York', 'Europe/London'). Use 'UTC' as local timezone if no source timezone provided by the user."},"time":{"type":"string","description":"Time to convert in 24-hour format (HH:MM)"},"target_timezone":{"type":"string","description":"Target IANA timezone name (e.g., 'Asia/Tokyo', 'America/San_Francisco'). Use 'UTC' as local timezone if no target timezone provided by the user."}},"required":["source_timezone","time","target_timezone"]}}]}}

  • Exception Group Traceback (most recent call last):
    | File "/app/.venv/lib/python3.10/site-packages/mcp/server/stdio.py", line 83, in stdio_server
    | yield read_stream, write_stream
    | File "/app/.venv/lib/python3.10/site-packages/mcp_server_time/server.py", line 201, in serve
    | await server.run(read_stream, write_stream, options)
    | File "/app/.venv/lib/python3.10/site-packages/mcp/server/init.py", line 404, in run
    | async with ServerSession(
    | File "/app/.venv/lib/python3.10/site-packages/mcp/shared/session.py", line 122, in aexit
    | return await self._task_group.aexit(exc_type, exc_val, exc_tb)
    | File "/app/.venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 763, in aexit
    | raise BaseExceptionGroup(
    | exceptiongroup.ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
    +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    | File "/app/.venv/lib/python3.10/site-packages/mcp/shared/session.py", line 235, in _receive_loop
    | notification = self._receive_notification_type.model_validate(
    | File "/app/.venv/lib/python3.10/site-packages/pydantic/main.py", line 627, in model_validate
    | return cls.pydantic_validator.validate_python(
    | pydantic_core._pydantic_core.ValidationError: 5 validation errors for ClientNotification
    | ProgressNotification.method
    | Input should be 'notifications/progress' [type=literal_error, input_value='notifications/cancelled', input_type=str]
    | For further information visit https://errors.pydantic.dev/2.10/v/literal_error
    | ProgressNotification.params.progressToken
    | Field required [type=missing, input_value={'requestId': 1, 'reason'... operation was aborted'}, input_type=dict]
    | For further information visit https://errors.pydantic.dev/2.10/v/missing
    | ProgressNotification.params.progress
    | Field required [type=missing, input_value={'requestId': 1, 'reason'... operation was aborted'}, input_type=dict]
    | For further information visit https://errors.pydantic.dev/2.10/v/missing
    | InitializedNotification.method
    | Input should be 'notifications/initialized' [type=literal_error, input_value='notifications/cancelled', input_type=str]
    | For further information visit https://errors.pydantic.dev/2.10/v/literal_error
    | RootsListChangedNotification.method
    | Input should be 'notifications/roots/list_changed' [type=literal_error, input_value='notifications/cancelled', input_type=str]
    | For further information visit https://errors.pydantic.dev/2.10/v/literal_error
    +------------------------------------

During handling of the above exception, another exception occurred:

  • Exception Group Traceback (most recent call last):
    | File "/app/.venv/bin/mcp-server-time", line 10, in
    | sys.exit(main())
    | File "/app/.venv/lib/python3.10/site-packages/mcp_server_time/init.py", line 15, in main
    | asyncio.run(serve(args.local_timezone))
    | File "/root/.local/share/uv/python/cpython-3.10.18-linux-aarch64-gnu/lib/python3.10/asyncio/runners.py", line 44, in run
    | return loop.run_until_complete(main)
    | File "/root/.local/share/uv/python/cpython-3.10.18-linux-aarch64-gnu/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    | return future.result()
    | File "/app/.venv/lib/python3.10/site-packages/mcp_server_time/server.py", line 200, in serve
    | async with stdio_server() as (read_stream, write_stream):
    | File "/root/.local/share/uv/python/cpython-3.10.18-linux-aarch64-gnu/lib/python3.10/contextlib.py", line 217, in aexit
    | await self.gen.athrow(typ, value, traceback)
    | File "/app/.venv/lib/python3.10/site-packages/mcp/server/stdio.py", line 80, in stdio_server
    | async with anyio.create_task_group() as tg:
    | File "/app/.venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 763, in aexit
    | raise BaseExceptionGroup(
    | exceptiongroup.ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
    +-+---------------- 1 ----------------
    | Exception Group Traceback (most recent call last):
    | File "/app/.venv/lib/python3.10/site-packages/mcp/server/stdio.py", line 83, in stdio_server
    | yield read_stream, write_stream
    | File "/app/.venv/lib/python3.10/site-packages/mcp_server_time/server.py", line 201, in serve
    | await server.run(read_stream, write_stream, options)
    | File "/app/.venv/lib/python3.10/site-packages/mcp/server/init.py", line 404, in run
    | async with ServerSession(
    | File "/app/.venv/lib/python3.10/site-packages/mcp/shared/session.py", line 122, in aexit
    | return await self._task_group.aexit(exc_type, exc_val, exc_tb)
    | File "/app/.venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 763, in aexit
    | raise BaseExceptionGroup(
    | exceptiongroup.ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
    +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    | File "/app/.venv/lib/python3.10/site-packages/mcp/shared/session.py", line 235, in _receive_loop
    | notification = self._receive_notification_type.model_validate(
    | File "/app/.venv/lib/python3.10/site-packages/pydantic/main.py", line 627, in model_validate
    | return cls.pydantic_validator.validate_python(
    | pydantic_core._pydantic_core.ValidationError: 5 validation errors for ClientNotification
    | ProgressNotification.method
    | Input should be 'notifications/progress' [type=literal_error, input_value='notifications/cancelled', input_type=str]
    | For further information visit https://errors.pydantic.dev/2.10/v/literal_error
    | ProgressNotification.params.progressToken
    | Field required [type=missing, input_value={'requestId': 1, 'reason'... operation was aborted'}, input_type=dict]
    | For further information visit https://errors.pydantic.dev/2.10/v/missing
    | ProgressNotification.params.progress
    | Field required [type=missing, input_value={'requestId': 1, 'reason'... operation was aborted'}, input_type=dict]
    | For further information visit https://errors.pydantic.dev/2.10/v/missing
    | InitializedNotification.method
    | Input should be 'notifications/initialized' [type=literal_error, input_value='notifications/cancelled', input_type=str]
    | For further information visit https://errors.pydantic.dev/2.10/v/literal_error
    | RootsListChangedNotification.method
    | Input should be 'notifications/roots/list_changed' [type=literal_error, input_value='notifications/cancelled', input_type=str]
    | For further information visit https://errors.pydantic.dev/2.10/v/literal_error
    +------------------------------------

To Reproduce

  1. Set up mcp/time as follows -

{
"mcpServers": {
"time": {
"command": "docker",
"args": [
"run",
"-i",
"-e",
"LOCAL_TIMEZONE=America/New_York",
"mcp/time"
]
}
}
}

  1. The container will eventually crash and LM Studio will report a -32000 error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions