Thank you for contributing! This guide covers the OpenROAD MCP server.
Reviews are prioritized in this order:
Code must execute safely and securely.
- Whitelist integrity: Ensure any new Tcl commands are safely handled and do not bypass the command whitelist (
docs/SECURITY.md). - Path traversal: Avoid any possibility of reading outside
ORFS_FLOW_PATHfor report images. - Session management: Ensure sessions properly clean up resources (PTYs) and don't leak memory on shutdown.
The server must adhere strictly to the Model Context Protocol.
- Golden Fixtures: Any change to tool responses or inputs must be verified using
make golden. The CI asserts no fixture drift to prevent breaking the wire contract. - Tool schemas must accurately describe parameters so AI agents know how to call them.
Every code change should have accompanying tests.
- Unit tests for stateless logic.
- Integration tests for changes involving the OpenROAD subprocess or PTYs.
- Run
npm run test:allto verify before PR submission.
We enforce standard formatting and types.
- Types must strictly define the domain. Avoid
any. - Keep the
OpenROADManagerdecoupled from MCP transports. - Run
npm run typecheckandnpm run lintbefore committing.
Requirements:
- Node.js 22+
- npm (bundled with Node)
- OpenROAD on your
PATHfor integration tests
Getting Started:
git clone https://github.com/The-OpenROAD-Project/openroad-mcp.git
cd openroad-mcp/typescript
npm install
npm run buildRun these individually during development and together before opening a PR:
npm run test # Unit tests (fast, no OpenROAD required)
npm run test:integration # Integration tests
npm run test:performance # Performance / memory benchmarks
npm run test:all # Run everything(test:integration runs two suites: generic-PTY tests that need no OpenROAD install,
and an OpenROAD-REPL suite that self-skips — reports skipped, not failed — when
openroad isn't on PATH. Only the latter actually requires OpenROAD.)
(Tests use vitest. Configuration is in typescript/vitest.config.ts.)
Use a short descriptive prefix:
feat/for new featuresfix/for bug fixesdocs/for documentationci/for CI changeschore/for maintenance
Follow the Conventional Commits convention. The release changelog generator categorizes commits by prefix:
feat(...)→ Addedfix(...)→ Fixeddocs(...),ci(...),chore(...),build(...),test(...)→ Changed
Example: fix(whitelist): handle backslash-escaped verbs in compound statements
-
npm run typecheckandnpm run lintpass. -
npm run test:allpasses. -
make goldenis run andgit diffis clean (no unexpected fixture drift). - New tools or schema changes are reflected in
docs/API.md. - Security-relevant changes are reflected in
docs/SECURITY.md.
See ARCHITECTURE.md for a full module map. Key directories under typescript/src/:
config/— CLI flags, settings, command whitelistcore/—OpenROADManager, result modelsinteractive/— Session management, PTY handler, circular buffertools/— MCP tool implementationsutils/— ANSI decoding, path security, logging, cleanup
When reviewing OpenROAD MCP pull requests, follow the priority order above. Focus on correctness, security, and protocol adherence.
- Check Whitelist Integrity: Scrutinize changes to the Tcl execution pathway. Look for command injection or bypass vulnerabilities.
- Check Wire Contract: Ensure
make goldendiffs are intentional. If a tool schema changes, ensure it improves agent comprehension. - Resource Leaks: Look closely at PTY spawning, buffer allocation, and session cleanup.
- Ask Probing Questions: "Does this accurately reflect the MCP spec?", "Will this strand PTY processes on termination?"
- Be Concise: Provide one-sentence feedback where possible. Avoid stylistic nitpicks that
eslintorprettierhandle automatically. - Don't generate summaries of the PR unless asked.
BSD 3-Clause. See LICENSE.