프로토타입 · 미리 보기: 공식 레지스트리의 모든 서버를 담고 있으며 30분마다 동기화해요. 리뷰와 계정 기능은 다음 단계에서 열려요.
PopNx MCPAI를 쓰는 사람을 위한 MCP 서버 · 쉬운 말로 설명해요

Surgical Context MCP

제작자: erayerturk버전 0.1.0i★ –i내 컴퓨터에서 실행
레지스트리 이름io.github.erayerturk/surgical-context-mcp

설치

개요

제작자가 쓴 설명(영어 원문)

Local Tree-sitter code graph: surgical edit context for AI agents instead of full-file reads.

PopNx MCP의 세 기둥

이 세 가지는 절대 하나의 점수로 합치지 않아요. 의견, 측정, 인기는 서로 다른 것이니까요.

할 수 있는 일

이 서버는 아직 쉬운 말로 된 요약을 쓰지 못했어요. 아래는 레지스트리에서 읽어 온 사실이에요.

  • 연결 방식: 내 컴퓨터에서 실행
  • 전송 방식: stdio
  • 카테고리: 개발자 도구

설치

쓰고 있는 AI 앱을 고른 다음 설정을 복사하세요.

설치하기 전에

  • 기본 점검: 1개 중 1개 통과
  • 내 컴퓨터에서 내 사용자 계정의 권한(파일, 네트워크, 앱)으로 실행돼요.
  • 레지스트리에 입력해야 할 키가 나와 있지 않아요.

필요한 것

  • PyPIPython의 uv 설치(uvx 명령어용)

어떤 앱을 쓰세요?

위에서 앱을 고르세요. 기억해 두었다가 다음부터는 버튼에 “…에 설치”라고 표시해요.

Claude Desktop → Settings → Developer → Edit Config를 열고 claude_desktop_config.json에 이 내용을 붙여 넣으세요

{
  "mcpServers": {
    "surgical-context": {
      "command": "uvx",
      "args": [
        "surgical-context-mcp"
      ]
    }
  }
}

터미널에서 이 명령어를 실행하세요

claude mcp add surgical-context -- uvx surgical-context-mcp

Cursor에서 열기

또는 설정을 직접 복사하기

프로젝트의 .cursor/mcp.json 또는 ~/.cursor/mcp.json에 붙여 넣으세요

{
  "mcpServers": {
    "surgical-context": {
      "command": "uvx",
      "args": [
        "surgical-context-mcp"
      ]
    }
  }
}

브라우저가 앱을 열지 물어본 다음, 앱이 설정을 보여 주고 확인을 요청해요. 키 값은 비워 두니 직접 입력하세요.

VS Code에서 열기

또는 설정을 직접 복사하기

프로젝트의 .vscode/mcp.json에 붙여 넣으세요

{
  "servers": {
    "surgical-context": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "surgical-context-mcp"
      ]
    }
  }
}

브라우저가 앱을 열지 물어본 다음, 앱이 설정을 보여 주고 확인을 요청해요. 키 값은 비워 두니 직접 입력하세요.

이 서버는 내 컴퓨터에서 실행되는데, ChatGPT는 인터넷에 있는 서버에만 연결할 수 있어요. 다른 앱을 고르세요.

선택한 앱은 이 기기의 쿠키에만 저장돼요. 계정은 필요 없어요.

이 설정은 제작자의 레지스트리 정보로 만들었어요. README와 다르면 README를 따르세요.

할 수 있는 일

내 컴퓨터에서 실행돼요. 설치하면 AI 앱에 도구 목록이 나타나요.

기본 점검i

누구나 볼 수 있는 정보를 점검했고, 코드는 읽지 않았어요. 해당하지 않는 항목은 개수에서 뺐어요. · 2026년 11월 9일 점검

  • ✓ 통과

    제작자와 저장소 일치

    레지스트리 이름이 GitHub 계정 erayerturk 기준으로 확인되었고, 이 계정이 저장소를 소유하고 있어요

  • … 아직 점검 안 함

    계속 관리되고 있음

    아직 GitHub에서 이 저장소를 읽어 오지 않았어요

  • … 아직 점검 안 함

    라이선스 있음

    아직 GitHub에서 이 저장소를 읽어 오지 않았어요

  • – 해당 없음

    엔드포인트 응답

    내 컴퓨터에서 실행되는 서버라 인터넷 엔드포인트가 없어요

  • – 해당 없음

    OAuth로 로그인

    내 컴퓨터에서 실행되며, 대신 로컬 설정을 사용해요

  • … 아직 점검 안 함

    도구 설명에 숨겨진 지시 없음

    내 컴퓨터에서 실행돼요. 도구 목록은 인터넷 엔드포인트가 있는 서버에서만 읽을 수 있어요

