Skip to main content
rule CX Codex

mcp-typescript — Claude Code rule: what it does, how to install

Sets boundaries for TypeScript MCP servers: sends logs to stderr, keeps input schemas strict, and guards destructive actions.

MIT ★ 1,198 updated 2026-10-23

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/rules/mcp-typescript.md
Open on GitHub

What mcp-typescript does

This rule targets the mcp/ path pattern, including TypeScript files, configuration files, and README.md. It keeps MCP tool names descriptive and enforces strict boundaries on input schemas.

Stdout is reserved for protocol messages, so all logging must go to stderr. The rule enforces loopback-only API destinations by default and demands guardrails around destructive operations.

Any code edits must pass verification with npm run mcp:typecheck and npm run mcp:build. Writing server logs directly to stdout will break the MCP JSON-RPC exchange.

What it helps with

  • prevent MCP protocol corruption caused by logging to stdout
  • enforce strict validation schemas on MCP tool inputs
  • isolate API calls to loopback interfaces by default
  • verify server builds with npm run mcp:typecheck and mcp:build

Example prompts for the agent

  • Create a new tool handler inside mcp/src/
  • Inspect logging setup in mcp/src/server.ts
  • Run TypeScript verification checks on the mcp directory

How to install mcp-typescript

Manually: put the files in place

.claude/rules/mcp-typescript.md

The paths frontmatter field limits the files

Step by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use

Questions about mcp-typescript

How do I install mcp-typescript in Claude Code?

Place the rule file at .claude/rules/mcp-typescript.md in your repository.

What does the mcp-typescript rule do?

It enforces development guidelines for MCP servers, ensuring logs go to stderr, input schemas remain bounded, and code passes typecheck and build commands.

Why does the rule restrict logging to stderr?

MCP agents communicate with tools over stdout via protocol frames. Raw logs routed to stdout corrupt protocol communication.

Source text

mcp-typescript.md · MIT
---
paths:
  - "mcp/src/**/*.ts"
  - "mcp/package.json"
  - "mcp/tsconfig.json"
  - "mcp/.env.example"
  - "mcp/README.md"
---

# MCP Server Rules

- Keep MCP tool names stable and descriptive.
- Keep destructive operations behind explicit guardrails.
- Route all logs to stderr only; never write protocol logs to stdout.
- Keep tool input schemas strict and bounded.
- Preserve loopback-only API target enforcement unless security posture changes by request.
- Verify MCP with `npm run mcp:typecheck` and `npm run mcp:build` after code edits.

© hoangsonww · MIT · hoangsonww/Claude-Code-Agent-Monitor

Similar IDE rules

All IDE rules for Agent setup: memory, context, orchestration →
mcp-specialist coco-research mcp-specialist — a subagent for building and configuring MCP servers in Claude Code. Handles architecture design, transport layer implementation, tool and resource setup, and connection troubleshooting against the MCP 2025-06-18 spec. CX Codex ★ 328repo stars mcp-server-architect davila7 mcp-server-architect is a Claude Code subagent for planning MCP servers and building their transports and tools. It joins work on server design, implementation, and protocol compliance. CX Codex 1,649installs mcp-developer https://github.com/Jeffallan mcp-developer — a skill for building and debugging MCP servers and clients in TypeScript or Python, with tool schemas, transport setup and protocol checks in the inspector. CX Codex +1 4,600installs MCP Protocol Conformance studiomeyer-io MCP Protocol Conformance is an MCP server for Claude Code that checks protocol compliance, from JSON-RPC and tool schemas to OAuth 2.1 PKCE. Run checks before a release or when reviewing changes. CX Codex +1 typescript-security-review giuseppe-trisciuoglio typescript-security-review reviews TypeScript and Node.js codebases for OWASP Top 10 vulnerabilities, leaked secrets, and authentication bugs. Useful before production releases in Express, NestJS, or Next.js apps. CX Codex +1 4,200installs typescript-security-expert Giuseppe Trisciuoglio typescript-security-expert is a Claude Code subagent that audits TypeScript and Node.js application security. It handles vulnerability reviews, threat modeling, and DevSecOps work. CX Codex ★ 372repo stars

From the same set155

The whole set →
frontend-react frontend-react — a React frontend rule for Claude and Claude that keeps UI edits small: explicit prop types, existing state patterns, routes left alone. CX Codex +1 ★ 1,198repo stars platform-admin platform-admin manages settings, hooks, data imports, backups, and MCP for Claude Code Agent Monitor. Confirms writes before updating. CX Codex ★ 1,198repo stars frontend-reviewer The frontend-reviewer subagent reviews React UI changes for behavior regressions, state mismatches, and broken user flows. Use it after frontend edits. CX Codex ★ 1,198repo stars platform-status platform-status runs the CCAM diagnostics: hooks, config roots, dashboard version, MCP build state. Reports back without changing anything. CX Codex +1 ★ 1,198repo stars run-operator run-operator — a subagent for operating Claude Code and Codex processes through CCAM, with a parameter check before each run, message, or stop action. CX Codex ★ 1,198repo stars mcp-reviewer mcp-reviewer reviews MCP server changes: tool schemas, safety gates on destructive calls, error handling and stdio correctness. Useful before you merge work on a server. CX Codex ★ 1,198repo stars backend-node backend-node is a Claude Code rule for Node.js backend files and hook ingestion logic. It keeps API responses compatible and enforces database transaction safety. CX Codex +1 ★ 1,198repo stars report report is a Claude Code command that creates CCAM executive, cost, reliability, or workflow reports. Specify a report type and data scope in the request. CX Codex +1 ★ 1,198repo stars

Project sponsors

Companies that keep this analytics open