Skip to content

Commit df5385f

Browse files
committed
feat: add command args and env with config placeholders to output
1 parent 3d142a8 commit df5385f

File tree

1 file changed

+11
-0
lines changed
  • src/datapilot/core/mcp_utils

1 file changed

+11
-0
lines changed

src/datapilot/core/mcp_utils/mcp.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,20 @@ def create_mcp_proxy():
116116

117117
# Execute with processed parameters
118118
output = asyncio.run(list_tools(command=server_config["command"], args=processed_args, env=processed_env))
119+
# Add processed parameters to output
119120
output_with_name = {
120121
"name": server_name,
121122
"config": input_configs,
123+
"command": server_config["command"],
124+
"args": [
125+
f"${{{input_id}}}" if any(input_val in str(arg) for input_val in inputs.values()) else arg
126+
for arg, input_id in zip(server_config.get("args", []), inputs.keys())
127+
],
128+
"env": {
129+
k: f"${{{input_id}}}" if any(input_val in str(v) for input_val in inputs.values()) else v
130+
for k, v in server_config.get("env", {}).items()
131+
for input_id in inputs
132+
},
122133
**output
123134
}
124135
output_json = json.dumps(output_with_name, indent=2)

0 commit comments

Comments
 (0)