chore: enforce MCP server coding standards in CI#386
Closed
cursor[bot] wants to merge 3 commits into
Closed
Conversation
- 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>
|
|
7 tasks
Collaborator
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.
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— runstests/coding-standards/and is wired into CI afterpnpm test.tests/coding-standards/architecture.test.ts— 17 automated checks covering:harness_list…harness_schema); no newregisterTool()calls orharness-*.tsfilesHarnessClient/MCP SDK/Registry imports;ToolsetDefinitionexports)ALL_TOOLSET_NAMES↔ToolsetNameunion syncconsole.log()insrc/; no rawfetch()in tools/toolsetsscope,identifierFieldsarray,operationPolicyon every endpoint/execute actionHarnessClientinstantiated only insrc/index.tscreate/update/delete/execute) declareconfirmand useconfirmViaElicitationerrorResult+toMcpError; Zod params expose.describe(); imports fromzod/v4responseExtractorfunctions (new ones must go inextractors.ts)Verification
All 2113 tests pass locally.