mudler / mudler/LocalAGI

MCP Server with HTTP transport fails after connection reset

Open
#418 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
2k
Forks
291
Avg merge
30m
Merged PRs (30d)
3

Description

If connection to HTTP based MCP server is temporarily disrupted after the tools are initialized, the following errors appear in logs and no requests can be processed until after the agent is restarted and establishes a new connection to the MCP server:

time=2026-02-15T20:54:27.468-05:00 level=DEBUG msg="Agent is consuming a job" agent=test_agent job="&{Result:0xc000428120 ReasoningCallback:0x7ff653d0f180 ResultCallback:0x7ff653d0eb60 ConversationHistory:[{Role:user Content:tt Refusal: MultiContent:[] Name: ReasoningContent: FunctionCall:<nil> ToolCalls:[] ToolCallID:}] UUID:dc35e499-201a-4e8b-88a6-0b6955af6fb6 Metadata:map[] DoneFilter:false BuiltinTools:[] UserTools:[] ToolChoice: context:0xc000610050 fragment:<nil> cancel:0x7ff652e26ec0 Obs:0xc000580840}" source.file=C:/src/LocalAGI/core/agent/agent.go source.L=1315
time=2026-02-15T20:54:27.469-05:00 level=DEBUG msg="No filters" source.file=C:/src/LocalAGI/core/agent/agent.go source.L=588
time=2026-02-15T20:54:27.469-05:00 level=DEBUG msg="Processing user inputs" agent=test_agent conversation="user: tt\n" source.file=C:/src/LocalAGI/core/agent/agent.go source.L=512
time=2026-02-15T20:54:27.469-05:00 level=DEBUG msg="[Knowledge Base Lookup] Disabled, skipping" agent=test_agent source.file=C:/src/LocalAGI/core/agent/knowledgebase.go source.L=21
time=2026-02-15T20:54:27.478-05:00 level=ERROR msg="Error listing tools: %v" !BADKEY="connection closed: calling \"tools/list\": client is closing: standalone SSE stream: failed to connect: Bad Request" source.file=C:/Users/user/go/pkg/mod/github.com/mudler/cogito@v0.8.2-0.20260215230740-d1c0dc9bd9dc/mcp.go source.L=108
time=2026-02-15T21:50:08.960-05:00 level=ERROR msg="Error executing cogito" error="failed to get relevant guidelines: failed to get MCP tools: connection closed: calling \"tools/list\": client is closing: standalone SSE stream: failed to connect: Bad Request" source.file=C:/src/LocalAGI/core/agent/agent.go source.L=1162
time=2026-02-15T21:50:08.960-05:00 level=DEBUG msg="Agent has finished" agent=test_agent source.file=C:/src/LocalAGI/core/agent/agent.go source.L=238

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading core/agent/agent.go around lines 512, 1162, and 1315, then inspect the MCP tool-listing path referenced in the logs and core/agent/knowledgebase.go. Reproduce a temporary HTTP MCP connection reset after tool initialization. Done means the agent can process requests again without requiring a restart.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, backend, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.