Skip to content

feat(mcp): select library media and follow indexing progress in the MCP App - #152

Open
Haseeb-1698 wants to merge 1 commit into
grayhatdevelopers:mainfrom
Haseeb-1698:feat/73-mcp-app-library-and-progress
Open

feat(mcp): select library media and follow indexing progress in the MCP App#152
Haseeb-1698 wants to merge 1 commit into
grayhatdevelopers:mainfrom
Haseeb-1698:feat/73-mcp-app-library-and-progress

Conversation

@Haseeb-1698

Copy link
Copy Markdown

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_media now carries the app template. The widget lists registered videos with state, duration, size and container, pages through next_cursor, and on selection writes selectedMediaId via ui/update-model-context and setWidgetState, then confirms with get_media.
  • get_job_status now carries it too. The widget renders stage, message and current/total with a progress bar, offers a manual refresh, and re-polls itself using the job's own poll_after_seconds while terminal is false, clearing its timer on every re-render.

I used get_job_status rather than get_job because its own description recommends it for active work and JobSummary is the compact record.

Affected interfaces: two read-only tools gain _meta only; no signatures, arguments or return types change. The widget additions are new render paths dispatched after the existing upload and evidence branches, so current results render exactly as before. No compatibility or migration impact.

Validation

Run on linux/amd64, Python 3.12, at 24b916a, after uv sync --all-extras:

Command Result
ruff check . (0.16.6, whole repo) All checks passed
uv run --no-sync pytest -q tests/test_mcp.py 49 passed, 1 skipped, 7 subtests passed (54.98s)
PYTHONPATH=. uv run --no-sync pytest -q (full suite) 723 passed, 7 failed, 10 skipped, 106 subtests (4m11s)
node --check on the widget's extracted <script> passed

The 7 failures are chromadb RuntimeErrors from chromadb/config.py:375 in test_benchmarks.py, test_local_snapshots.py and test_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 needs PYTHONPATH=. here or five packaging modules fail to import utils; 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.

…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.
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.

Add a portable MCP App interface

1 participant