728x90
반응형

 

Codex에 MCP(Node/npx) 붙이기

— Context7 & SequentialThinking 빠른 가이드

 

요약
npm 배포 MCP → 설치 없이 npx로 바로 실행해 Codex 등록.
여기서는 Context7 / SequentialThinking만 다룸.

 

1) 배경 / 요약

  • Node 계열 MCP → 보통 npm 패키지. npx로 즉시 실행 가능.
  • Python 계열은 pipx/venv 권장
  • 목표: Codex에서 Context7 / SequentialThinking 등록·사용 최소셋.

결론config.toml에 서버 두 개 추가 → Codex 재시작 → /mcp로 상태 확인.

 

2) config.toml 세팅

경로Linux/WSL → ~/.codex/config.toml

# === 모델 설정 ===
model = "gpt-5-codex"
model_reasoning_effort = "high"

# === 프로젝트 신뢰 설정 ===
[projects."/path/to/your/project"]
trust_level = "trusted"

# === MCP 서버들 ===
[mcp_servers.context7]
command = "npx"
args = ["-y", "@upstash/context7-mcp"]   # ← 패키지명 주의!

[mcp_servers.sequentialthinking]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-sequential-thinking"]

# === 도구 ===
[tools]
web.search = true

WSL 팁npx 경로 이슈 있으면 command="/usr/bin/npx"로 절대경로 지정.

 

3) 동작 확인

터미널에서 각각 도움말 확인 (정상 동작 체크):

npx -y @upstash/context7-mcp --help
npx -y @modelcontextprotocol/server-sequential-thinking --help

 

Codex 내 확인:

/mcp
  • Server: context7 → Status: enabled
  • Server: sequentialthinking → Status: enabled

 

4) 사용법 (Context7 / SequentialThinking)

Context7 (자동 컨텍스트 주입)

  • 툴 실행형 아님. 대화에 문맥 자동 주입.
  • 파일/모듈/경로를 질문에 명시 → 효과 ↑
  • 프로젝트를 trusted로 등록 → 소스/구조 반영 쉬움.
  • 응답 약하면 “문맥 더 확장/비교/요약” 재요청.

SequentialThinking (툴 호출)

  • 자연어로 “sequentialthinking으로 먼저 계획” 지시 → 단계 계획 생성.
  • 흐름: 계획 → 코드 초안 2스텝으로 굴리는 게 효율적.
  • 필요 시 “깊이/단계 수/리스크 포함” 등 옵션을 문장으로 명시.

 

5) 바로 쓰는 템플릿

A. Context7

Context7을 활용해서, src/modules/contract/service 내 코드들을 기준으로
현재 설계 의도(의존성, 경계, 예외 흐름)를 요약해줘.
참고: Spring Boot 3.x / JPA, QueryDSL. 다국어/멀티 테넌시 있음.

B. SequentialThinking

아래 요구사항을 sequentialthinking으로 먼저
계획(Goal → Assumptions → Steps → Risks) 만든 뒤,
실제 변경 커밋 단위 작업 순서를 제안해줘.

 

트러블슈팅
npx not found → 절대경로 지정.   Tools: (none) (Context7) → 정상일 수 있음(컨텍스트 주입형).

728x90
반응형

+ Recent posts