Skip to content

chore: enforce MCP server coding standards in CI#386

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

chore: enforce MCP server coding standards in CI#386
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/mcp-server-coding-standards-0255

Conversation

@cursor

@cursor cursor Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds and expands automated guardrails so the registry-driven MCP architecture stays consistent across commits.

Changes

  • docs/coding-standards.md — canonical architecture rules (11 consolidated tools, pure-data toolsets, singleton HTTP client, stderr-only logging).
  • pnpm standards:check — runs tests/coding-standards/ and is wired into CI after pnpm test.
  • tests/coding-standards/architecture.test.ts — 17 automated checks covering:
    • Fixed set of 11 MCP tool handlers (harness_listharness_schema); no new registerTool() calls or harness-*.ts files
    • Toolset purity (no HarnessClient/MCP SDK/Registry imports; ToolsetDefinition exports)
    • ALL_TOOLSET_NAMESToolsetName union sync
    • No console.log() in src/; no raw fetch() in tools/toolsets
    • Registry resources: valid scope, identifierFields array, operationPolicy on every endpoint/execute action
    • HarnessClient instantiated only in src/index.ts
    • Write tools (create/update/delete/execute) declare confirm and use confirmViaElicitation
    • Dispatch tools use errorResult + toMcpError; Zod params expose .describe(); imports from zod/v4
    • Frozen allowlist for legacy inline responseExtractor functions (new ones must go in extractors.ts)

Verification

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

All 2113 tests pass locally.

Open in Web View Automation 

cursoragent and others added 3 commits June 23, 2026 07:17
- Add docs/coding-standards.md as the canonical architecture guide
- Add tests/coding-standards/architecture.test.ts with 9 guardrail checks
- Wire pnpm standards:check into CI alongside build/test/typecheck
- Fix ToolsetName union missing knowledge-graph and semantic-layer
- Remove HarnessClient imports from sto/ccm toolsets (use narrow interfaces)

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

Add focused regression tests for recently merged production paths that lacked
contract coverage:

- cost_perspective.create preflight: settings merge, defaults, graceful
  degradation, and narrow CcmPreflightClient compatibility
- security_exemption create/approve/reject preflights: required-field
  validation, PAT-derived IDs, and ACCOUNT scope param clearing
- harness_schema nested lookup: wrapper-definition fallback and depth-cap miss

Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
Add automated guardrails for registry resource definitions (scope,
identifierFields, operationPolicy), HarnessClient singleton pattern,
write-tool confirmation params, error handling contracts, Zod v4 imports,
and a frozen allowlist for legacy inline response extractors.

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 stale: merge conflicts with main and work superseded by merged PRs (#447, #446, #449, #469, #440, #398, etc.) or duplicate agent-generated attempts. Reopen from a fresh branch if 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