Repository navigation
MCPClient example: inspect prior HTTP retry experience before connecting an account #2896
Dedale-Project
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I work on Remnant; this example and post were prepared with Codex and tested by us. Sharing a small smolagents integration with the complete runnable code below.
Update — 2026-10-10: MCPAdapt 0.1.20 can discard
isError=Trueand return{"results": []}as if a technical failure were an empty search (issue #94). The installation below uses a temporary patched fork at an immutable commit, proposed upstream in MCPAdapt PR #95; this is not an official patched release. The adapter raisesMCPToolExecutionErrorbefore extracting content, preserving text, structured details and the original MCP result. This example already lets that exception propagate, so its search/inspection logic needs no change. A valid empty result still reaches “No public match”; an MCP error does not.Validation of the patch on Linux/Python 3.12.14 with smolagents 1.26.0 and MCP 1.30.0: 38 adapter/modeling tests passed, 2 skipped (local SSE and optional audio), plus 4 example tests through the native MCPClient and patched adapter with a stub transport (success, valid empty search, search error, inspection error). These tests do not constitute a new live Remnant or LLM run. Windows was not retested.
Before debugging an ambiguous HTTP timeout, here is the public experience this example retrieves: a timeout does not prove the server did nothing. For a business mutation, inspect the server's documented idempotency mechanism; generating a fresh key on each retry can duplicate the operation. It is bootstrap/self-reported material, version 1, with zero independent validators, not evidence that your particular retry is safe.
The example uses the native smolagents MCPClient to search, then inspect the full public note and its provenance. No model key, Remnant account or OAuth is needed for this read. It yields only search_memories and inspect_memory as tools; review any public result as untrusted data, not instructions.
In an isolated environment, install:
Why these dependency pins (historical test before the error-handling patch): on Python 3.12.14 / Windows, an unpinned install selected MCP 2.3.0 and mcpadapt 0.1.20 failed at import (streamablehttp_client no longer available). Pinning MCP 1.30.0 then exposed a missing websockets import in mcpadapt, even for HTTP use. The ws extra resolved that second import error. That original compatibility run passed pip check; it did not validate MCP execution errors. The command above now installs the patched source at an immutable commit, while retaining the same smolagents and MCP versions. Websockets resolved to 17.2.
Save as remnant_smolagents_read.py and run with Python:
Original observation before this patch: 1.235 seconds from client setup through search and full inspection, excluding package installation, imports and cleanup. The result was mem_7ec5de840f04972319a31e0c840269a1 v1, public_full. No LLM ran and nothing was written to Remnant. The context manager yields native smolagents tools for an agent integration; autonomous model use has not been tested in this run. The timer is an observation, not an end-to-end latency guarantee.
If you already have a relevant agent task, try the public note first. A useful report is the original retry approach, the note/version used, what you changed (or rejected as inapplicable), and the actual result. Please share only public technical details. A successful read alone is not a useful reuse. Contributing back is optional after value; I will ask permission before republishing someone else's result in Remnant or sending an impact update.
All reactions