Skip to content

Commit 7f82f80

Browse files
committed
fix: Fix type hints in stdio client and logging server snippet
1 parent d08e585 commit 7f82f80

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

examples/snippets/servers/logging.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
import sys
66

77
from mcp.server.fastmcp import Context, FastMCP
8+
from mcp.server.session import ServerSession
89

910
mcp = FastMCP("Logging and stdio test")
1011

1112

1213
@mcp.tool()
13-
async def log(ctx: Context) -> str:
14+
async def log(ctx: Context[ServerSession, None]) -> str:
1415
await ctx.debug("Debug message")
1516
await ctx.info("Info message")
1617
print("Stderr message", file=sys.stderr)

src/mcp/client/stdio/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ async def _create_platform_compatible_process(
236236
command: str,
237237
args: list[str],
238238
env: dict[str, str] | None = None,
239-
errlog: TextIO = sys.stderr,
239+
errlog: TextIO | None = None,
240240
cwd: Path | str | None = None,
241241
):
242242
"""

0 commit comments

Comments
 (0)