Skip to content

feat(mcp): Phase 4 — harden stdio request validation#368

Open
erishforG wants to merge 1 commit into
release/1.0from
feat/auto-mcp-stdio-validation
Open

feat(mcp): Phase 4 — harden stdio request validation#368
erishforG wants to merge 1 commit into
release/1.0from
feat/auto-mcp-stdio-validation

Conversation

@erishforG

Copy link
Copy Markdown
Owner

무엇

MCP stdio JSON-RPC dispatcher의 요청 shape 검증을 보강했습니다.

Refs #293. parsec mcp serve가 잘못된 request object, id, method 타입에 대해 결정적인 JSON-RPC Invalid Request 응답을 반환하도록 하여 Claude Desktop/Cursor 연동 전송 경계를 더 단단하게 만듭니다. @erishforG

변경

  • src/mcp/mod.rs에서 dispatch 전 request object/id/method 타입 검증 추가
  • invalid id는 응답 id를 null로 고정해 불명확한 client id echo를 피함
  • stdio smoke fixture에 invalid request/id/method error-path 케이스 추가
  • MCP unit test 3개 추가

다음 Phase 힌트

  • Content-Length framed transport adapter 또는 client-style initialize/tools/list smoke fixture 확장
  • tools/call 실제 구현 wiring 확대

리스크

낮음. 변경 범위는 src/mcp/tests/mcp/에 한정되며 기존 CLI/git/worktree 경로는 건드리지 않았습니다.

롤백

이 PR의 단일 커밋을 revert하면 기존 stdio dispatcher 동작으로 돌아갑니다.

Test plan

  • cargo build --quiet
  • cargo fmt --check
  • cargo clippy --all-targets -- -D warnings
  • cargo test --quiet

Refs #293

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@erishforG erishforG added the auto-improvement Daily auto-generated improvement PR/issue label Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-improvement Daily auto-generated improvement PR/issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant