File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -234,9 +234,9 @@ def mcp(
234234 sys .exit (0 )
235235
236236
237- @app .command ()
237+ @app .command (context_settings = { "allow_extra_args" : True , "allow_interspersed_args" : False } )
238238def wrap (
239- command : list [ str ] = typer .Argument (..., help = "MCP server command and arguments" ) ,
239+ ctx : typer .Context ,
240240 debug : bool = typer .Option (False , "--debug" , "-d" , help = "Enable debug output" )
241241):
242242 """Wrap an MCP server to capture stdio traffic transparently.
@@ -253,17 +253,19 @@ def wrap(
253253 "command": "mcphawk",
254254 "args": ["wrap", "/path/to/mcp-server", "--arg1", "--arg2"]
255255 """
256+ # Get the command from remaining args
257+ command = ctx .args
258+ if not command :
259+ logger .error ("No command specified to wrap" )
260+ raise typer .Exit (1 )
261+
256262 # Configure logging
257263 logger .handlers .clear ()
258264 handler = logging .StreamHandler (sys .stderr ) # Use stderr to avoid interfering with stdio
259265 handler .setFormatter (logging .Formatter ('%(message)s' ))
260266 logger .addHandler (handler )
261267 logger .setLevel (logging .DEBUG if debug else logging .INFO )
262268
263- if not command :
264- logger .error ("No command specified to wrap" )
265- raise typer .Exit (1 )
266-
267269 logger .info (f"Starting MCP wrapper for: { ' ' .join (command )} " )
268270
269271 # Run the wrapper
You can’t perform that action at this time.
0 commit comments