Skip to content

feat: add automated coding standards enforcement#388

Draft
cursor[bot] wants to merge 12 commits into
mainfrom
cursor/mcp-server-coding-standards-dda5
Draft

feat: add automated coding standards enforcement#388
cursor[bot] wants to merge 12 commits into
mainfrom
cursor/mcp-server-coding-standards-dda5

Conversation

@cursor

@cursor cursor Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

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

Changes

  • scripts/check-standards.js — CI script that blocks architectural anti-patterns:

    • No console.log() in src/
    • registerTool() only in the 11 consolidated harness-*.ts handlers
    • No unexpected files under src/tools/
    • fetch() only in allowlisted paths (HarnessClient, log-resolver, webhooks, entity-schema)
    • HarnessClient singleton in src/index.ts only
    • Toolsets must not import HarnessClient, McpServer, or Registry
    • Toolsets must not use console.*
    • ToolsetName union ↔ toolset files ↔ ALL_TOOLSETS stay in sync
  • tests/coding-standards.test.ts — Vitest mirror of key checks plus integration with the script

  • pnpm standards:check — New npm script; wired into CI workflow

  • Fixes for existing violations:

    • ccm.ts / sto.ts: remove HarnessClient imports; use HarnessClientInterface via PreflightContext
    • idp.ts: replace console.error with createLogger
    • types.ts: extend HarnessClientInterface with request() and getCurrentUserId(); add knowledge-graph and semantic-layer to ToolsetName

Verification

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

All 2118 tests pass.

Open in Web View Automation 

cursoragent and others added 12 commits June 11, 2026 11:09
Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
Add focused unit tests for buildBodyNormalized wrapped-body identifier
injection and conflict detection, plus harness-client non-FME header
casing and connector update success path regression coverage for PR #328.

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

Add body-normalizer unit tests for unwrapKey injection (service, environment)
and flat-body override updates. Add harness_update integration tests for
service identifier injection and environment conflict rejection. Assert
connector create never auto-injects connector_id from params.

Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
Add scripts/check-standards.js and tests/coding-standards.test.ts to enforce
the registry-driven architecture rules documented in docs/coding-standards.md.

Fix existing violations:
- Remove HarnessClient imports from ccm and sto toolsets; extend
  HarnessClientInterface with request/getCurrentUserId for preflight hooks
- Replace console.error with createLogger in idp toolset
- Add knowledge-graph and semantic-layer to ToolsetName union

Wire pnpm standards:check into CI and CONTRIBUTING.md.

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.

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.

2 participants