Skip to content

Fix: Allow Any type in logging methods per MCP spec (issue #397)#2240

Open
BlackBeardsoul wants to merge 1 commit intomodelcontextprotocol:mainfrom
BlackBeardsoul:main
Open

Fix: Allow Any type in logging methods per MCP spec (issue #397)#2240
BlackBeardsoul wants to merge 1 commit intomodelcontextprotocol:mainfrom
BlackBeardsoul:main

Conversation

@BlackBeardsoul
Copy link

@BlackBeardsoul BlackBeardsoul commented Mar 7, 2026

Closes #397

…xtprotocol#397)

- Changed message: str to data: Any in ctx.info(), ctx.debug(), ctx.warning(), ctx.error()
- Updated log() method to accept Any type for data parameter
- Now compliant with MCP spec which allows any JSON serializable type
- Updated example to demonstrate logging objects and arrays
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Context logging function types are not spec compliant

1 participant