Skip to content

Commit b59c10c

Browse files
committed
minor changes
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
1 parent c3e1182 commit b59c10c

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

mcpgateway/translate.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1774,21 +1774,22 @@ async def health() -> Response:
17741774
@original_app.post("/mcp")
17751775
async def mcp_post(request: Request) -> Response:
17761776
"""
1777-
Handles POST requests to the `/mcp` endpoint, forwarding JSON payloads to stdio
1777+
Handles POST requests to the `/mcp` endpoint, forwarding JSON payloads to stdio
17781778
and optionally waiting for a correlated response.
17791779
1780-
The request body is expected to be a JSON object or newline-delimited JSON.
1781-
If the JSON includes an "id" field, the function attempts to match it with
1780+
The request body is expected to be a JSON object or newline-delimited JSON.
1781+
If the JSON includes an "id" field, the function attempts to match it with
17821782
a response from stdio using a pubsub queue, within a timeout period.
17831783
17841784
Args:
17851785
request (Request): The incoming FastAPI request containing the JSON payload.
17861786
17871787
Returns:
1788-
Response:
1789-
- `200 OK` with matched JSON response if correlation succeeds.
1790-
- `202 Accepted` if no matching response is received in time or for notifications.
1791-
- `400 Bad Request` if the payload is not valid JSON.
1788+
Response: A FastAPI Response object.
1789+
- 200 OK with matched JSON response if correlation succeeds.
1790+
- 202 Accepted if no matching response is received in time or for notifications.
1791+
- 400 Bad Request if the payload is not valid JSON.
1792+
17921793
Example:
17931794
>>> import httpx
17941795
>>> response = httpx.post("http://localhost:8000/mcp", json={"id": 123, "method": "ping"})

0 commit comments

Comments
 (0)