Skip to content

Enforce coding standards: Zod schema descriptions and architecture guardrails#408

Closed
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/mcp-server-coding-standards-801b
Closed

Enforce coding standards: Zod schema descriptions and architecture guardrails#408
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/mcp-server-coding-standards-801b

Conversation

@cursor

@cursor cursor Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Strengthens automated enforcement of the registry-driven MCP architecture documented in docs/coding-standards.md.

Already in place (PR #398 base)

  • Fixed Zod 4 chaining order across tool handlers (.describe() after .optional() / .default())
  • Architecture guardrails in tests/coding-standards/architecture.test.ts (fixed 11 MCP tools, toolset purity, singleton client, no console.log, no raw fetch in handlers/toolsets)
  • Registry structural validation (scope, identifierFields, operationPolicy, response extractors)
  • CI runs pnpm standards:check on every PR

Added in this branch

  • tests/coding-standards/zod-input-schemas.test.ts: Registers all 11 consolidated MCP tools and asserts every inputSchema field exposes a non-empty description — catches Zod 4 description-stripping regressions across the full tool surface (not just harness_execute)
  • Zod v4 import guardrail: src/ must use import * as z from "zod/v4", never bare "zod"

Verification

pnpm build && pnpm typecheck && pnpm test && pnpm standards:check

All checks pass (2133 tests).

Open in Web View Automation 

cursoragent and others added 3 commits June 24, 2026 11:08
Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
…ails

- Fix Zod 4 describe chaining in 7 tool handlers so MCP clients receive
  field descriptions (describe must follow optional/default)
- Add architecture tests for Zod chain order and HarnessClient singleton
- Include structural-validation in pnpm standards:check
- Tighten identifierFields rule for body-based get operations
- Update docs/coding-standards.md (confirm param, Zod 4 ordering, exceptions)

Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
…ools

Add zod-input-schemas.test.ts to verify every registered inputSchema field
exposes a non-empty description (Zod 4 + MCP SDK contract). Also add a
guardrail that src/ never imports bare "zod" — only zod/v4.

Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@thisrohangupta

Copy link
Copy Markdown
Collaborator

Closing as duplicate: overlaps with merged coding-standards work (#447, #398, #391). Reopen from a fresh branch if additional coverage is still needed.

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.

3 participants