AI agent가 로컬 의존성 그래프를 쿼리하여 코드 변경이 라우트, 호출, 테이블 및 설정에 미치는 영향을 식별할 수 있게 합니다.
다른 이름 cyberchronos00/code-graph, cg-code-graph
- 스타
- 4
- Tools
- —
- 다운로드, 30일
- 354
- 최신 버전
- 0.23.14
- 마지막 커밋
- 2026년 11월 12일
- 라이선스
- MIT
code-graph MCP란?
code-graph은(는) MCP server입니다. AI agent가 로컬 의존성 그래프를 쿼리하여 코드 변경이 라우트, 호출, 테이블 및 설정에 미치는 영향을 식별할 수 있게 합니다.
프로젝트 README에서 생성된 요약
code-graph MCP server 정보
code-graph는 개발자와 AI agent가 코드 영향을 분석할 수 있도록 설계된 로컬 방식의 결정론적 의존성 그래프를 제공합니다. 저장소를 인덱싱하여 라우트, 함수 호출, 데이터베이스 테이블 및 설정 키 사이의 관계를 매핑합니다. 이 도구를 사용하면 특정 변경 사항이 시스템의 다양한 부분에 정확히 어떤 영향을 미치는지 확인할 수 있으며, 그래프에서 발견된 모든 연결에 대해 파일 및 줄 번호 근거를 제공합니다.
사용자는 CLI를 통해 시스템과 상호작용하거나 MCP server를 통해 AI agent를 연결할 수 있습니다. 이 server는 Cursor, Claude 또는 VS Code와 같은 클라이언트에 등록할 수 있습니다. Python, TypeScript, PHP, Dart, Kotlin, Java, Swift, Rust를 포함한 다양한 언어를 지원합니다. 코드를 해석하기 위해 LLM에 의존하는 많은 도구와 달리, 이 server는 정확하거나 휴리스틱한 분석을 사용하여 의존성 데이터의 정확성과 재현성을 보장합니다.
활용 사례
- 1보안 취약점 감사인바운드 및 아웃바운드 공격 표면을 나열하여 하드코딩된 자격 증명이나 보호되지 않은 핸들러와 같은 문제를 찾습니다.
- 2라우트 보안 검증쓰기 작업을 수행하지만 인증 가드가 없는 라우트를 식별합니다.
프로젝트의 README를 바탕으로 작성되었습니다. 모든 활용 사례는 해당 내용의 인용문과 대조하여 확인합니다.
code-graph MCP 설치 방법
형식 확인: 2026년 11월 10일Claude Code에 code-graph MCP 설치
$ claude mcp add code-graph -- uvx cg-code-graphCursor에 code-graph MCP 설치
~/.cursor/mcp.json
{
"mcpServers": {
"code-graph": {
"command": "uvx",
"args": [
"cg-code-graph"
]
}
}
}VS Code에 code-graph MCP 설치
.vscode/mcp.json
{
"servers": {
"code-graph": {
"type": "stdio",
"command": "uvx",
"args": [
"cg-code-graph"
]
}
}
}Claude Desktop에 code-graph MCP 설치
claude_desktop_config.json
{
"mcpServers": {
"code-graph": {
"command": "uvx",
"args": [
"cg-code-graph"
]
}
}
}Codex에 code-graph MCP 설치
~/.codex/config.toml
[mcp_servers.code-graph] command = "uvx" args = ["cg-code-graph"]
Gemini CLI에 code-graph MCP 설치
~/.gemini/settings.json
{
"mcpServers": {
"code-graph": {
"command": "uvx",
"args": [
"cg-code-graph"
]
}
}
}자동 검사
2026년 11월 12일에 실행됨전체 보고서 →자동 검사를 통과했습니다. 이는 보안 감사가 아닙니다. 코드를 직접 읽고 서버에 필요한 최소한의 권한만 부여하십시오. 검사 방식
- 소스 저장소 연결 및 접근 가능통과
- 오픈 소스 라이선스 (OSI)통과
- 최근 1년 내 커밋 또는 릴리스통과
- 패키지 이름이 인기 패키지와 유사하지 않음통과
- 원격 엔드포인트가 HTTPS 사용검사되지 않음
- 파괴적인 도구에 라벨 표시됨검사되지 않음
- 모델에 대한 숨겨진 지침 없음통과
- 패키지와 의존성에 심각한 보안 권고 없음통과
README
GitHub에서 보기code-graph
See everything a change affects before you make it: a local, deterministic dependency graph of routes, calls, tables and config, with file:line evidence for every hop.
For you and your AI agent (CLI + MCP). No LLM in the graph.
Docs · Quick start · CLI · MCP · Changelog
Quick start
pipx install cg-code-graph # or: uv tool install cg-code-graph
cg index . --db out/graph.db # prints starter queries for your repo
cg install --host cursor # or claude, codex, vscode, …: registers the MCP server and a "use cg first" agent rule
cg reaches table:orders --db out/graph.db # any table, connection or config key
Try it on a bundled sample, link a frontend to a backend, or connect an agent over MCP: Quick start guide. Other install options (install.sh, Windows, exact-mode toolchains): Install.
cg reaches table:store_books on the bundled Django sample:
dependents: 18 nodes (code: 6, entry points: 9, other: 3)
== RUNTIME (reached from http_route / ... / queue_job / listener): 5 functions/methods
catalog.api.create_book depth=1 conf=resolved http_route(1)
path: function:catalog.api.create_book
-WRITES_TABLE[resolved @ catalog/api.py:27]-> table:store_books
catalog.signals.review_saved depth=3 conf=resolved listener(1)
path: function:catalog.signals.review_saved
-DISPATCHES[exact @ catalog/signals.py:12]-> job:catalog.tasks.recompute_rating
-HANDLED_BY[exact @ catalog/tasks.py:13]-> function:catalog.tasks.recompute_rating
-READS_TABLE[resolved @ catalog/tasks.py:14]-> table:store_books
Supported languages
| Language | Frameworks and facts | Calls | Docs |
|---|---|---|---|
| Django (+ DRF, django-ninja), FastAPI / Starlette, Flask, Celery | exact (stdlib ast) |
Python | |
| Nuxt / Vue, NestJS, Next.js, Astro, Express, Fastify, Koa, Hono, Elysia, React Router / Remix | exact (TypeScript compiler API) | TS frameworks | |
| Laravel (routes, route attributes, middleware, queues, broadcasting, outbound HTTP) | exact (nikic/php-parser; needs PHP 8.2+) | PHP | |
| Flutter | exact (Dart analyzer; needs the Dart SDK) | Platforms | |
| Android, Kotlin Multiplatform, Spring | heuristic; exact with scip-java (opt-in) | Kotlin | |
| Spring (routes, guards, beans, tables, clients) | heuristic; exact with scip-java (opt-in) | Java | |
| iOS / SwiftPM | heuristic; exact with the Swift index store (opt-in) | Swift | |
crates / modules, entry points, FFI, #[cfg] / #if gates |
heuristic; exact with rust-analyzer / scip-clang | Rust, C and C++ |
Go and others: import a SCIP index with cg index --scip FILE. Run cg doctor to see exact / heuristic per language on your machine.
What you get
reaches,impact,path: every caller, route, job and page that reaches a table, config key or method.cg affected --base main: the tests and entry points a change reaches (--quietfeeds your test runner).- Across repos:
cg linkmatches client HTTP calls (frontends and Laravel / Guzzle backends) to server routes, and checks request keys (Laravel FormRequest, Elysia schemas, Nuxt / TypeScript bodies). - Route guards:
cg routes --writes --unguardedlists routes that write with no auth guard. Laravel checks inside the action count as inline guards unless--strict. - Security views:
cg surfacelists the inbound / outbound attack surface and findings (hardcoded credentials, plaintext protocols, unverified webhooks, unguarded handlers, listeners on all interfaces, disabled TLS / SSH verification, plaintext gRPC, exposed IPC, outbound URLs built from request input) as text, JSON or SARIF, with--fail-onfor CI. - MCP server (
cg-mcp) so agents query the graph instead of grepping. One server can serve many graphs (graphsplus an optionalgraphargument); a single--dbstays one graph. See MCP. - Visual view (
cg serve) and plan checks (cg plan check) for planned changes.
Docs
Install · Quick start · CLI · MCP · Configuration · Architecture · Limitations
Changelog · Contributing · Security · MIT License
More recordings: docs/media.
code-graph MCP 질문
code-graph MCP를 Claude Code에 추가하려면 어떻게 하나요?
터미널에서 claude mcp add code-graph -- uvx cg-code-graph를 실행합니다. 모든 프로젝트에서 사용할 수 있게 하려면 --scope user를 추가합니다.
code-graph MCP를 Cursor에 추가하려면 어떻게 하나요?
~/.cursor/mcp.json를 열고 mcpServers 아래에 서버를 추가합니다. 위 설치 섹션에 표시된 Cursor 구성을 사용합니다.
그래프를 구축하는 데 LLM을 사용하나요?
아니요, 의존성 그래프는 LLM을 사용하지 않는 로컬 방식이며 결정론적입니다.
보안 감사에 도움이 될까요?
네, 인바운드 및 아웃바운드 공격 표면과 하드코딩된 자격 증명 또는 보호되지 않은 핸들러와 같은 탐지 사항을 나열할 수 있습니다.