개발자 도구 카테고리의 다른 서버와 비교i

  • 이 카테고리의 다른 서버 5575개 중 0%보다 스타가 많아요
  • 이 카테고리의 다른 서버 5575개 중 72%보다 최근에 레지스트리에 공개됐어요
  • 기본 점검 결과가 이 카테고리의 다른 서버 5575개 중 100%와 같거나 더 좋아요

레지스트리에서 이 카테고리의 활성 서버 전체와 비교했어요. 스타는 게시자가 저장소를 소유한 경우에만 세요.

자주 묻는 질문

Surgical Context MCP, 안전한가요?

해당하는 기본 점검 1개 중 1개를 통과했어요. 코드는 읽지 않았어요. 키나 토큰을 넣기 전에 서버가 어떤 권한을 요구하는지 확인하고, 꼭 필요한 권한만 있는 키를 쓰세요.

어떤 키나 코드가 필요한가요?

레지스트리에 필수 키가 나와 있지 않아요. 다만 처음 쓸 때 로그인을 요구하는 서버도 있어요.

내 컴퓨터에서 실행되나요, 클라우드에서 실행되나요?

내 컴퓨터에서 실행돼요. AI 앱이 필요할 때 실행하고, 데이터는 제작자의 서버를 거치지 않아요(서버 자체가 온라인 서비스를 호출하는 경우는 제외).

아직 관리되고 있나요?

GitHub 저장소는 마지막으로 – 변경됐고, 최신 버전(0.1.0)은 8일 전 레지스트리에 올라왔어요.

어떤 앱에서 쓸 수 있나요?

Claude Desktop, Claude Code, Cursor, VS Code처럼 MCP를 지원하는 앱에서 쓸 수 있어요. 내 컴퓨터에 Python (uv)도 있어야 해요.

대신 쓸 수 있는 건 뭐가 있나요?

같은 카테고리에는: GitHub, Desktop Commander, Cloudflare MCP

대안

같은 카테고리에서 다른 제작자가 만든 서버예요. 스타 순으로 정렬했어요.

카드 보는 법:↓ 주간 다운로드i★ GitHub 스타i세 기둥: 리뷰 · 점검 · 사용 정도i업데이트 = 최신 버전을 레지스트리에 공개한 날i

GitHub

Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.

제작자: github널리 사용됨★ 3.4만6일 전 업데이트

컴퓨터 또는 클라우드

Desktop Commander

MCP server for terminal commands, file operations, and process management

제작자: wonderwhy-er널리 사용됨↓ 71만/주★ 1만18일 전 업데이트

내 컴퓨터에서 실행

Cloudflare MCP

Cloudflare MCP servers

제작자: cloudflare널리 사용됨★ 4.4천14개월 전 업데이트

클라우드에서 실행✓ mcp.cloudflare.com

제작자의 README

README 열기

제작자의 저장소에서 쓰인 그대로 가져왔어요. PopNx MCP가 검토하거나 보증한 내용이 아니에요. HTML, 이미지, 스크립트는 제거했어요. 링크를 누르면 이 사이트를 벗어나요.

surgical-context-mcp — Surgical AST Code Context & Knowledge Graph for AI Coding Agents

Stop feeding 3,000-line files into your LLM context window.

surgical-context-mcp is a zero-LLM-cost, embedded SQLite + Tree-sitter Code Knowledge Graph and MCP Server that gives AI coding agents (Claude Code, Cursor, Windsurf, Cline, Claude Desktop) the exact surgical context they need to edit, refactor, and navigate codebases safely — cutting token consumption by 70–95% without sacrificing code quality.

Real run on this repo: editing a function in a 1,264-line file costs ~3.7k tokens instead of ~13.3k (−72%) — and you still get the skeleton, callers and helpers.

⚡ Quick Start (30 seconds)

# 1. Install (or: pipx install / pip install surgical-context-mcp)

uv tool install surgical-context-mcp

2. Register with Claude Code

claude mcp add code-graph -- code-graph serve

