Skip to content

Commit 8007f68

Browse files
authored
docs: adapter docstrings consistency (#221)
Noticed some minor inconsistencies in the README, so quickly tidied that & then went through the remaining adapter docstrings.
1 parent 4a2bfe5 commit 8007f68

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ client = MultiServerMCPClient(
122122
"transport": "stdio",
123123
},
124124
"weather": {
125-
# make sure you start your weather server on port 8000
125+
# Make sure you start your weather server on port 8000
126126
"url": "http://localhost:8000/mcp/",
127127
"transport": "streamable_http",
128128
}

langchain_mcp_adapters/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def __init__(
5959
"transport": "stdio",
6060
},
6161
"weather": {
62-
# make sure you start your weather server on port 8000
62+
# Make sure you start your weather server on port 8000
6363
"url": "http://localhost:8000/mcp",
6464
"transport": "streamable_http",
6565
}

langchain_mcp_adapters/prompts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def convert_mcp_prompt_message_to_langchain_message(
1414
message: MCP prompt message to convert
1515
1616
Returns:
17-
a LangChain message
17+
A LangChain message
1818
"""
1919
if message.content.type == "text":
2020
if message.role == "user":

langchain_mcp_adapters/sessions.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ class StdioConnection(TypedDict):
5454
The text encoding error handler.
5555
5656
See https://docs.python.org/3/library/codecs.html#codec-base-classes for
57-
explanations of possible values
57+
explanations of possible values.
5858
"""
5959

6060
session_kwargs: dict[str, Any] | None
61-
"""Additional keyword arguments to pass to the ClientSession"""
61+
"""Additional keyword arguments to pass to the ClientSession."""
6262

6363

6464
class SSEConnection(TypedDict):
@@ -68,19 +68,19 @@ class SSEConnection(TypedDict):
6868
"""The URL of the SSE endpoint to connect to."""
6969

7070
headers: dict[str, Any] | None
71-
"""HTTP headers to send to the SSE endpoint"""
71+
"""HTTP headers to send to the SSE endpoint."""
7272

7373
timeout: float
74-
"""HTTP timeout"""
74+
"""HTTP timeout."""
7575

7676
sse_read_timeout: float
77-
"""SSE read timeout"""
77+
"""SSE read timeout."""
7878

7979
session_kwargs: dict[str, Any] | None
80-
"""Additional keyword arguments to pass to the ClientSession"""
80+
"""Additional keyword arguments to pass to the ClientSession."""
8181

8282
httpx_client_factory: McpHttpClientFactory | None
83-
"""Custom factory for httpx.AsyncClient (optional)"""
83+
"""Custom factory for httpx.AsyncClient (optional)."""
8484

8585

8686
class StreamableHttpConnection(TypedDict):
@@ -100,13 +100,13 @@ class StreamableHttpConnection(TypedDict):
100100
All other HTTP operations are controlled by `timeout`."""
101101

102102
terminate_on_close: bool
103-
"""Whether to terminate the session on close"""
103+
"""Whether to terminate the session on close."""
104104

105105
session_kwargs: dict[str, Any] | None
106-
"""Additional keyword arguments to pass to the ClientSession"""
106+
"""Additional keyword arguments to pass to the ClientSession."""
107107

108108
httpx_client_factory: McpHttpClientFactory | None
109-
"""Custom factory for httpx.AsyncClient (optional)"""
109+
"""Custom factory for httpx.AsyncClient (optional)."""
110110

111111

112112
class WebsocketConnection(TypedDict):
@@ -133,7 +133,7 @@ async def _create_stdio_session(
133133
encoding_error_handler: Literal["strict", "ignore", "replace"] = DEFAULT_ENCODING_ERROR_HANDLER,
134134
session_kwargs: dict[str, Any] | None = None,
135135
) -> AsyncIterator[ClientSession]:
136-
"""Create a new session to an MCP server using stdio
136+
"""Create a new session to an MCP server using stdio.
137137
138138
Args:
139139
command: Command to execute
@@ -176,7 +176,7 @@ async def _create_sse_session(
176176
session_kwargs: dict[str, Any] | None = None,
177177
httpx_client_factory: McpHttpClientFactory | None = None,
178178
) -> AsyncIterator[ClientSession]:
179-
"""Create a new session to an MCP server using SSE
179+
"""Create a new session to an MCP server using SSE.
180180
181181
Args:
182182
url: URL of the SSE server
@@ -207,13 +207,13 @@ async def _create_streamable_http_session(
207207
session_kwargs: dict[str, Any] | None = None,
208208
httpx_client_factory: McpHttpClientFactory | None = None,
209209
) -> AsyncIterator[ClientSession]:
210-
"""Create a new session to an MCP server using Streamable HTTP
210+
"""Create a new session to an MCP server using Streamable HTTP.
211211
212212
Args:
213213
url: URL of the endpoint to connect to
214214
headers: HTTP headers to send to the endpoint
215215
timeout: HTTP timeout
216-
sse_read_timeout: How long (in seconds) the client will wait for a new event before disconnecting.
216+
sse_read_timeout: How long (in seconds) the client will wait for a new event before disconnecting
217217
terminate_on_close: Whether to terminate the session on close
218218
session_kwargs: Additional keyword arguments to pass to the ClientSession
219219
httpx_client_factory: Custom factory for httpx.AsyncClient (optional)
@@ -236,7 +236,7 @@ async def _create_websocket_session(
236236
url: str,
237237
session_kwargs: dict[str, Any] | None = None,
238238
) -> AsyncIterator[ClientSession]:
239-
"""Create a new session to an MCP server using Websockets
239+
"""Create a new session to an MCP server using Websockets.
240240
241241
Args:
242242
url: URL of the Websocket endpoint

0 commit comments

Comments
 (0)