feat(mcp): Phase 4 — harden stdio request validation#368
Open
erishforG wants to merge 1 commit into
Open
Conversation
Refs #293 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
무엇
MCP stdio JSON-RPC dispatcher의 요청 shape 검증을 보강했습니다.
왜
Refs #293.
parsec mcp serve가 잘못된 request object, id, method 타입에 대해 결정적인 JSON-RPCInvalid Request응답을 반환하도록 하여 Claude Desktop/Cursor 연동 전송 경계를 더 단단하게 만듭니다. @erishforG변경
src/mcp/mod.rs에서 dispatch 전 request object/id/method 타입 검증 추가null로 고정해 불명확한 client id echo를 피함다음 Phase 힌트
리스크
낮음. 변경 범위는
src/mcp/와tests/mcp/에 한정되며 기존 CLI/git/worktree 경로는 건드리지 않았습니다.롤백
이 PR의 단일 커밋을 revert하면 기존 stdio dispatcher 동작으로 돌아갑니다.
Test plan
cargo build --quietcargo fmt --checkcargo clippy --all-targets -- -D warningscargo test --quiet