3. Index your project + install the token-saving guard hook

code-graph install-hooks /path/to/your/project

That's it — your agent now calls get_edit_context instead of reading whole files. Using Cursor, Windsurf, Cline or Claude Desktop? See Step 1. Also listed on the official MCP Registry as io.github.erayerturk/surgical-context-mcp.


Table of Contents

  1. Quick Start (30 seconds)
  2. Why Use surgical-context-mcp?
  3. How Much Does It Save & When Should You Use It?
  4. Supported Languages & Ecosystem Resolvers
  5. How It Works (Architecture)
  6. Installation
  7. How to Use (Step-by-Step Setup Guide)
  8. Real Output Examples
  9. MCP Tools Reference
  10. CLI Reference
  11. Recommended CLAUDE.md / .cursorrules Configuration

Why Use surgical-context-mcp?

The 3 Core Problems with AI Coding Agents Today
  1. Full-File Reads Burn Hundreds of Thousands of Tokens: When you ask an AI agent (or when it spawns subagents) to fix a bug or add a feature, its default instinct is to run Grep and then Read entire 1,500–3,000 line files into the context window. Because every subsequent tool call re-sends the entire conversation history (cache reads), a single large file read early in a session compounds into 100k–300k wasted tokens.
  2. Narrow Line-Range Reads Cause Hallucinations & Code Duplication: If you force an agent to read only lines 240–260 of a file to save tokens, the agent becomes blind to:
  • Class attributes, self.x fields, @onready / @export variables, constants, and struct / interface definitions at the top of the file.
  • Helper functions that already exist in the same file (causing the LLM to write duplicate code).
  • How callers actually pass arguments to the function (±5 lines around call sites).
  • The file's coding style (indentation, typing conventions, error handling idioms).
  1. Pure Static AST Graphs Miss Dynamic Dispatch & Scene/Template Wiring: Standard call graphs only see static foo() calls. If a function is invoked via getattr(obj, "foo") in Python, call("foo") or a .tscn signal connection in Godot, SendMessage("foo") in Unity/C#, or referenced in a .vue/.html/.proto file, a naive graph reports *"0 callers — safe to delete"*, breaking production code.
