Skip to content

FastMCP banner breaks stdio transport for Claude Code MCP clients #19

@rjmurillo-bot

Description

@rjmurillo-bot

Problem

When running uvx forgetful-ai in stdio mode (the default), the FastMCP framework prints an ASCII art banner and deprecation warnings to stdout before the MCP protocol begins. This corrupts the JSON-RPC protocol, causing MCP clients like Claude Code to fail with:

Status: ✘ failed

Reproduction

  1. Configure Claude Code's .mcp.json:
{
  "mcpServers": {
    "forgetful": {
      "type": "stdio",
      "command": "uvx",
      "args": ["forgetful-ai"]
    }
  }
}
  1. Start Claude Code - the forgetful MCP server shows as failed

Output Analysis

Running uvx forgetful-ai shows this output on stdout:

╭──────────────────────────────────────────────────────────────────────────────╮
│                         ▄▀▀ ▄▀█ █▀▀ ▀█▀ █▀▄▀█ █▀▀ █▀█                        │
│                         █▀  █▀█ ▄▄█  █  █ ▀ █ █▄▄ █▀▀                        │
│                                FastMCP 2.14.2                                │
...

Plus deprecation warnings from httplib2/auth.py and google.generativeai.

The MCP stdio protocol expects the first bytes to be JSON-RPC, but receives ASCII art instead.

Workaround

Use HTTP transport instead:

{
  "mcpServers": {
    "forgetful": {
      "type": "http", 
      "url": "http://localhost:8020/mcp"
    }
  }
}

Then start the server manually:

uvx forgetful-ai --transport http --port 8020

Suggested Fix

  1. Suppress banner in stdio mode: FastMCP should detect stdio transport and skip the banner, or redirect it to stderr
  2. Suppress Python warnings: Use PYTHONWARNINGS=ignore or warnings.filterwarnings()
  3. Document the workaround: Update README to note HTTP transport requirement for Claude Code

Environment

  • forgetful-ai via uvx
  • FastMCP 2.14.2
  • Python 3.13
  • Claude Code CLI
  • Linux (Ubuntu)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions