์๋ฆฌ์ฆ: oh-my-claudecode ๋ด๋ถ ๊ตฌ์กฐ๋ถํฐ ํ๋ฌ๊ทธ์ธ ๊ฐ๋ฐ๊น์ง
์ด ์๋ฆฌ์ฆ๋ Claude Code ํ๋ฌ๊ทธ์ธ ์์คํ ์ ๋ด๋ถ ๋์์ ๋จ๊ณ๋ณ๋ก ํด๋ถํ๊ณ , ์ต์ข ์ ์ผ๋ก ๋๋ง์ ํ๋ฌ๊ทธ์ธ์ ์ง์ ๊ฐ๋ฐํ๋ ๊ฒ๊น์ง ๋๋ฌํ๋ ๊ณผ์ ์ด๋ค.
| ํธ | ๋ด์ฉ | ํต์ฌ |
|---|---|---|
| 1ํธ | Plugin Anatomy | plugin.json ํ๋๋ก ์์ํ๋ ํ๋ฌ๊ทธ์ธ ๋ผ๋ |
| 2ํธ | Hook System | ์ด๋ฒคํธ โ stdin JSON โ ์คํฌ๋ฆฝํธ โ stdout JSON |
| 3ํธ | Skill System | SKILL.md๋ก ์ํฌํ๋ก์ฐ๋ฅผ ์ ์ํ๋ ๋ฐฉ๋ฒ |
| 4ํธ | Agent System | Task tool๋ก ์์๋๋ ์ค์ ์์ ์ํ์ |
| 5ํธ (๋ณธ๋ฌธ) | MCP Tools Bridge | LSP, AST ๋ฑ ์ปค์คํ ๋๊ตฌ ์๋ฒ |
| 6ํธ | State & Lifecycle | .omc/ ์ํ ๊ด๋ฆฌ์ ๋ชจ๋ ์ง์ |
| 7ํธ | Parallel Orchestration | Ultrawork, Team, Autopilot, Ralph ํจํด |
- MCP Tools Bridge๋ Claude Code์ ๊ธฐ๋ณธ ๋๊ตฌ๋ก ๋ถ๊ฐ๋ฅํ ์์ ์ ํด๊ฒฐํ๋ ์ปค์คํ ๋๊ตฌ ์๋ฒ ์์คํ
- TypeScript ์์ค๋ฅผ esbuild๋ก ๋ฒ๋ค๋งํด
bridge/mcp-server.cjs๋ก ๋ง๋ค๊ณ ,.mcp.json์ ์๋ฒ ์ด๋ฆ"t"๋ก ๋ฑ๋กํ์ฌ ๋ชจ๋ ๋๊ตฌ๋ฅผmcp__t__๋๊ตฌ์ด๋ฆ์ผ๋ก ๋ ธ์ถํ๋ 2์ค ์๋ฒ ์ํคํ ์ฒ - LSP(IDE ๊ธฐ๋ฅ 12๊ฐ), AST(๊ตฌ์กฐ ๊ฒ์ 2๊ฐ), State(์ํ 5๊ฐ), Notepad(๋ฉ๋ชจ 6๊ฐ), Memory(์ง์ 4๊ฐ), Shared Memory(๊ณต์ 5๊ฐ), Skills(3๊ฐ), Trace(3๊ฐ), Python REPL(1๊ฐ) ๋ฑ ์ด 41๊ฐ ์ด์์ ์ ๋ฌธ ๋๊ตฌ๋ฅผ ์นดํ ๊ณ ๋ฆฌ๋ณ๋ก ๊ด๋ฆฌํ๋ ํ์ฅ ํ๋ธ
ํด๋น ๊ฐ๋ ์ด ํ์ํ ์ด์
- 4ํธ(Agent System)์์ ์์ด์ ํธ๊ฐ ์์ ์ค ํ์ ์ฒดํฌ, ์ฝ๋ ๊ตฌ์กฐ ๊ฒ์, ์ํ ์ ์ฅ, ๋ฉ๋ชจ๋ฆฌ ๊ด๋ฆฌ๊ฐ ํ์ํ๋ค๋ ๊ฒ๊น์ง ํ์ต
- Claude Code์ ๊ธฐ๋ณธ ๋๊ตฌ(Read, Write, Bash)๋ง์ผ๋ก๋ โ์ด ํ์ผ์ ํ์ ์๋ฌ๊ฐ ๋ญ์ง?โ, โ์ด ์ฌ๋ณผ์ ์ ์๋ ์ด๋์ง?โ ๊ฐ์ ์ง๋ฌธ์ ํจ์จ์ ์ผ๋ก ๋ตํ ์ ์์
- MCP Server๊ฐ IDE๊ธ ๊ธฐ๋ฅ์ ๋๊ตฌ๋ก ๋ ธ์ถํ์ฌ ์์ด์ ํธ๊ฐ ์ ๋ฐํ ์์ ์ ์ํํ ์ ์๊ฒ ๋ง๋๋ ํต์ฌ ์ธํ๋ผ
AS-IS
sequenceDiagram autonumber participant AG as Agent participant CC as Claude Code participant FS as File System AG->>CC: Bash("tsc --noEmit 2>&1") CC->>FS: tsc ํ๋ก์ธ์ค ์คํ FS-->>CC: ์์ ํ ์คํธ ์ถ๋ ฅ (์๋ฐฑ ์ค) CC-->>AG: ํ์ฑ ๋ถ๊ฐ๋ฅํ ํ ์คํธ ๋ฉ์ด๋ฆฌ Note over AG: ์๋ฌ ์์นยท์ฌ๊ฐ๋ ํ์ฑ์<br/>LLM์ด ์ง์ ํด์ผ ํจ
TO-BE
sequenceDiagram autonumber participant AG as Agent participant CC as Claude Code participant MCP as MCP Server "t" participant LSP as lsp-tools.ts AG->>CC: mcp__t__lsp_diagnostics({ file: "src/main.ts" }) CC->>MCP: JSON-RPC ์์ฒญ MCP->>LSP: lsp_diagnostics ํธ๋ค๋ฌ LSP->>LSP: Language Server ํ๋กํ ์ฝ ํธ์ถ LSP-->>MCP: ๊ตฌ์กฐํ๋ ์๋ฌ ๋ชฉ๋ก (ํ์ผ, ์ค, ์ฌ๊ฐ๋) MCP-->>CC: JSON-RPC ์๋ต CC-->>AG: ์ฆ์ ์ฌ์ฉ ๊ฐ๋ฅํ ํ์ ์๋ฌ ์ ๋ณด Note over AG: ํ์ฑ ๋ถํ์,<br/>๋ฐ๋ก ์์ ์์ ์์
2์ค ์๋ฒ ์ํคํ ์ฒ
OMC๋ ๋์ผ ๊ณ์ด์ ๋๊ตฌ๋ฅผ ๋ ๊ฐ์ง ๊ฒฝ๋ก๋ก ์ ๊ณตํ๋, ํฌํจ ๋ฒ์๊ฐ ๋ค๋ฅด๋ค.
graph TD subgraph "Pattern A: Standalone (ํ๋ฌ๊ทธ์ธ ๋ก๋ ์)" MJ[".mcp.json<br/>์๋ฒ ์ด๋ฆ: t"] -->|"node bridge/mcp-server.cjs"| SS["standalone-server.ts<br/>(raw MCP SDK)"] SS -->|"StdioServerTransport"| CC1["Claude Code"] end subgraph "Pattern B: In-process (์๋ธ์์ด์ ํธ์ฉ)" OTS["omc-tools-server.ts<br/>(Claude Agent SDK)"] -->|"createSdkMcpServer()"| SA["์๋ธ์์ด์ ํธ"] end SS -->|"zodToJsonSchema() ์๋ ๋ณํ"| TOOLS_A["7์นดํ ๊ณ ๋ฆฌ 33๊ฐ ๋๊ตฌ"] OTS -->|"tool() ํฌํผ ์๋ ๋ณํ"| TOOLS_B["10์นดํ ๊ณ ๋ฆฌ 41+ ๋๊ตฌ"]
| ๊ตฌ๋ถ | Pattern A (Standalone) | Pattern B (In-process) |
|---|---|---|
| ์ง์ ์ | bridge/mcp-server.cjs | src/mcp/omc-tools-server.ts |
| SDK | @modelcontextprotocol/sdk (Server ํด๋์ค) | Claude Agent SDK |
| ์คํค๋ง ๋ณํ | zodToJsonSchema() ์๋ ๊ตฌํ | tool() ํฌํผ๊ฐ ์๋ ์ฒ๋ฆฌ |
| ํต์ | StdioServerTransport (ํ๋ก์ธ์ค ๊ฐ) | ์ธ๋ฉ๋ชจ๋ฆฌ (๊ฐ์ ํ๋ก์ธ์ค) |
| ๋๊ตฌ ๋ฒ์ | LSP, AST, Python, State, Notepad, Memory, Trace (33๊ฐ) | ์ข์ธก ์ ๋ถ + Skills, Shared Memory, Interop (41+๊ฐ) |
| ๋นํ์ฑํ | ์ง์ ์ ํจ | parseDisabledGroups()๋ก ์นดํ
๊ณ ๋ฆฌ๋ณ ๋นํ์ฑํ |
| ์ฉ๋ | Claude Code๊ฐ ํ๋ฌ๊ทธ์ธ์ผ๋ก ์ง์ ์ฌ์ฉ | ์๋ธ์์ด์ ํธ์ allowedTools์ ํฌํจ |
Pattern A์์ Claude Code๋ .mcp.json์ ์ฝ๊ณ node bridge/mcp-server.cjs๋ฅผ ์คํํ๋ค. ์ด ํ๋ก์ธ์ค๋ StdioServerTransport๋ฅผ ํตํด JSON-RPC ๋ฉ์์ง๋ฅผ ์ฃผ๊ณ ๋ฐ์ผ๋ฉฐ, Claude Code ์
์ฅ์์ ๋ชจ๋ ๋๊ตฌ๊ฐ mcp__t__๋๊ตฌ์ด๋ฆ์ผ๋ก ๋
ธ์ถ๋๋ค.
๋๊ตฌ ๋ฑ๋ก ํจํด: tagCategory + parseDisabledGroups
๋ฑ๋ก ํ๋ฆ
graph LR subgraph "1. ๋๊ตฌ ์ ์" L["lsp-tools.ts"] --> TC["tagCategory(lspTools, 'lsp')"] A["ast-tools.ts"] --> TC2["tagCategory(astTools, 'ast')"] S["state-tools.ts"] --> TC3["tagCategory(stateTools, 'state')"] N["notepad-tools.ts"] --> TC4["...๋๋จธ์ง ์นดํ ๊ณ ๋ฆฌ"] end subgraph "2. ๋นํ์ฑํ ํํฐ" ENV["OMC_DISABLE_TOOLS=lsp,python-repl"] --> PD["parseDisabledGroups()"] PD --> FILTER["allTools.filter(t => !disabled.has(t.category))"] end TC --> AT["allTools ๋ฐฐ์ด"] TC2 --> AT TC3 --> AT TC4 --> AT AT --> FILTER FILTER --> SDK["enabledTools โ createSdkMcpServer()"]
๋นํ์ฑํ ๋งคํ
OMC_DISABLE_TOOLS=lsp,python-repl,project-memory| ํ๊ฒฝ๋ณ์ ๊ฐ | ๋นํ์ฑํ ์นดํ ๊ณ ๋ฆฌ |
|---|---|
lsp | LSP 12๊ฐ ๋๊ตฌ ์ ์ฒด |
ast | AST 2๊ฐ ๋๊ตฌ |
python ๋๋ python-repl | Python REPL 1๊ฐ |
state | State 5๊ฐ ๋๊ตฌ |
notepad | Notepad 6๊ฐ ๋๊ตฌ |
memory ๋๋ project-memory | Memory 4๊ฐ ๋๊ตฌ |
skills | Skills 3๊ฐ ๋๊ตฌ |
trace | Trace 3๊ฐ ๋๊ตฌ |
shared-memory | Shared Memory 5๊ฐ ๋๊ตฌ |
interop | Interop ๋๊ตฌ (์กฐ๊ฑด๋ถ) |
ํ์ฑ์ ์๋ฒ ์์ ์ 1ํ๋ง ์ํ. ๋ฐํ์ ์ค ๋์ ํ์ฑํ/๋นํ์ฑํ๋ ๋ถ๊ฐํ๋ฉฐ ์๋ฒ ์ฌ์์ ํ์.
์นดํ ๊ณ ๋ฆฌ๋ณ ๋๊ตฌ ์์ธ
LSP Tools (12๊ฐ) โ IDE๊ธ ์ฝ๋ ๋ถ์
LSP (Language Server Protocol)์ ํตํด ์ค์ ์ธ์ด ์๋ฒ(TypeScript, Python ๋ฑ)์ ์ง์ํ์ฌ ์ ํํ ํ์ ์ ๋ณด์ ์ฝ๋ ๋ถ์ ๊ฒฐ๊ณผ๋ฅผ ๋ฐํํ๋ค.
๋ชจ๋ LSP ๋๊ตฌ๋ withLspClient(filePath, operationName, fn) ํฌํผ๋ฅผ ์ฌ์ฉํ๋ค:
- ํ์ผ ํ์ฅ์๋ก ์ ํฉํ Language Server ํ์
lspClientManager.runWithClientLease()๋ก LSP ํด๋ผ์ด์ธํธ ํ๋/์์ฑ- ์๋ฒ ๋ฏธ์ค์น ์ ์ค์น ์๋ด์ ํจ๊ป ์๋ฌ ๋ฐํ
| ๋๊ตฌ | ํ๋ผ๋ฏธํฐ | ์ญํ |
|---|---|---|
lsp_hover | file, line, character | ์ฌ๋ณผ์ ํ์ ์ ๋ณด/๋ฌธ์ ๋ฐํ |
lsp_goto_definition | file, line, character | ์ฌ๋ณผ ์ ์ ์์น (ํ์ผ ๊ฒฝ๋ก + ์ค) |
lsp_find_references | file, line, character, includeDeclaration? | ์ฌ๋ณผ์ด ์ฌ์ฉ๋ ๋ชจ๋ ์์น |
lsp_document_symbols | file | ํ์ผ ๋ด ์ฌ๋ณผ ๊ณ์ธต ๋ชฉ๋ก |
lsp_workspace_symbols | query, file | ์ํฌ์คํ์ด์ค ์ ์ฒด ์ฌ๋ณผ ๊ฒ์ |
lsp_diagnostics | file, severity? | ํ์ผ ๋จ์ ์๋ฌ/๊ฒฝ๊ณ ๋ชฉ๋ก |
lsp_diagnostics_directory | directory, strategy? | ํ๋ก์ ํธ ๋จ์ ์ง๋จ (tsc/lsp/auto) |
lsp_servers | (์์) | ์ค์น๋ Language Server ์ํ |
lsp_prepare_rename | file, line, character | ๋ฆฌ๋ค์ ๊ฐ๋ฅ ์ฌ๋ถ ํ์ธ |
lsp_rename | file, line, character, newName | ๋ฆฌ๋ค์ ๋ฏธ๋ฆฌ๋ณด๊ธฐ (์ ์ฉํ์ง ์์) |
lsp_code_actions | file, startLine, startChar, endLine, endChar | ๋ฆฌํฉํ ๋ง ์ ์ ๋ชฉ๋ก |
lsp_code_action_resolve | ์ + actionIndex | ํน์ ์ก์ ์ ํธ์ง ์์ธ |
AST Tools (2๊ฐ) โ ๊ตฌ์กฐ์ ์ฝ๋ ๊ฒ์/๋ณํ
@ast-grep/napi ๋ค์ดํฐ๋ธ ๋ชจ๋์ ์ฌ์ฉํ๋ค. ์ ๊ท์ ๊ธฐ๋ฐ ๊ฒ์๊ณผ ๋ฌ๋ฆฌ AST ํจํด ๋งค์นญ์ผ๋ก ๊ตฌ๋ฌธ ๊ตฌ์กฐ๋ฅผ ์ ํํ ํ์
ํ๋ค.
| ๋๊ตฌ | ํ๋ผ๋ฏธํฐ | ์ญํ |
|---|---|---|
ast_grep_search | pattern, language, path?, context?(0-10์ค), maxResults?(1-100) | AST ํจํด ์ฝ๋ ๊ฒ์ |
ast_grep_replace | pattern, replacement, language, path?, dryRun?(๊ธฐ๋ณธ true) | AST ํจํด ์ฝ๋ ๋ณํ |
ํจํด ๋ฌธ๋ฒ: $NAME(๋จ์ผ ๋
ธ๋), $$$ARGS(๋ค์ค ๋
ธ๋)
์์: console.log($MSG) โ ๋ชจ๋ console.log ํธ์ถ ๋งค์นญ
์ง์ ์ธ์ด: javascript, typescript, tsx, python, ruby, go, rust, java, kotlin, swift, c, cpp, csharp, html, css, json, yaml
State Tools (5๊ฐ) โ ๋ชจ๋ ์ํ ๊ด๋ฆฌ
.omc/state/ ๋๋ ํ ๋ฆฌ์ JSON ํ์ผ๋ก ๋ชจ๋ ์ํ๋ฅผ ๊ด๋ฆฌํ๋ค. session_id ํ๋ผ๋ฏธํฐ๋ก ์ธ์
๋ณ ๊ฒฉ๋ฆฌ๋ฅผ ์ง์ํ๋ฉฐ, ๋ฏธ์ง์ ์ ๋ ๊ฑฐ์ ๊ณต์ ๊ฒฝ๋ก๋ฅผ ์ฌ์ฉํ๋ค(๊ต์ฐจ ์ค์ผ ๊ฒฝ๊ณ ๋ฐ์).
์ง์ ๋ชจ๋: autopilot, team, ralph, ultrawork, ultraqa, ralplan, omc-teams, deep-interview
| ๋๊ตฌ | ํต์ฌ ๋์ |
|---|---|
state_read | ๋ชจ๋ ์ํ JSON ์ฝ๊ธฐ |
state_write | ์ํ ๊ธฐ๋ก (atomicWriteJsonSync ์ฌ์ฉ, _meta ์๋ ์ถ๊ฐ) |
state_clear | ์ํ ์ญ์ (team ๋ชจ๋๋ ๋ฐํ์ ์ํ + HUD๋ ์ ๋ฆฌ) |
state_list_active | ํ์ฌ ํ์ฑ ๋ชจ๋ ๋ชฉ๋ก |
state_get_status | ํน์ ๋ชจ๋์ ์์ธ ์ํ |
state_write๋ atomicWriteJsonSync()๋ก ์์์ ์ฐ๊ธฐ๋ฅผ ๋ณด์ฅํ์ฌ ๋์ ์ ๊ทผ ์ ๋ถ๋ถ ์ฐ๊ธฐ๋ฅผ ๋ฐฉ์งํ๋ค.
Notepad Tools (6๊ฐ) โ ์ธ์ ๊ฐ ๊ตฌ์กฐํ ๋ฉ๋ชจ๋ฆฌ
.omc/notepad.md์ 3๊ฐ ์น์
์ผ๋ก ๊ตฌ๋ถ๋ ๋ฉ๋ชจ๋ฆฌ๋ฅผ ๊ด๋ฆฌํ๋ค.
| ๋๊ตฌ | ์น์ | ํน์ฑ |
|---|---|---|
notepad_write_priority | Priority Context | ๊ต์ฒด(REPLACE) ๋ฐฉ์, ํญ์ ์ธ์ ์์ ์ ๋ก๋, 500์ ์ด๋ด ๊ถ์ฅ |
notepad_write_working | Working Memory | ์ถ๊ฐ(APPEND) ๋ฐฉ์, ํ์์คํฌํ ํฌํจ, 7์ผ ํ ์๋ ์ ๋ฆฌ |
notepad_write_manual | Manual | ์ถ๊ฐ ๋ฐฉ์, ์๋ ์ ๋ฆฌ ์์ |
notepad_read | ์ ํ ๊ฐ๋ฅ | all/priority/working/manual ์ค ํ |
notepad_prune | Working Memory | ์ค๋๋ ํญ๋ชฉ ์ ๋ฆฌ (๊ธฐ๋ณธ 7์ผ) |
notepad_stats | ์ ์ฒด | ํฌ๊ธฐ, ํญ๋ชฉ ์, ์ต๊ณ ๋ น ํญ๋ชฉ, ๊ฒฝ๋ก |
Memory Tools (4๊ฐ) โ ํ๋ก์ ํธ ์ง์ ์ ์ฅ์
.omc/project-memory.json์ ๊ตฌ์กฐํ๋ ํ๋ก์ ํธ ์ ๋ณด๋ฅผ ๊ด๋ฆฌํ๋ค.
์น์ : techStack, build, conventions, structure, customNotes, userDirectives
| ๋๊ตฌ | ์ญํ |
|---|---|
project_memory_read | ํ๋ก์ ํธ ํ๊ฒฝ ์ ๋ณด ์ฝ๊ธฐ (์น์ ์ ํ ๊ฐ๋ฅ) |
project_memory_write | ํ๋ก์ ํธ ์ง์ ๊ธฐ๋ก (merge ๋ชจ๋ ์ง์) |
project_memory_add_note | ์นดํ ๊ณ ๋ฆฌ๋ณ ์ปค์คํ ๋ ธํธ ์ถ๊ฐ |
project_memory_add_directive | ์ฌ์ฉ์ ์ง์์ฌํญ ์ถ๊ฐ (์ปจํ ์คํธ ์์ถ์์ ์ด์๋จ์) |
Shared Memory Tools (5๊ฐ) โ ์์ด์ ํธ ๊ฐ ๊ณต์ ์ ์ฅ์
.omc/state/shared-memory/{namespace}/{key}.json์ ํค-๋ฐธ๋ฅ ํํ๋ก ์์ด์ ํธ ๊ฐ ๋ฐ์ดํฐ๋ฅผ ๊ณต์ ํ๋ค.
~/.claude/.omc-config.json์ agents.sharedMemory.enabled๋ก ๊ฒ์ดํธ๋จ.
| ๋๊ตฌ | ์ญํ |
|---|---|
shared_memory_write | ํค-๋ฐธ๋ฅ ์ ์ฅ (TTL ์ง์, ์ต๋ 7์ผ) |
shared_memory_read | ํค-๋ฐธ๋ฅ ์ฝ๊ธฐ (๋ง๋ฃ ์๋ ๊ฐ์ง) |
shared_memory_list | ๋ค์์คํ์ด์ค ๋ด ํค ๋ชฉ๋ก ๋๋ ์ ์ฒด ๋ค์์คํ์ด์ค ๋ชฉ๋ก |
shared_memory_delete | ํค ์ญ์ |
shared_memory_cleanup | ๋ง๋ฃ๋ ํญ๋ชฉ ์ผ๊ด ์ ๋ฆฌ |
๋๋จธ์ง ๋๊ตฌ
| ์นดํ ๊ณ ๋ฆฌ | ๋๊ตฌ ์ | ์ญํ |
|---|---|---|
| Skills Tools | 3๊ฐ | .omc/skills/(ํ๋ก์ ํธ) + ~/.omc/skills/(๊ธ๋ก๋ฒ) ์คํฌ ํ์ยท๋ชฉ๋ก |
| Trace Tools | 3๊ฐ | .omc/state/agent-replay-*.jsonl ์ธ์
๋ฆฌํ๋ ์ด ํ์๋ผ์ธยท์์ฝยท๊ฒ์ |
| Python REPL | 1๊ฐ | Python ์ฝ๋ ์คํ |
Bridge ๋น๋ ํ์ดํ๋ผ์ธ
๋น๋ ํ๋ฆ
graph TD subgraph "TypeScript ์์ค" S1["src/mcp/standalone-server.ts"] S2["src/mcp/omc-tools-server.ts"] S3["src/team/bridge-entry.ts"] end subgraph "๋น๋ ์คํฌ๋ฆฝํธ" B1["scripts/build-mcp-server.mjs"] B2["scripts/build-bridge-entry.mjs"] B3["scripts/build-skill-bridge.mjs"] end subgraph "bridge/ ์ฐ์ถ๋ฌผ" O1["mcp-server.cjs<br/>~25,000์ค CJS ๋ฒ๋ค"] O2["team-bridge.cjs"] O3["skill-bridge ๊ด๋ จ"] end S1 -->|"esbuild"| B1 --> O1 S3 -->|"esbuild"| B2 --> O2 B3 --> O3 style S2 fill:#ffd,stroke:#aa0 S2 -.->|"๋ฒ๋ค๋ง ์ ๋จ<br/>(In-process ์ ์ฉ)"| SA["์๋ธ์์ด์ ํธ์์<br/>์ง์ import"]
esbuild ์ค์ ํต์ฌ
esbuild.build({
entryPoints: ['src/mcp/standalone-server.ts'],
bundle: true,
platform: 'node',
target: 'node18',
format: 'cjs',
outfile: 'bridge/mcp-server.cjs',
external: [
'fs', 'path', 'os', /* ...Node.js ๋นํธ์ธ */
'@ast-grep/napi', // ๋ค์ดํฐ๋ธ ์ ๋์จ โ ๋ฒ๋ค ๋ถ๊ฐ
'better-sqlite3' // ๋ค์ดํฐ๋ธ ์ ๋์จ โ ๋ฒ๋ค ๋ถ๊ฐ
],
banner: { js: '<NODE_PATH ํด์๊ธฐ ํ๋ฆฌ์ฐ๋ธ>' }
});NODE_PATH ํ๋ฆฌ์ฐ๋ธ
bridge/mcp-server.cjs ์ต์๋จ์ ์ฝ์
๋๋ ์ฝ๋:
try {
var _globalRoot = require('child_process')
.execSync('npm root -g', { encoding: 'utf8' }).trim();
process.env.NODE_PATH = _globalRoot + ':' + process.env.NODE_PATH;
require('module')._initPaths();
} catch (_e) { /* graceful degrade */ }์ธ๋ถํ๋ @ast-grep/napi, better-sqlite3 ๊ฐ์ ๋ค์ดํฐ๋ธ ๋ชจ๋์ ๋ฐํ์์ ๊ธ๋ก๋ฒ npm ๊ฒฝ๋ก์์ ์ฐพ์ ์ ์๊ฒ ํ๋ ํธ๋ฆญ์ด๋ค.
Graceful Shutdown
process.on('SIGTERM', () => gracefulShutdown('SIGTERM'));
process.on('SIGINT', () => gracefulShutdown('SIGINT'));์ข
๋ฃ ์ disconnectAll()์ ํธ์ถํ๋ค. ์ด ํจ์๋ ๋ด๋ถ์ ์ผ๋ก lspClientManager.disconnectAll()์ ์คํํ์ฌ LSP ์์ ํ๋ก์ธ์ค๋ฅผ ์ ๋ฆฌํ๊ณ ๊ณ ์ ํ๋ก์ธ์ค๋ฅผ ๋ฐฉ์งํ๋ค.
๋๋ง์ MCP ๋๊ตฌ๋ฅผ ์ถ๊ฐํ๋ค๋ฉด
// src/tools/my-tools.ts
import { z } from 'zod';
export const myTools = [
{
name: 'my_custom_tool',
description: 'My custom tool description',
schema: z.object({ input: z.string() }),
handler: async (args: { input: string }) => ({
content: [{ type: 'text' as const, text: `Result: ${args.input}` }]
})
}
];// omc-tools-server.ts์ ๋ฑ๋ก
const allTools = [
...tagCategory(myTools, 'my-category'),
// ...๊ธฐ์กด ๋๊ตฌ๋ค
];npm run build ํ mcp__t__my_custom_tool๋ก ํธ์ถ ๊ฐ๋ฅ.
์ฐธ๊ณ ๋ฌธ์
- MCP (Model Context Protocol) ๊ณต์ ๋ฌธ์
- Claude Agent SDK - createSdkMcpServer
- ์์ค:
~/Documents/study/oh-my-claudecode/src/mcp/omc-tools-server.ts - ์์ค:
~/Documents/study/oh-my-claudecode/src/mcp/standalone-server.ts