Repository navigation
fix: bump mcp to 1.28.1 and fix read_resource - #10
Uzair-Ahmed-Dahraj merged 5 commits into
Conversation
Bump mcp to 1.28.1 to clear the High advisories against 1.6.0. Fix read_resource: the SDK passes an AnyUrl, not a str.
Revert the optional changes. Keep mcp 1.28.1 (High advisories), the read_resource fix and its test.
mcp 1.6.0 has five High advisories. The SDK passes an AnyUrl, not a str, to read_resource.
There was a problem hiding this comment.
devkind-code-review: whatweb-mcp #10 — first review
Mode: comment-only · Checks: tests ✓ (20/20 at head 653830a9, python3.12 venv matching the runtime; 2 pre-existing asyncio teardown warnings)
Verified at the head SHA, not from the PR body.
What this PR does (verified)
mcp==1.6.0 → 1.28.1— same SDK signature change as the sibling repos:read_resource(uri: str)→(uri: AnyUrl)withstr()normalization (server.py:352-353). Correct.- New
tests/test_resource.pyexercises the handler through the registeredrequest_handlers[ReadResourceRequest]and asserts the not-found payload — a different seam from the client-level test used in theharvester-mcp#6; good coverage diversity across the family.
Findings
low
- requirements.txt:1 — same as sibling repos: on Python ≥3.14,
mcp==1.28.1demandspydantic>=2.12.0while this pin holdspydantic==2.11.5→ResolutionImpossibleonpip install(reproduced on 3.14.7; passes on 3.12). Runtime/Docker unaffected; floor bump or README note would save contributors on new Pythons.
note
- server.py (not-found return shape) — pre-existing design, unchanged by this PR; same note as siblings.
Verdict
✅ Ship it — small, correct, tested.
| @@ -1,3 +1,3 @@ | |||
| mcp==1.6.0 | |||
| mcp==1.28.1 | |||
There was a problem hiding this comment.
[compat] On Python ≥3.14 mcp==1.28.1 requires pydantic>=2.12.0, conflicting with this file's pydantic==2.11.5 pin (reproduced ResolutionImpossible on 3.14.7). Fine on 3.12/3.13 — consider a floor bump or README note.
There was a problem hiding this comment.
devkind-code-review: devkindhq/whatweb-mcp #10
Mode: comment-only · Head: 653830a9
Checks (at head, fresh venv): pytest 20/20 green on Python 3.12 + mcp 1.28.1 — matches the PR body's claim exactly. Dependency set resolves cleanly on 3.12.
Verified
- The
AnyUrl → strfix is correct and the new test exercises the real registered handler (app.request_handlers[ReadResourceRequest]), not a mock — good. - mcp 1.28.1 clears the 5 high advisories named in the body; remaining 4 are moderate/HTTP-client-side, and this server is stdio-only — acceptable.
release.ymlgate (tag == server.json version == package ref) means thev1.0.1tag will ship this without a version bump — consistent with the review note.
Findings
🟡 low-medium — requirements.txt is now uninstallable on Python 3.13+
mcp==1.28.1 requires pydantic>=2.12 on python_version >= "3.14" (and similar for 3.13 wheels), while this PR keeps pydantic==2.11.5 pinned. On Python 3.14, pip install -r requirements.txt dies with ResolutionImpossible (verified locally). The Dockerfile is python3-from-image (check its base tag — if it's 3.12 you're fine today), but anyone on a newer interpreter gets a broken install. Suggest: bump pydantic to >=2.12,<3 alongside the mcp bump, or pin the Docker base image explicitly to 3.12 in the same PR.
low — deprecated return shape
read_resource returning str triggers: "Returning str or bytes from read_resource is deprecated. Use Iterable[ReadResourceContents] instead." on every read under 1.28.1. Works today, but the handler will break at some future mcp major — a one-line ReadResourceContents(uri=..., mimeType="application/json", text=...) return keeps this PR from needing a sequel.
note — Smithery removal
Correct call; also worth deleting the now-orphaned smithery.yaml from the repo in a follow-up so nobody mistakes it for a live distribution channel.
Verdict: green on the fix itself; resolve the pydantic/3.14 install conflict (even just the explicit Docker base pin) before merge.
Smithery shut down its hosted services on 31 Oct 2026.
|
post-merge verify-fixes audit (merged 2026-11-09, merge Re-checked both bot reviews' findings against the merge commit:
Two ameliorations verified: the Dockerfile is a Version surfaces still disagree ( Suggested one-line follow-up: |
Problem
mcp==1.6.0has 5 high advisories: GHSA-3qhf-m339-9g5v, GHSA-9h52-p55h-vw2f, GHSA-j975-95f5-7wqh, GHSA-jpw9-pfvf-9f58 and GHSA-vj7q-gjh5-988w.resources/readcall fails. The SDK passesurias a pydanticAnyUrl, andserver.pycallsuri.startswith(...)on it.Fix
mcpto 1.28.1. This is the lowest version that clears the high advisories. The 4 advisories left are moderate, and they affect HTTP and client code. This server uses stdio.read_resourceconvertsuritostr.tests/test_resource.py. It readswhatweb://results/missingthrough the registered handler.smithery.yamland the Smithery entry in the README Roadmap. Smithery shut down its hosted service on 31 Oct 2026.Example
resources/readforwhatweb://results/missing:AttributeError: 'AnyUrl' object has no attribute 'startswith'{"error": "Resource not found"}Verification
python -m pytest -qon Python 3.12.16 withmcp==1.28.1: "20 passed".AttributeErrorabove.Review Notes
server.jsonstays at 1.0.1, so av1.0.1tag releases this fix throughrelease.yml.