Skip to content

Commit d777d6d

Browse files
committed
fix linter
1 parent 4098004 commit d777d6d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/integ/mcp/simple_mcp_server/mcp_server.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,10 @@ async def elicit_for_my_name(elicitation_expected: str, ctx: Context):
7979
@mcp.tool
8080
def echo_metadata(ctx: Context):
8181
"""MCP Tool that echoes back the _meta field from the request."""
82-
meta = ctx.request_context.meta
83-
return {'received_meta': meta}
82+
if ctx.request_context:
83+
meta = ctx.request_context.meta
84+
return {'received_meta': meta}
85+
raise RuntimeError('No request context received')
8486

8587

8688
#### Server Setup

0 commit comments

Comments
 (0)