Skip to content

fix: no banner when run profile in stdio mode - #251

Merged
JoJoJoJoJoJoJo merged 1 commit into
mainfrom
jonathan/fix-avoid-show-banner-in-stdio
Aug 23, 2025
Merged

fix: no banner when run profile in stdio mode#251
JoJoJoJoJoJoJo merged 1 commit into
mainfrom
jonathan/fix-avoid-show-banner-in-stdio

Conversation

@JoJoJoJoJoJoJo

@JoJoJoJoJoJoJo JoJoJoJoJoJoJo commented Aug 23, 2025

Copy link
Copy Markdown
Contributor

User description

do not show fastmcp banner when running profile in stdio mode

Resolves #243


PR Type

Bug fix


Description

  • Disable banner display when running profile in stdio mode

Diagram Walkthrough

flowchart LR
  A["Profile Run"] --> B["Check Mode"]
  B --> C["HTTP/SSE Mode"]
  B --> D["Stdio Mode"]
  C --> E["Show Banner"]
  D --> F["Hide Banner"]
Loading

File Walkthrough

Relevant files
Bug fix
run.py
Disable banner for stdio mode execution                                   

src/mcpm/commands/profile/run.py

  • Added show_banner=False parameter to run_stdio_async() call
  • Prevents banner display when profile runs in stdio mode
+1/-1     

Summary by CodeRabbit

  • Style
    • Startup banner is now suppressed in stdio mode, providing cleaner, less noisy output when running profiles.
    • HTTP/SSE modes are unchanged.

Copilot AI review requested due to automatic review settings August 23, 2025 07:51
@coderabbitai

coderabbitai Bot commented Aug 23, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

The stdio execution path in run_profile_fastmcp now calls proxy.run_stdio_async(show_banner=False), aligning with a public API change that adds an optional show_banner parameter (default True) to mcpm.fastmcp_integration.proxy.run_stdio_async. Other execution paths and behavior remain unchanged.

Changes

Cohort / File(s) Summary
Stdio banner suppression in profile run
src/mcpm/commands/profile/run.py
Updated stdio path to call proxy.run_stdio_async(show_banner=False) to suppress banner.
Proxy API signature update
.../mcpm/fastmcp_integration/proxy.*
Changed public method signature to run_stdio_async(show_banner: bool = True) from run_stdio_async() to support optional banner display.

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant CLI as Profile Runner
  participant Proxy as FastMCP Proxy
  participant Stdio as Stdio Server

  User->>CLI: run_profile_fastmcp(...)
  alt stdio mode
    CLI->>Proxy: run_stdio_async(show_banner=false)
    note right of Proxy: Suppress startup banner
    Proxy->>Stdio: Initialize and run loop
    Stdio-->>Proxy: IO events
    Proxy-->>CLI: Completion/Status
  else http/sse modes
    CLI->>Proxy: start_http()/start_sse()
    Proxy-->>CLI: Running servers
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I twitch my ears at silent start,
No banner booms to make me dart—
A hush, a hop, the stdio sings,
With quiet paws on subtle strings.
Flags aligned, the proxies play,
Soft as clover, code at bay. 🥕

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch jonathan/fix-avoid-show-banner-in-stdio

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses a UI/UX issue by suppressing the FastMCP banner when running profiles in stdio mode to prevent unnecessary output that could interfere with stdio communication.

  • Adds show_banner=False parameter to proxy.run_stdio_async() call in stdio mode

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@qodo-code-review

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

API Compatibility

Ensure proxy.run_stdio_async actually supports the show_banner keyword and defaults remain unchanged in other call sites; otherwise this may raise a TypeError at runtime.

# Run the aggregated proxy over stdio (default)
logger.info(f"Starting profile '{profile_name}' over stdio")
await proxy.run_stdio_async(show_banner=False)

@qodo-code-review

Copy link
Copy Markdown
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Add backward-compatible fallback

Ensure the run_stdio_async call remains backward compatible if older proxy
versions don't support show_banner. Guard the argument with a capability check
or fallback call to prevent a runtime TypeError.

src/mcpm/commands/profile/run.py [120]

-await proxy.run_stdio_async(show_banner=False)
+try:
+    await proxy.run_stdio_async(show_banner=False)
+except TypeError:
+    # Fallback for older versions that don't accept show_banner
+    await proxy.run_stdio_async()
  • Apply / Chat
Suggestion importance[1-10]: 7

__

Why: The suggestion correctly identifies a potential backward compatibility issue that could cause a runtime TypeError and provides a robust try-except block as a fallback.

