Skip to content

Prevent MCP HTTP client buffer leaks - #503

Merged
tninja merged 1 commit into
mainfrom
kang_feat_1
Sep 3, 2026
Merged

Prevent MCP HTTP client buffer leaks#503
tninja merged 1 commit into
mainfrom
kang_feat_1

Conversation

@tninja

@tninja tninja commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Summary

Prevent the local MCP HTTP server from leaving an empty visible buffer behind for every accepted connection.

The listener now installs the existing HTTP process filter up front, which stops Emacs from allocating a default client process buffer before the accept callback runs. This keeps MCP requests out of the buffer list without changing request handling.

A real socket regression test verifies that a completed request leaves no ai-code-mcp-http-server <...> buffers behind.

Verification

  • MCP HTTP test suite: 23/23 passed
  • Full ERT suite: 1,434 passed, 13 skipped, 0 unexpected
  • 100 consecutive connections: 0 visible client buffers

Fixes #499

@tninja
tninja merged commit a24035f into main Sep 3, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature request] emacs_tools (MCP) creates lots of (empty) buffers: ai-code-mcp-http-server <127.0.0.1:56504> (for ex.)

1 participant