Skip to content

Commit 3210ea3

Browse files
committed
isort black linting
1 parent 9f8f17b commit 3210ea3

File tree

4 files changed

+20
-22
lines changed

4 files changed

+20
-22
lines changed

mcpgateway-wrapper/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ If an MCP client doesn't support SSE but does support stdio, use this wrapper to
1616

1717
The server extends tools from the server catalogs of mcp gateway
1818

19-
### Resources
19+
### Resources
2020

2121
The server fetched resources from the server catalogs of mcp gateway
2222

@@ -78,7 +78,7 @@ This parameter specifies one or more URLs pointing to the MCP server catalog. UR
7878
```bash
7979
"MCP_SERVER_CATALOG_URLS": "http://localhost:4444/servers/1,http://localhost:4444/servers/2,http://localhost:4444/servers/3"
8080
```
81-
3.3 All tools, prompts, resources (gateway URL):
81+
3.3 All tools, prompts, resources (gateway URL):
8282
```bash
8383
"MCP_SERVER_CATALOG_URLS": "http://localhost:4444"
8484
```
@@ -137,4 +137,4 @@ npx @modelcontextprotocol/inspector uv --directory "path to mcpgateway-wrapper"
137137
```
138138

139139

140-
Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.
140+
Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.

mcpgateway-wrapper/src/mcpgateway_wrapper/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"""
88

99
import asyncio
10+
1011
from . import server
1112

1213

mcpgateway-wrapper/src/mcpgateway_wrapper/server.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,23 @@
55
SPDX-License-Identifier: Apache-2.0
66
Authors: Keval Mahajan, Mihai Criveti, Madhav Kandukuri
77
8-
This module implements a wrapper bridge that facilitates
9-
interaction between the MCP client and the MCP gateway.
10-
It provides several functionalities, including listing tools, invoking tools, managing resources ,
8+
This module implements a wrapper bridge that facilitates
9+
interaction between the MCP client and the MCP gateway.
10+
It provides several functionalities, including listing tools, invoking tools, managing resources ,
1111
retrieving prompts, and handling tool calls via the MCP gateway.
1212
"""
1313

1414
import asyncio
1515
import os
16-
from typing import List, Dict, Any, Optional, Union
16+
from typing import Any, Dict, List, Optional, Union
1717
from urllib.parse import urlparse
1818

19-
2019
import httpx
21-
from pydantic import AnyUrl
22-
20+
import mcp.server.stdio
2321
from mcp import types
2422
from mcp.server import NotificationOptions, Server
2523
from mcp.server.models import InitializationOptions
26-
import mcp.server.stdio
24+
from pydantic import AnyUrl
2725

2826

2927
def extract_base_url(url: str) -> str:

mcpgateway/db.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
Text,
3434
create_engine,
3535
func,
36-
select,
3736
make_url,
37+
select,
3838
)
3939
from sqlalchemy.event import listen
4040
from sqlalchemy.exc import SQLAlchemyError
@@ -50,30 +50,29 @@
5050
from mcpgateway.config import settings
5151
from mcpgateway.types import ResourceContent
5252

53-
5453
# ---------------------------------------------------------------------------
5554
# 1. Parse the URL so we can inspect backend ("postgresql", "sqlite", …)
5655
# and the specific driver ("psycopg2", "asyncpg", empty string = default).
5756
# ---------------------------------------------------------------------------
5857
url = make_url(settings.database_url)
59-
backend = url.get_backend_name() # e.g. 'postgresql', 'sqlite'
60-
driver = url.get_driver_name() or "default"
58+
backend = url.get_backend_name() # e.g. 'postgresql', 'sqlite'
59+
driver = url.get_driver_name() or "default"
6160

6261
# Start with an empty dict and add options only when the driver can accept
63-
# them; this prevents unexpected TypeError at connect time.
62+
# them; this prevents unexpected TypeError at connect time.
6463
connect_args: dict[str, object] = {}
6564

6665
# ---------------------------------------------------------------------------
6766
# 2. PostgreSQL (synchronous psycopg2 only)
6867
# The keep-alive parameters below are recognised exclusively by libpq /
69-
# psycopg2 and let the kernel detect broken network links quickly.
68+
# psycopg2 and let the kernel detect broken network links quickly.
7069
# ---------------------------------------------------------------------------
7170
if backend == "postgresql" and driver in ("psycopg2", "default", ""):
7271
connect_args.update(
73-
keepalives=1, # enable TCP keep-alive probes
74-
keepalives_idle=30, # seconds of idleness before first probe
75-
keepalives_interval=5, # seconds between probes
76-
keepalives_count=5, # drop the link after N failed probes
72+
keepalives=1, # enable TCP keep-alive probes
73+
keepalives_idle=30, # seconds of idleness before first probe
74+
keepalives_interval=5, # seconds between probes
75+
keepalives_count=5, # drop the link after N failed probes
7776
)
7877

7978
# ---------------------------------------------------------------------------
@@ -90,7 +89,7 @@
9089
# ---------------------------------------------------------------------------
9190
engine = create_engine(
9291
settings.database_url,
93-
pool_pre_ping=True, # quick liveness check per checkout
92+
pool_pre_ping=True, # quick liveness check per checkout
9493
pool_size=settings.db_pool_size,
9594
max_overflow=settings.db_max_overflow,
9695
pool_timeout=settings.db_pool_timeout,

0 commit comments

Comments
 (0)