Skip to content

Commit 505eebe

Browse files
niechenclaude
andcommitted
Remove unnecessary --debug flag from profile run command
- Remove --debug flag since logging is now controlled by MCPM_DEBUG env var - Update function signature to remove debug parameter - Update docstring to mention MCPM_DEBUG=1 for verbose output - Simplify command by using centralized logging configuration Consistent with other commands that use environment variables for debug control. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 4774bbb commit 505eebe

File tree

1 file changed

+9
-16
lines changed
  • src/mcpm/commands/profile

1 file changed

+9
-16
lines changed

src/mcpm/commands/profile/run.py

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ async def find_available_port(preferred_port, max_attempts=10):
3232
return preferred_port
3333

3434

35-
async def run_profile_fastmcp(profile_servers, profile_name, debug=False, http_mode=False, port=DEFAULT_PORT):
35+
async def run_profile_fastmcp(profile_servers, profile_name, http_mode=False, port=DEFAULT_PORT):
3636
"""Run profile servers using FastMCP proxy for proper aggregation."""
3737
server_count = len(profile_servers)
3838
logger.debug(f"Using FastMCP proxy to aggregate {server_count} server(s)")
@@ -81,11 +81,10 @@ async def run_profile_fastmcp(profile_servers, profile_name, debug=False, http_m
8181

8282
@click.command()
8383
@click.argument("profile_name")
84-
@click.option("--debug", is_flag=True, help="Show debug output")
8584
@click.option("--http", is_flag=True, help="Run profile over HTTP instead of stdio")
8685
@click.option("--port", type=int, default=DEFAULT_PORT, help=f"Port for HTTP mode (default: {DEFAULT_PORT})")
8786
@click.help_option("-h", "--help")
88-
def run(profile_name, debug, http, port):
87+
def run(profile_name, http, port):
8988
"""Execute all servers in a profile over stdio or HTTP.
9089
9190
Uses FastMCP proxy to aggregate servers into a unified MCP interface
@@ -97,7 +96,8 @@ def run(profile_name, debug, http, port):
9796
mcpm profile run web-dev # Run over stdio (default)
9897
mcpm profile run --http web-dev # Run over HTTP on port 6276
9998
mcpm profile run --http --port 9000 ai # Run over HTTP on port 9000
100-
mcpm profile run --debug --http web-dev # Debug + HTTP mode
99+
100+
Debug logging: Set MCPM_DEBUG=1 for verbose output
101101
"""
102102
# Validate profile name
103103
if not profile_name or not profile_name.strip():
@@ -127,22 +127,15 @@ def run(profile_name, debug, http, port):
127127

128128
logger.info(f"Running profile '{profile_name}' with {len(profile_servers)} server(s)")
129129

130-
if debug:
131-
logging.basicConfig(level=logging.DEBUG)
132-
133-
# Only show visual output in debug mode or HTTP mode
134-
if debug or http:
135-
logger.info(f"Running profile '{profile_name}' with {len(profile_servers)} server(s)")
136-
137-
if debug:
138-
logger.debug("Servers to run:")
139-
for server_config in profile_servers:
140-
logger.debug(f" - {server_config.name}: {server_config}")
130+
# Log debug info about servers (controlled by MCPM_DEBUG environment variable)
131+
logger.debug("Servers to run:")
132+
for server_config in profile_servers:
133+
logger.debug(f" - {server_config.name}: {server_config}")
141134

142135
# Use FastMCP proxy for all cases (single or multiple servers)
143136
logger.debug(f"Using FastMCP proxy for {len(profile_servers)} server(s)")
144137
if http:
145138
logger.debug(f"HTTP mode on port {port}")
146139

147140
# Run the async function
148-
return asyncio.run(run_profile_fastmcp(profile_servers, profile_name, debug, http_mode=http, port=port))
141+
return asyncio.run(run_profile_fastmcp(profile_servers, profile_name, http_mode=http, port=port))

0 commit comments

Comments
 (0)