Repository navigation
feat(mcp): add first-class artifact list tool - #4867
Conversation
Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Artifact results remain unbounded despite the repository’s explicit MCP pagination and response-size requirements.
1 open finding
What changed in this PR
Adds a typed, first-class MCP adapter for artifact listing with project-scoped context and explicit registration.
Changes:
- Adds typed artifact list schemas, dispatch, and error mapping.
- Adds hierarchy-owned MCP inventory and registration.
- Adds comprehensive adapter, protocol, and server tests.
| File | Description |
|---|---|
src/specify_cli/artifacts/mcp_list.py |
Implements the artifact-list MCP adapter. |
src/specify_cli/artifacts/_mcp.py |
Defines artifact MCP inventory and registration. |
src/specify_cli/mcp_server/server.py |
Captures launch context and registers artifact tools. |
tests/specify_cli/artifacts/test_mcp_list.py |
Tests contracts, dispatch, errors, and protocol behavior. |
tests/specify_cli/mcp_server/test_server.py |
Updates tool discovery expectations. |
tests/specify_cli/mcp_server/test_stdio.py |
Exercises the tool over real stdio. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Addressed the pagination and response-bounding review in
Validation: 259 focused tests passed; focused operation/adapter coverage is 100% (274/274 statements); collection increased from 9800 to 9842; full suite passed with 9823 passed and 19 skipped; Ruff and This review-round update was generated by GitHub Copilot (model: GPT-5.6 Sol, autonomous) on behalf of @mnriem. |
Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Addressed the second review round in
Validation: 262 focused tests passed; focused shared-operation/MCP coverage is 100% (282/282 statements); collection increased from 9800 to 9845; full suite passed with 9826 passed and 19 skipped; Ruff and This review-round update was generated by GitHub Copilot (model: GPT-5.6 Sol, autonomous) on behalf of @mnriem. |
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
7 open findings
Whenproject_directoryis relative,ArtifactListProjectErroris raised with the message “not a… · New Thespecify_artifact_listreturn annotation is incorrect: the function always returns a… · New Thespecify_artifact_listreturn annotation is incorrect: the function always returns a… · New Thespecify_artifact_listreturn annotation is incorrect: the function always returns a… · New This relies on private/internal MCP SDK attributes (server._tool_manager,tool.fn_metadata,… · New This relies on private/internal MCP SDK attributes (server._tool_manager,tool.fn_metadata,… · New This relies on private/internal MCP SDK attributes (server._tool_manager,tool.fn_metadata,… · New
2 resolved since last review
🧠 Review effort: Lite
Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Addressed the third review round in
Validation: 267 focused tests passed; focused shared-operation/MCP coverage is 100% (302/302 statements); collection increased from 9800 to 9850; full suite passed with 9831 passed and 19 skipped; Ruff and This review-round update was generated by GitHub Copilot (model: GPT-5.6 Sol, autonomous) on behalf of @mnriem. |
There was a problem hiding this comment.
🟡 Changes recommended
Error responses can exceed the wire-size budget, and the changed expected-error contract retains the old major version.
2 open findings
7 resolved since last review
This relies on private/internal MCP SDK attributes (server._tool_manager,tool.fn_metadata,… This relies on private/internal MCP SDK attributes (server._tool_manager,tool.fn_metadata,… This relies on private/internal MCP SDK attributes (server._tool_manager,tool.fn_metadata,… Thespecify_artifact_listreturn annotation is incorrect: the function always returns a… Thespecify_artifact_listreturn annotation is incorrect: the function always returns a… Thespecify_artifact_listreturn annotation is incorrect: the function always returns a… Whenproject_directoryis relative,ArtifactListProjectErroris raised with the message “not a…
🧠 Review effort: Balanced
Bump the artifact.list contract for the revised project-directory error semantics and enforce the response budget for every adapter result. Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Addressed review
Validation: 268 focused artifact/MCP/version tests passed; adapter statement coverage is 100% (156/156); collection is 9,851 versus the 9,800 baseline; the full suite passed with 9,832 passed and 19 skipped; Ruff check/format and This comment was generated by GitHub Copilot (model: GPT-5.6 Sol, autonomous) on behalf of @mnriem. |



Summary
specify_artifact_listas a first-class typed MCP adapter that dispatches directly to the sharedartifact.listoperationinvalid_project_directoryerror for relative pathsartifact.listcontract v2limit/cursorpagination with explicitnext_cursor/truncatedmetadata and discovery guidance for traversing every pageAnnotated[CallToolResult, ArtifactListToolResult]return contract so runtime typing and the advertised structured output schema remain accurateCallToolResult, including expected and internal failures, against the actual duplicated MCP representation plus conservative JSON-RPC envelope space; oversized results use a prevalidated retryable fallback that cannot echo oversized detailsartifact.infoandartifact.lookupexplicitly deferred until they have shared typed operationsspecify_versionbehavior, and the CLI's complete unpaginated defaultValidation
.venv/bin/python -m pytest tests/specify_cli/artifacts tests/specify_cli/mcp_server tests/specify_cli/test_mcp_version.py tests/specify_cli/test_operation_version.py tests/specify_cli/test_command_version.py -q— 268 passed.venv/bin/python -m pytest tests/specify_cli/artifacts/test_mcp_list.py --cov=specify_cli.artifacts.mcp_list --cov-report=term-missing -q— 40 passed; 100.00% adapter statement coverage (156/156).venv/bin/python -m pytest --collect-only -q— 9851 collected, up from the 9800 baselineLC_ALL=en_US.UTF-8 .venv/bin/python -m pytest -q— 9832 passed, 19 skipped, 62 warningsruff 0.16.9 check ...— passed for all touched Python filesruff 0.16.9 format --check ...— passed for all touched Python filesgit diff --check— passedRepository branch coverage is not enabled; focused statement coverage for the MCP adapter is 100%.
AI disclosure
This pull request was authored by GitHub Copilot (model: GPT-5.6 Sol, autonomous) on behalf of @mnriem.