How surgical-context-mcp Solves All Three
  • `get_edit_context(symbol)` — One Call Before Any Edit: Instead of reading a 2,500-line file, the agent makes one MCP call (get_edit_context) and receives a strictly budgeted (≤ 4,000 tokens) surgical package containing:
  1. Target Function Full Body (with exact line numbers for Edit)
  2. File Skeleton (all imports, interface/struct/enum blocks, class fields, constants — without other function bodies)
  3. Used Members & Direct Callees (definitions of class fields used by the target function + full bodies of short same-file helpers ≤ 25 lines)
  4. Direct Callers (`d=1`, `±5` Line Windows) (exact call-site context without dumping 200-line caller functions)
  5. Other Function Signatures in the File (so the agent reuses existing helpers instead of duplicating them)
  6. Style Hints & Coverage Warnings (flags dynamic string calls, .tscn connections, templates, and protocol references)
  • `check_rename_or_delete(symbol)` — One Call Before Any Refactor: Checks AST callers (exact/scoped), inheritance overrides across parent/child classes, .tscn/template connections, signal emit/connect sites, and workspace-wide dynamic string references.
  • Cross-Language Contracts (`shares_contract`) — Server ↔ Client ↔ Config in One Call:
  • Protocol Opcodes (`contract::opcode::0xCC`): Automatically links hex opcode constants across languages (e.g., Go OpSGMOnline = 0xCC and GDScript/TypeScript const S_GM_ONLINE = 0xCC), so querying either constant shows both server senders and client packet handlers together.
  • Config & Schema Keys (`contract::config:: `): Automatically links Go struct json:"max_chars_per_ip" field tags, frontend/panel schema strings ('multi_guard.max_chars_per_ip'), and seed/*.json config entries ("max_chars_per_ip": 2) into a single shared contract node.
  • Data, Seed & Translation (`i18n`) Graph (`check_translations`): Indexes seed/*.json, shared/maps/*.json, locales/*.json, and .po files alongside code. Links tr("...") and noticeT(..., "n.x") calls to locale definitions and audits missing keys, accidental raw non-key literals, %d/%s/{} placeholder count mismatches, and unused locale keys.
  • Automated Test Discovery (`tests_for`) & Git Diff Blast Radius (`get_diff_impact`):
  • tests_for(symbol) identifies every test exercising a symbol and returns the exact runnable CLI command (go test ./pkg -run '^TestFoo$', godot --headless --path client -s tests/..., pytest ... -k ...).
  • get_diff_impact(base_ref="HEAD") parses git diff hunks, maps changed lines to modified AST symbols, and reports their callers, affected cross-language contracts, and runnable test commands in one call — built for code-review subagents (final-reviewer).
  • Concept Search & Engine Lifecycle Noise Suppression:
  • Indexes inline/preceding comments and docstrings (doc_comment) so searching by concept (e.g. "attack stat") finds KOAP (// attack power stat bonus).
  • Recognizes engine-invoked virtual callbacks (_ready, _draw, _process, _physics_process, _input, Awake, Update) and suppresses false text-match noise warnings when AST upstream is empty.
  • Direct Token Savings Telemetry (`get_token_savings`): Every MCP/CLI query records its returned token count vs. the raw token size of touched files in SQLite (usage_telemetry), answering *"How many tokens did code-graph save?"* with direct measurements instead of estimates.
  • Zero LLM Indexing Cost & Sub-Second Speed: Built on native C Tree-sitter grammars and embedded SQLite (WAL mode). Indexes ~600 files in `< 0.6` seconds using 0 API tokens, and automatically refreshes modified files (mtime + SHA-1) on every query.
  • Enforced via Claude Code `PreToolUse` Hook: Includes a built-in hook guard (code-graph install-hooks) that blocks unbounded `Read` calls on files `> 300` lines and returns the file's AST symbol table (Lstart-end: signature), ensuring both main agents and subagents stay on the surgical path.

How Much Does It Save & When Should You Use It?

1. Token & Cost Economics (Single-Turn vs. Multi-Turn Compounding Savings)

In agentic coding tools (Claude Code, Cursor, Cline), every tool call re-sends the entire conversation history up to that point. When an agent reads a 2,500-line file (~22,000 tokens) on Turn 2 of a 12-turn coding task, those 22,000 tokens are billed on Turn 2, Turn 3, Turn 4 ... all the way to Turn 12 (22,000 × 10 = 220,000 cumulative context tokens).

By replacing full-file reads with get_edit_context (~2,500–3,500 tokens), surgical-context-mcp prevents context bloat from compounding across turns.

Benchmark Across Common Developer Tasks

*(Measured on a 593-file multi-language repository: 2,607-line Godot client controller + Go backend + JS web dashboard)*

Developer ScenarioStandard Agent (Read + Grep)With surgical-context-mcpDirect Token Savings10-Turn Compounded Savings
1. Initial Repo Orientation ("How is this codebase structured?")~18,500 tokens (multiple ls, Glob, Read calls)`~650` tokens (GRAPH_REPORT.md / get_architecture_map)96% fewer tokens~178,000 tokens saved
2. Modifying a Function in a Large File (2,607 lines)~22,400 tokens (reads whole target file + 1 caller file)`~2,900` tokens (get_edit_context returns skeleton + body + callers)87% fewer tokens~195,000 tokens saved
3. Tracing an End-to-End Request / Event Flow (Client -> Packet -> Server Handler)~31,000 tokens (grepping strings and reading 4–6 files)`~1,200` tokens (find_flow + get_symbol_impact)96% fewer tokens~298,000 tokens saved
4. Safe Refactoring / Dead-Code Deletion ("Can I delete or rename this method?")~14,000 tokens (grepping & reading candidate files; still misses dynamic refs)`~450` tokens (check_rename_or_delete checks AST + overrides + .tscn + dynamic strings)97% fewer tokens~135,000 tokens saved
5. Multi-Subagent Parallel Execution (Spawning 2–3 subagents for backend/frontend)200,000–350,000 tokens (each subagent independently reads huge files)`35,000–60,000` tokens (PreToolUse hook blocks >300L reads in all subagents)80–85% fewer tokensPrevents rate-limits & context compaction

2. When Does surgical-context-mcp Provide the Biggest Gains?
High-Impact Scenarios (80%–97% Savings & Higher Code Accuracy)
  • Large or Monolithic Source Files (`300` to `5,000+` lines): Game controllers (main.gd, PlayerController.cs), large backend services (`s

앞부분만 보여 드려요. 나머지는 저장소에서 읽어 보세요

PopNx에게 묻기