Menjaga batasan arsitektur dan menyediakan konteks proyek bagi AI coding agent dalam codebase JavaScript dan TypeScript.
Juga dikenal sebagai codapult/codapult-guard, codapult-guard, @codapult/guard
- Stars
- 4
- Tools
- —
- Unduhan, 30 hari
- 3.407
- Versi terbaru
- 0.14.1
- Commit terakhir
- 10 Nov 2026
- Lisensi
- MIT
Apa itu Guard MCP?
Guard adalah MCP server. Menjaga batasan arsitektur dan menyediakan konteks proyek bagi AI coding agent dalam codebase JavaScript dan TypeScript.
Ringkasan dibuat dari README proyek
Tentang Guard MCP server
Guard memungkinkan tim pengembang untuk menjaga integritas arsitektur dalam codebase JavaScript dan TypeScript. Tool ini memetakan struktur proyek spesifik Anda untuk mengidentifikasi dependensi dan batasan, sehingga Anda dapat menyetujui custom rules yang mencegah import ilegal atau regresi struktural. Berbeda dengan type checker standar, Guard memahami kebutuhan spesifik proyek, seperti menjaga komponen client agar tetap terpisah dari modul persistensi.
Developer dapat menggunakan tool ini secara lokal atau di dalam lingkungan CI seperti GitHub menggunakan preset untuk pull request atau merge queues. MCP server beroperasi melalui local stdio yang dikelola host, yang berarti tidak memerlukan network listener atau autentikasi tingkat aplikasi. Guard bekerja berdampingan dengan tool yang sudah ada seperti ESLint, Biome, atau TypeScript, bukan menggantikannya. Untuk integrasi dengan AI agent, Anda dapat menggunakan command install-agent untuk menyediakan konteks yang diperlukan untuk verifikasi.
Dengan menyediakan hasil CLI, JSON, dan SARIF yang deterministik, Guard memastikan bahwa AI coding agent menerima konteks arsitektur dan temuan verifikasi yang sama dengan developer manusia. Hal ini membantu mencegah agent melakukan perubahan yang melanggar kontrak proyek yang telah Anda tetapkan.
Apa yang bisa Anda lakukan dengannya
- 1Mencegah regresi arsitekturMinta AI untuk memeriksa apakah ada import baru yang melanggar batasan proyek yang telah ditetapkan.
- 2Memberikan konteks arsitektur ke agentBerikan struktur proyek dan rules yang telah disetujui kepada AI agent agar ia mengikuti design pattern spesifik Anda.
- 3Otomatisasi review pull requestSiapkan pengecekan otomatis untuk memastikan setiap pull request mematuhi kontrak arsitektur Anda.
- 4Menganalisis dampak perubahanGunakan tool ini untuk memahami bagaimana perubahan kode memengaruhi struktur proyek yang ada.
Ditulis berdasarkan README proyek. Setiap use case diperiksa terhadap kutipan dari README tersebut.
Cara menginstal Guard MCP
Format diverifikasi 10 Nov 2026Tambahkan ke CursorTambahkan ke GooseInstal Guard MCP di Claude Code
$ claude mcp add codapult-guard -- npx -y @codapult/guardInstal Guard MCP di Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"codapult-guard": {
"command": "npx",
"args": [
"-y",
"@codapult/guard"
]
}
}
}Instal Guard MCP di VS Code
.vscode/mcp.json
{
"servers": {
"codapult-guard": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@codapult/guard"
]
}
}
}Instal Guard MCP di VS Code CLI
$ code --add-mcp '{"name":"codapult-guard","type":"stdio","command":"npx","args":["-y","@codapult/guard"]}'Instal Guard MCP di Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"codapult-guard": {
"command": "npx",
"args": [
"-y",
"@codapult/guard"
]
}
}
}Instal Guard MCP di Codex
$ codex mcp add codapult-guard -- npx -y @codapult/guardInstal Guard MCP di Codex config.toml
~/.codex/config.toml
[mcp_servers.codapult-guard] command = "npx" args = ["-y", "@codapult/guard"]
Instal Guard MCP di Gemini CLI
$ gemini mcp add -s user codapult-guard npx -- -y @codapult/guardInstal Guard MCP di Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"codapult-guard": {
"command": "npx",
"args": [
"-y",
"@codapult/guard"
]
}
}
}Pengecekan otomatis
Berjalan 14 Nov 2026Laporan lengkap →Lolos checks otomatis kami. Ini bukan audit keamanan: baca kodenya dan berikan server akses paling terbatas yang dibutuhkannya. Cara kerja checks
- Source repository terhubung dan dapat dijangkaucodapult/codapult-guard is public and reachablegithub.com/codapult/codapult-guard ↗Lolos
- Nama paket mencantumkan repositori ini sebagai sumbernya@codapult/guard names codapult/codapult-guard as sourcenpmjs.com/package/@codapult/guard ↗Lolos
- Provenance build (atestasi Sigstore)Sigstore attestation for @codapult/guardnpmjs.com/package/@codapult/guard/v/0.14.1#provenance ↗Lolos
- Lisensi open source (OSI)MITspdx.org/licenses/MIT.html ↗Lolos
- Ada commit atau release dalam satu tahun terakhirLast commit or release 2026-11-10github.com/codapult/codapult-guard ↗Lolos
- OpenSSF ScorecardTidak diperiksa
- Nama package tidak mirip dengan package populerNo popular package one edit away from @codapult/guardLolos
- Tidak ada advisory kritis pada paket atau dependensinya115 resolved dependencies checked; no critical advisoryosv.dev ↗Lolos
- Tidak ada instruksi tersembunyi untuk model0 tool descriptions and the README read; no override phrases, credential paths or hidden charactersLolos
- Tools yang bersifat destruktif telah diberi labelTidak diperiksa
- Endpoint remote merespons handshake MCPTidak diperiksa
README
Lihat di GitHub@codapult/guard
Architecture guardrails for AI-assisted development
Codapult Guard helps teams preserve the architecture that makes their project work as it changes. It maps a JavaScript or TypeScript codebase, lets the team approve project-specific boundaries, and checks future changes locally and in CI. AI agents can use the same project context and verification results as developers.
Catch project-specific regressions
A type checker can confirm that code is valid TypeScript. It cannot know that this project requires client components to stay away from persistence modules. Once the team approves that boundary, Guard can detect a violating import in changed files and show which rule was triggered.
Project boundary: Client → Server Action → Service → Repository → Database
Possible regression: Client ─────────────────────────────────────→ Database
Guard discovers the architecture in the repository; it does not prescribe one universal structure or activate proposed rules without approval.
Get started
Requirements: Node.js >=20.19 and a JavaScript or TypeScript project.
# pnpm
pnpm add -D @codapult/guard
pnpm exec codapult-guard init
# npm
npm install --save-dev @codapult/guard
npx codapult-guard init
Review the generated project model, proposed rules, contracts, and baseline under
.codapult/guard/ before relying on the results. Then run Guard's architecture checks:
pnpm exec codapult-guard verify --no-project-checks --tools off
verify can run your configured project checks and detected adapters. The flags above limit this
run to Guard's built-in checks. With npm, run npx codapult-guard verify --no-project-checks --tools off.
See the complete guide for initialization and daily workflows.
Use Guard with an AI agent
Install a managed instruction block for your agent so it knows when to load Guard context and run verification:
pnpm exec codapult-guard install-agent codex
Supported hosts and MCP setup are in the AI-agent integration guide and host integration guides.
The MCP server uses host-managed local stdio, with no network listener or application-level authentication. The host and operating system control process access and workspace permissions; see the security model.
Choose a GitHub setup
Choose a preset from the existing workflow templates and follow only the hosting steps for that level of protection. Most projects can start with standard PR checks.
| Preset | Use it when | Guide |
|---|---|---|
| PR checks | You want Guard findings and a required check on ordinary pull requests. | GitHub PR checks |
| Trusted PR verification | The Guard check must come from a protected workflow source, including for fork PRs. | Trusted PR setup |
| Merge queue | Your repository merges through a GitHub merge queue. | Merge queue setup |
If you are unsure, use PR checks first. It is useful CI feedback, but its workflow lives in the project being checked and can be changed by a pull request. Choose trusted verification when the check itself must be protected from that change.
What Guard does
- Learns project-specific structure, dependencies, boundaries, and existing findings.
- Checks approved architecture rules and contracts without imposing a universal architecture.
- Shows change impact and prepares bounded, redacted context for AI review.
- Runs configured project checks and adapters when enabled; it does not replace them.
- Produces deterministic CLI, JSON, and SARIF results for local use and CI.
Guard is local-first and does not call an LLM. The AI host owns model access, edits, and its repair loop. Guard complements TypeScript, ESLint or Biome, tests, SAST, and dependency scanners; it does not replace them.
Documentation
- GitHub setup presets — choose and configure the CI level you need.
- Complete Guard guide — commands, policy, results, security, and advanced workflows.
- AI-agent integration — managed instructions and MCP workflow.
- Host integrations — Codex, Cursor, Claude Code, Copilot, Gemini CLI, and generic MCP clients.
- Policy mutation controls — approval and protected policy behavior.
- Extensions — adapters, output formats, and integration boundaries.
For contributors
Maintainer checks and project fixture coverage are documented in the fixture guide and release guide.
More from Codapult
Starting a SaaS from scratch? Codapult is a production-ready Next.js SaaS foundation built for AI-assisted development, with modular architecture, built-in AI, MCP context, and source code under your control.
License
MIT. See LICENSE.
Pertanyaan tentang Guard MCP
Bagaimana cara menambahkan Guard MCP ke Claude Code?
Jalankan claude mcp add codapult-guard -- npx -y @codapult/guard di terminal Anda. Tambahkan --scope user agar tersedia di semua proyek.
Bagaimana cara menambahkan Guard MCP ke Cursor?
Buka ~/.cursor/mcp.json dan tambahkan server di bawah mcpServers, menggunakan config Cursor yang ditunjukkan di bagian instalasi di atas.
Bagaimana Guard mencegah regresi arsitektur?
Guard memungkinkan tim untuk menyetujui batasan spesifik proyek dan mendeteksi import yang melanggar saat sebuah rule dipicu pada file yang diubah.
Apakah Guard menggunakan LLM untuk memeriksa kode?
Tidak, Guard bersifat local-first dan tidak memanggil LLM; AI host bertanggung jawab atas akses model dan proses edit.
Apa saja persyaratan sistem untuk Guard?
Anda memerlukan Node.js versi 20.19 atau lebih tinggi dan proyek JavaScript atau TypeScript.
Bagaimana MCP server menangani autentikasi?
MCP server menggunakan local stdio yang dikelola oleh host dan tidak menggunakan network listener atau autentikasi tingkat aplikasi.