Skip to content

Apps dev server retains unbounded MCP logs even when the panel is disabled #5548

Description

@mikamikasuki

What happened?

The Apps development server appends every decoded MCP request, response, and AppBridge message to an in-memory list. The list has no entry-count or byte limit and is cleared only by an explicit request.

Capture continues when the log panel is disabled. In a local Starlette `TestClient` reproduction with `log_panel=False`, the page had no panel markup, but three proxy requests left six full request/response entries available from `/api/logs`. A separate run of the log class retained about 36.5 MB of traced Python allocations after 2,000 request/response pairs with 8-KiB payloads on each side.

Long-running previews or repeated large tool results can therefore increase memory use for the lifetime of the dev server. Could the server bound retained log data and skip capture when the panel is disabled? This is related to #4121, which added the option to show or hide the log panel.

### Example Code

```Python

```

### Version Information

```Text
- FastMCP main: `5baeacfe20eca735cb949564b4915f93a622b916`
- Python: 3.12.15
- OS: macOS 15.0.1 arm64
```

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working. Reports of errors, unexpected behavior, or broken functionality.low-prioritymcp appsRelated to MCP Apps - user-facing applications with frontend bundles served by MCP servers.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions