File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
src/datapilot/core/mcp_utils Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 55from dataclasses import dataclass
66
77import click
8+ import pyperclip
89from mcp import ClientSession
910from mcp import StdioServerParameters
1011from mcp .client .stdio import stdio_client
@@ -117,7 +118,13 @@ def create_mcp_proxy():
117118 "config" : input_configs ,
118119 ** output
119120 }
120- click .echo (json .dumps (output_with_name , indent = 2 ))
121+ output_json = json .dumps (output_with_name , indent = 2 )
122+ click .echo (output_json )
123+ try :
124+ pyperclip .copy (output_json )
125+ click .secho ("\n Output copied to clipboard!" , fg = "green" )
126+ except pyperclip .PyperclipException as e :
127+ click .secho (f"\n Failed to copy to clipboard: { str (e )} " , fg = "yellow" )
121128
122129
123130async def list_tools (command : str , args : list [str ], env : dict [str , str ]):
You can’t perform that action at this time.
0 commit comments