Repository navigation
Conversation
Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The first-class tool lacks required inventory metadata, diagnostic logging, and complete contract coverage.
Review effort: Balanced
Findings: 2
Open (4)
What changed in this PR
Adds the first typed MCP tool for the shared version operation.
Changes:
- Implements typed version results and sanitized MCP errors.
- Registers the tool alongside transitional tools.
- Adds unit, in-memory, and stdio coverage.
| File | Description |
|---|---|
src/specify_cli/mcp_version.py |
Implements the typed MCP adapter. |
src/specify_cli/mcp_server/server.py |
Registers the version tool. |
tests/specify_cli/test_mcp_version.py |
Tests schemas, dispatch, and failures. |
tests/specify_cli/mcp_server/test_server.py |
Updates discovery expectations. |
tests/specify_cli/mcp_server/test_stdio.py |
Exercises the tool over stdio. |
💡 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>
Collaborator
Author
|
Addressed the review findings in
Validation:
AI disclosure: This review round was implemented and summarized with GitHub Copilot using GPT-5.6 Sol in autonomous mode; code generation, test generation, validation, and comment drafting. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Description
Adds the first first-class typed MCP tool,
specify_version, for the shared version operation introduced in #4863.The MCP adapter lives beside the CLI command hierarchy in
src/specify_cli/mcp_version.pyand dispatches directly to_operation_version.collect_version_result(). It returns the established version fields as typed structured content, maps invalid operation results and unexpected failures to sanitized MCP error results, rejects unexpected arguments, and registers through one focused root-server seam. The transitional generic list, describe, and run tools remain unchanged and available.Tests cover direct operation dispatch without the CLI adapter or subprocess worker, semantic result parity, unavailable OpenSSL, sanitized failures, strict no-argument schema behavior, discovery and registration, in-memory client wire shapes, and a real stdio initialize/list/call flow with protocol-pure stderr.
Testing
uv sync --extra test— passedLC_ALL=en_US.UTF-8 .venv/bin/python -m pytest tests/specify_cli/test_mcp_version.py tests/specify_cli/mcp_server tests/specify_cli/test_operation_version.py tests/specify_cli/test_command_version.py tests/specify_cli/test_command_mcp.py -q— 54 passed.venv/bin/python -m pytest tests/specify_cli/test_mcp_version.py tests/specify_cli/mcp_server -q --cov=specify_cli.mcp_version --cov-report=term-missing— 35 passed;mcp_version.py100% statement coverageLC_ALL=en_US.UTF-8 .venv/bin/python -m pytest -q— 9,756 passed, 19 skipped, 62 warningsuvx ruff checkanduvx ruff format --checkfor all touched Python files — passedgit diff --check— passedFull pytest collection against upstream
main: 9,764 before, 9,775 after (+11)Tested locally with
uv run specify --helpRan existing tests with
uv sync && uv run pytestTested with a sample project (if applicable)
AI Disclosure
AI disclosure: Implemented with GitHub Copilot using GPT-5.6 Sol in autonomous mode; code generation, test generation, validation, and PR drafting.