Skip to content

Commit 5ad2548

Browse files
niechenclaude
andcommitted
Show security warning only when --no-auth is used
- Only display "Anyone with the URL can access your server" when authentication is disabled - When auth is enabled, show API key and authentication instructions instead - Apply this logic to both 'mcpm share' and 'mcpm profile share' commands - Improve user awareness of security implications based on auth settings 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 2a2c773 commit 5ad2548

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/mcpm/commands/profile/share.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ async def share_profile_fastmcp(profile_servers, profile_name, port, address, ht
105105
if not no_auth and api_key:
106106
console.print(f"[bold green]API Key:[/] [cyan]{api_key}[/]")
107107
console.print(f"[dim]Provide this key in the 'Authorization' header as a Bearer token.[/]")
108+
else:
109+
console.print("[bold red]Warning:[/] Anyone with the URL can access your servers.")
108110
console.print()
109111
console.print("[bold]Connection URLs:[/]")
110112
console.print(f" • Streamable HTTP: [cyan]{public_url}/mcp/[/]")

src/mcpm/commands/share.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,8 @@ async def _share_async(server_config, server_name, port, remote_host, remote_por
219219
if not no_auth and api_key:
220220
console.print(f"[bold green]API Key:[/] [cyan]{api_key}[/]")
221221
console.print(f"[dim]Provide this key in the 'Authorization' header as a Bearer token.[/]")
222-
console.print("[bold red]Warning:[/] Anyone with the URL can access your server.")
222+
else:
223+
console.print("[bold red]Warning:[/] Anyone with the URL can access your server.")
223224
console.print("[yellow]Press Ctrl+C to stop sharing and terminate the server[/]")
224225

225226
# Keep running until interrupted

0 commit comments

Comments
 (0)