Medium
  • More

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
src/mcpm/commands/profile/run.py (2)

112-116: Consider also hiding the banner in HTTP/SSE for consistency with run command UX.

In src/mcpm/commands/run.py, run_http_async is called with show_banner=False. Doing the same here keeps the profile-run UX consistent and avoids duplicate banners alongside the Rich panel.

             transport = "sse" if sse_mode else "http"
-            await proxy.run_http_async(
-                host=host, port=actual_port, transport=transport, uvicorn_config={"log_level": get_uvicorn_log_level()}
-            )
+            await proxy.run_http_async(
+                host=host,
+                port=actual_port,
+                show_banner=False,
+                transport=transport,
+                uvicorn_config={"log_level": get_uvicorn_log_level()},
+            )

45-70: Optional: Add a unit test to assert the stdio path disables the banner.

A lightweight test can monkeypatch create_mcpm_proxy to a stub whose run_stdio_async records kwargs, then invoke run_profile_fastmcp in stdio mode and assert show_banner is False. This guards against regressions.

If helpful, I can draft a pytest using monkeypatch to simulate the proxy and event loop without running real IO.

Also applies to: 118-121

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between ec3a2d5 and 09ff696.

📒 Files selected for processing (1)
  • src/mcpm/commands/profile/run.py (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

Always format Python code with ruff.

Files:

  • src/mcpm/commands/profile/run.py
🧬 Code graph analysis (1)
src/mcpm/commands/profile/run.py (2)
src/mcpm/commands/run.py (2)
  • run_server_with_fastmcp (35-110)
  • run (139-216)
src/mcpm/fastmcp_integration/proxy.py (1)
  • create_proxy_for_profile (130-146)
🔇 Additional comments (1)
src/mcpm/commands/profile/run.py (1)

118-121: Unable to confirm show_banner support in FastMCP’s run_stdio_async

I wasn’t able to locate a local definition of run_stdio_async or run_http_async in our mcpm/fastmcp_integration/proxy.py; these methods are provided by the external FastMCP library. Please manually verify that in the FastMCP version we depend on, both:

  • FastMCP.run_stdio_async(show_banner: bool)
  • FastMCP.run_http_async(show_banner: bool)

actually accept a show_banner parameter and suppress the banner when set to False. If confirmed, suppressing the banner here is correct and matches the behavior in src/mcpm/commands/run.py.

Locations passing show_banner=False:

  • src/mcpm/commands/run.py line 92
  • src/mcpm/commands/profile/run.py line 120

Once you’ve confirmed against FastMCP’s public API or source, this change can be approved.

@github-actions

Copy link
Copy Markdown
Contributor

Summary
The PR tweaks one call in src/mcpm/commands/profile/run.py, passing show_banner=False to proxy.run_stdio_async() so the fast-MCP profile runs without printing the banner.

Review
Looks good—reduces noise in stdio mode and keeps default behaviour unchanged elsewhere.

  • Confirm run_stdio_async() already supports the show_banner kwarg; otherwise add it or guard with getattr.
  • Consider adding/adjusting a unit test to ensure the banner stays suppressed in this path.

Nice quality-of-life improvement!


View workflow run

@openhands-ai

openhands-ai Bot commented Aug 23, 2025

Copy link
Copy Markdown

Looks like there are a few issues preventing this PR from being merged!

  • GitHub Actions are failing:
    • Codex
    • .github/workflows/mcp-server-info-bot.yml

If you'd like me to help, just leave a comment, like

@OpenHands please fix the failing actions on PR #251 at branch `jonathan/fix-avoid-show-banner-in-stdio`

Feel free to include any additional details that might help me get this PR into a better state.

You can manage your notification settings

@JoJoJoJoJoJoJo
JoJoJoJoJoJoJo merged commit 7e243fc into main Aug 23, 2025
9 of 10 checks passed
@JoJoJoJoJoJoJo
JoJoJoJoJoJoJo deleted the jonathan/fix-avoid-show-banner-in-stdio branch August 23, 2025 08:40
mcpm-semantic-release Bot pushed a commit that referenced this pull request Sep 4, 2025
## [2.7.1](v2.7.0...v2.7.1) (2025-09-04)

### Bug Fixes

* no banner when run profile in stdio mode ([#251](#251)) ([7e243fc](7e243fc))
@mcpm-semantic-release

Copy link
Copy Markdown

🎉 This PR is included in version 2.7.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Claude Desktop raises invalid JSON due to banner

2 participants