feat(mcp): select library media and follow indexing progress in the MCP App - #152
Conversation
…CP App The MCP App covered uploading and inspecting evidence. Two items from the issue's first useful version were missing: selecting a video that is already registered, and following indexing progress. Attach the existing app template to list_media and get_job_status, and add the two matching views to the widget. list_media pages through the library and records the chosen media in the model context; get_job_status renders stage, message and step counts, and re-polls itself using the job's own poll_after_seconds until the job is terminal. No new tools and no separate application backend: both views drive tools that already exist, and the reused media and job lifecycle stays the source of truth. Closes grayhatdevelopers#73.
|
Hey @Haseeb-1698, |
|
Hi @SaadBazaz — both are done: the repo is starred, and this PR comes from my fork ( For context on the human question: I came to VidXP through the FAST-NUCES Islamabad Career Services invitation, and I commented on #73 first to check the direction before writing anything. Happy to answer anything about the change — why I flagged one limit in the PR body and it still stands: I have not run the widget inside a real MCP host, so the two new views are covered by unit tests, lint and JS syntax only, not against a live |
Related issue
Closes #73.
Summary
The MCP App already covered two of the four items in the issue's "first useful version": uploading (
create_media_upload) and inspecting evidence boards, keyframes and clips (present_job_evidence). This adds the other two — selecting a video that is already registered, and following indexing progress.Both are driven by tools that already exist, so there is no new tool and no separate application backend:
list_medianow carries the app template. The widget lists registered videos with state, duration, size and container, pages throughnext_cursor, and on selection writesselectedMediaIdviaui/update-model-contextandsetWidgetState, then confirms withget_media.get_job_statusnow carries it too. The widget rendersstage,messageandcurrent/totalwith a progress bar, offers a manual refresh, and re-polls itself using the job's ownpoll_after_secondswhileterminalis false, clearing its timer on every re-render.I used
get_job_statusrather thanget_jobbecause its own description recommends it for active work andJobSummaryis the compact record.Affected interfaces: two read-only tools gain
_metaonly; no signatures, arguments or return types change. The widget additions are new render paths dispatched after the existinguploadandevidencebranches, so current results render exactly as before. No compatibility or migration impact.Validation
Run on linux/amd64, Python 3.12, at
24b916a, afteruv sync --all-extras:ruff check .(0.16.6, whole repo)uv run --no-sync pytest -q tests/test_mcp.pyPYTHONPATH=. uv run --no-sync pytest -q(full suite)node --checkon the widget's extracted<script>The 7 failures are
chromadbRuntimeErrors fromchromadb/config.py:375intest_benchmarks.py,test_local_snapshots.pyandtest_storage_integration.py. They reproduce identically with this branch's two files stashed (7 failed, 32 passed on the clean tree), so they are pre-existing on this machine and unrelated to the change. The full suite also needsPYTHONPATH=.here or five packaging modules fail to importutils; that is likewise unchanged by this branch.Not exercised: I have not run the widget inside a real MCP host, so the new views are verified by unit tests, lint and JavaScript syntax only — not against an actual host's
ui/*message flow, and not against a live indexing job. Please treat the rendering as unproven at that boundary.I opened this rather than waiting on my comment in #73 so there is something concrete to react to. Happy to rework the scope, split it into library-selection and progress separately, or drop it if you have a different direction in mind.