Skip to content

Commit 7eb88f2

Browse files
committed
chore: format and organize imports in mcp utils
1 parent 55056b6 commit 7eb88f2

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def read(*names, **kwargs):
6868
"tabulate~=0.9.0",
6969
"requests>=2.31",
7070
"sqlglot~=25.30.0",
71-
"mcp~=1.9.0"
71+
"mcp~=1.9.0",
7272
],
7373
extras_require={
7474
# eg:

src/datapilot/core/mcp_utils/mcp.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
import asyncio
2-
import logging
32
import json
3+
import logging
44
import shutil
55

6-
from mcp import ClientSession, StdioServerParameters
7-
from mcp.client.stdio import stdio_client
86
import click
7+
from mcp import ClientSession
8+
from mcp import StdioServerParameters
9+
from mcp.client.stdio import stdio_client
910

1011
logging.basicConfig(level=logging.INFO)
1112

13+
1214
# New mcp group
1315
@click.group()
1416
def mcp():
@@ -34,10 +36,7 @@ def create_mcp_proxy():
3436
# Process inputs first
3537
for input_def in mcp_config.get("inputs", []):
3638
input_id = input_def["id"]
37-
inputs[input_id] = click.prompt(
38-
input_def.get("description", input_id),
39-
hide_input=input_def.get("password", False)
40-
)
39+
inputs[input_id] = click.prompt(input_def.get("description", input_id), hide_input=input_def.get("password", False))
4140

4241
# Process servers
4342
servers = mcp_config.get("servers", {})
@@ -55,14 +54,11 @@ def create_mcp_proxy():
5554
}
5655

5756
# Execute with processed parameters
58-
output = asyncio.run(list_tools(
59-
command=server_config["command"],
60-
args=processed_args,
61-
env=processed_env
62-
))
57+
output = asyncio.run(list_tools(command=server_config["command"], args=processed_args, env=processed_env))
6358
click.echo(f"\nServer: {server_name}")
6459
click.echo(json.dumps(output, indent=2))
6560

61+
6662
async def list_tools(command: str, args: list[str], env: dict[str, str]):
6763
command_path = shutil.which(command)
6864
if not command_path:

0 commit comments

Comments
 (0)