Skip to content

Commit 0971cbb

Browse files
style: fix D212 violations in client module
1 parent ec700a9 commit 0971cbb

File tree

2 files changed

+9
-18
lines changed

2 files changed

+9
-18
lines changed

src/mcp/client/_memory.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616

1717

1818
class InMemoryTransport:
19-
"""
20-
In-memory transport for testing MCP servers without network overhead.
19+
"""In-memory transport for testing MCP servers without network overhead.
2120
2221
This transport starts the server in a background task and provides
2322
streams for client-side communication. The server is automatically
@@ -43,8 +42,7 @@ def __init__(
4342
*,
4443
raise_exceptions: bool = False,
4544
) -> None:
46-
"""
47-
Initialize the in-memory transport.
45+
"""Initialize the in-memory transport.
4846
4947
Args:
5048
server: The MCP server to connect to (Server or FastMCP instance)
@@ -63,8 +61,7 @@ async def connect(
6361
],
6462
None,
6563
]:
66-
"""
67-
Connect to the server and return streams for communication.
64+
"""Connect to the server and return streams for communication.
6865
6966
Yields:
7067
A tuple of (read_stream, write_stream) for bidirectional communication

src/mcp/client/client.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ def __init__(
6767
client_info: types.Implementation | None = None,
6868
elicitation_callback: ElicitationFnT | None = None,
6969
) -> None:
70-
"""
71-
Initialize the client with a server.
70+
"""Initialize the client with a server.
7271
7372
Args:
7473
server: The MCP server to connect to (Server or FastMCP instance)
@@ -139,8 +138,7 @@ async def __aexit__(
139138

140139
@property
141140
def session(self) -> ClientSession:
142-
"""
143-
Get the underlying ClientSession.
141+
"""Get the underlying ClientSession.
144142
145143
This provides access to the full ClientSession API for advanced use cases.
146144
@@ -194,8 +192,7 @@ async def list_resource_templates(
194192
return await self.session.list_resource_templates(params=params)
195193

196194
async def read_resource(self, uri: str | AnyUrl) -> types.ReadResourceResult:
197-
"""
198-
Read a resource from the server.
195+
"""Read a resource from the server.
199196
200197
Args:
201198
uri: The URI of the resource to read
@@ -222,8 +219,7 @@ async def call_tool(
222219
*,
223220
meta: dict[str, Any] | None = None,
224221
) -> types.CallToolResult:
225-
"""
226-
Call a tool on the server.
222+
"""Call a tool on the server.
227223
228224
Args:
229225
name: The name of the tool to call
@@ -255,8 +251,7 @@ async def get_prompt(
255251
name: str,
256252
arguments: dict[str, str] | None = None,
257253
) -> types.GetPromptResult:
258-
"""
259-
Get a prompt from the server.
254+
"""Get a prompt from the server.
260255
261256
Args:
262257
name: The name of the prompt
@@ -273,8 +268,7 @@ async def complete(
273268
argument: dict[str, str],
274269
context_arguments: dict[str, str] | None = None,
275270
) -> types.CompleteResult:
276-
"""
277-
Get completions for a prompt or resource template argument.
271+
"""Get completions for a prompt or resource template argument.
278272
279273
Args:
280274
ref: Reference to the prompt or resource template

0 commit comments

Comments
 (0)