Skip to main content
Glama

Context7 MCP

by upstash

Context7 MCP - 모든 프롬프트에 대한 최신 코드 문서

❌ 맥락 없이7

LLM은 사용하는 도서관에 대한 오래되거나 일반적인 정보에 의존합니다. 다음과 같은 정보를 얻게 됩니다.

  • ❌ 코드 예제는 오래되었으며 1년 된 교육 데이터를 기반으로 합니다.
  • ❌ 환각 API는 존재하지도 않습니다.
  • ❌ 이전 패키지 버전에 대한 일반적인 답변

✅ Context7을 사용하여

Context7 MCP는 최신 버전별 설명서와 코드 예제를 소스에서 직접 가져와 프롬프트에 바로 배치합니다.

커서의 프롬프트에 use context7 추가하세요:

지엑스피1

Create a script to delete the rows where the city is "" given PostgreSQL credentials. use context7

Context7은 최신 코드 예제와 문서를 귀하의 LLM 컨텍스트로 바로 가져옵니다.

  • 1️⃣ 자연스럽게 프롬프트를 작성하세요
  • 2️⃣ LLM에 use context7 지시하세요
  • 3️⃣ 작동하는 코드에 대한 답변을 얻으세요

탭 전환도 없고, 존재하지 않는 이상한 API도 없고, 오래된 코드 생성도 없습니다.

🛠️ 시작하기

요구 사항

  • Node.js >= v18.0.0
  • 커서, 윈드서프, 클로드 데스크톱 또는 다른 MCP 클라이언트

Smithery를 통해 설치

Smithery를 통해 Claude Desktop용 Context7 MCP Server를 자동으로 설치하려면:

npx -y @smithery/cli install @upstash/context7-mcp --client claude

커서에 설치

이동: Settings -> Cursor Settings -> MCP -> Add new global MCP server

다음 구성을 Cursor ~/.cursor/mcp.json 파일에 붙여넣는 것이 권장됩니다. 프로젝트 폴더에 .cursor/mcp.json 만들어 특정 프로젝트에 설치할 수도 있습니다. 자세한 내용은 Cursor MCP 문서를 참조하세요.

{ "mcpServers": { "context7": { "command": "npx", "args": ["-y", "@upstash/context7-mcp"] } } }
{ "mcpServers": { "context7": { "command": "bunx", "args": ["-y", "@upstash/context7-mcp"] } } }
{ "mcpServers": { "context7": { "command": "deno", "args": ["run", "--allow-env", "--allow-net", "npm:@upstash/context7-mcp"] } } }

윈드서프에 설치

Windsurf MCP 설정 파일에 이 내용을 추가하세요. 자세한 내용은 Windsurf MCP 문서를 참조하세요.

{ "mcpServers": { "context7": { "command": "npx", "args": ["-y", "@upstash/context7-mcp"] } } }

VS Code에 설치

VS Code MCP 설정 파일에 이 내용을 추가하세요. 자세한 내용은 VS Code MCP 문서를 참조하세요.

{ "servers": { "Context7": { "type": "stdio", "command": "npx", "args": ["-y", "@upstash/context7-mcp"] } } }

Zed에 설치

Zed Extensions를 통해 설치하거나 Zed settings.json 파일에 추가할 수 있습니다. 자세한 내용은 Zed Context Server 문서를 참조하세요.

{ "context_servers": { "Context7": { "command": { "path": "npx", "args": ["-y", "@upstash/context7-mcp"] }, "settings": {} } } }

Claude Code에 설치

이 명령을 실행하세요. 자세한 내용은 Claude Code MCP 문서를 참조하세요.

claude mcp add context7 -- npx -y @upstash/context7-mcp

Claude Desktop에 설치

Claude Desktop의 claude_desktop_config.json 파일에 이 내용을 추가하세요. 자세한 내용은 Claude Desktop MCP 문서를 참조하세요.

{ "mcpServers": { "Context7": { "command": "npx", "args": ["-y", "@upstash/context7-mcp"] } } }

BoltAI에 설치

앱의 "설정" 페이지를 열고 "플러그인"으로 이동한 후 다음 JSON을 입력하세요.

{ "mcpServers": { "context7": { "command": "npx", "args": ["-y", "@upstash/context7-mcp"] } } }

저장 후 채팅창에 get-library-docs 명령어 다음에 Context7 문서 ID를 입력하세요(예: get-library-docs /nuxt/ui ). 자세한 내용은 BoltAI 문서 사이트 에서 확인할 수 있습니다. iOS용 BoltAI의 경우 이 가이드를 참조하세요 .

Docker 사용

Docker 컨테이너에서 MCP 서버를 실행하려면 다음을 수행하세요.

  1. Docker 이미지 빌드:먼저, 프로젝트 루트(또는 원하는 곳)에 Dockerfile 만듭니다.
    FROM node:18-alpine WORKDIR /app # Install the latest version globally RUN npm install -g @upstash/context7-mcp # Expose default port if needed (optional, depends on MCP client interaction) # EXPOSE 3000 # Default command to run the server CMD ["context7-mcp"]
    그런 다음 태그(예: context7-mcp )를 사용하여 이미지를 빌드합니다. Docker Desktop(또는 Docker 데몬)이 실행 중인지 확인합니다. Dockerfile 을 저장한 디렉터리에서 다음 명령을 실행합니다.
    docker build -t context7-mcp .
  2. MCP 클라이언트 구성:Docker 명령을 사용하도록 MCP 클라이언트의 구성을 업데이트합니다.cline_mcp_settings.json의 예:
    { "mcpServers": { "Сontext7": { "autoApprove": [], "disabled": false, "timeout": 60, "command": "docker", "args": ["run", "-i", "--rm", "context7-mcp"], "transportType": "stdio" } } }
    참고: 이는 예시 구성입니다. 이 README 앞부분에 있는 MCP 클라이언트(예: Cursor, VS Code 등)에 대한 구체적인 예시를 참조하여 구조를 조정하세요(예: mcpServersservers ). 또한, args 에 지정된 이미지 이름이 docker build 명령에서 사용된 태그와 일치하는지 확인하세요.

윈도우에 설치

Windows의 구성은 Linux나 macOS와 약간 다릅니다( 예시에서는 Cline 사용했습니다 ). 다른 편집기에도 동일한 원칙이 적용됩니다. commandargs 구성을 참조하세요.

{ "mcpServers": { "github.com/upstash/context7-mcp": { "command": "cmd", "args": [ "/c", "npx", "-y", "@upstash/context7-mcp" ], "disabled": false, "autoApprove": [] } } }

환경 변수

  • DEFAULT_MINIMUM_TOKENS : 문서 검색을 위한 최소 토큰 수를 설정합니다(기본값: 10000).

예:

{ "mcpServers": { "context7": { "command": "npx", "args": ["-y", "@upstash/context7-mcp"], "env": { "DEFAULT_MINIMUM_TOKENS": "10000" } } } }

사용 가능한 도구

  • resolve-library-id : 일반 라이브러리 이름을 Context7과 호환되는 라이브러리 ID로 변환합니다.
    • libraryName (필수)
  • get-library-docs : Context7 호환 라이브러리 ID를 사용하여 라이브러리에 대한 문서를 가져옵니다.
    • context7CompatibleLibraryID (필수)
    • topic (선택 사항): 문서를 특정 주제(예: "라우팅", "후크")에 집중시킵니다.
    • tokens (선택 사항, 기본값 10000): 반환할 최대 토큰 수입니다. 구성된 DEFAULT_MINIMUM_TOKENS 값 또는 기본값 10000보다 작은 값은 자동으로 해당 값으로 증가합니다.

개발

프로젝트를 복제하고 종속성을 설치합니다.

bun i

짓다:

bun run build

로컬 구성 예

{ "mcpServers": { "context7": { "command": "npx", "args": ["tsx", "/path/to/folder/context7-mcp/src/index.ts"] } } }

MCP Inspector로 테스트

npx -y @modelcontextprotocol/inspector npx @upstash/context7-mcp

문제 해결

오류_모듈_찾을__없습니다

이 오류가 표시되면 npx 대신 bunx 사용해 보세요.

{ "mcpServers": { "context7": { "command": "bunx", "args": ["-y", "@upstash/context7-mcp"] } } }

이렇게 하면 특히 npx 패키지를 제대로 설치하거나 해결하지 못하는 환경에서 모듈 해결 문제가 해결되는 경우가 많습니다.

ESM 해결 문제

다음과 같은 오류가 발생하면: Error: Cannot find module 'uriTemplate.js' --experimental-vm-modules 플래그를 사용하여 실행해보세요.

{ "mcpServers": { "context7": { "command": "npx", "args": [ "-y", "--node-options=--experimental-vm-modules", "@upstash/context7-mcp" ] } } }

TLS/인증서 문제

npx 와 함께 --experimental-fetch 플래그를 사용하면 TLS 관련 문제를 우회할 수 있습니다.

{ "mcpServers": { "context7": { "command": "npx", "args": [ "-y", "--node-options=--experimental-fetch", "@upstash/context7-mcp" ] } } }

MCP 클라이언트 오류

  1. 패키지 이름에 @latest 추가해보세요.
  2. 대안으로 bunx 사용해보세요.
  3. 대안으로 deno 사용해보세요.
  4. npx 에서 네이티브 Fetch 지원을 받으려면 Node v18 이상을 사용해야 합니다.

부인 성명

Context7 프로젝트는 커뮤니티 기여로 운영되며, 높은 품질을 유지하기 위해 최선을 다하지만 모든 라이브러리 문서의 정확성, 완전성 또는 보안을 보장할 수는 없습니다. Context7에 등록된 프로젝트는 Context7이 아닌 해당 소유자가 개발 및 관리합니다. 의심스럽거나 부적절하거나 잠재적으로 유해한 콘텐츠를 발견하시면 프로젝트 페이지의 "신고" 버튼을 사용하여 즉시 알려주시기 바랍니다. Context7은 모든 신고를 중요하게 생각하며, 플랫폼의 무결성과 안전성을 유지하기 위해 신고된 콘텐츠를 신속하게 검토합니다. Context7을 사용함으로써 귀하는 본인의 재량과 책임 하에 사용함을 인정합니다.

저희와 연결하세요

최신 소식을 받아보시고, 커뮤니티에 가입하세요:

  • 📢 최신 뉴스와 업데이트를 받으려면 X 에서 저희를 팔로우하세요.
  • 🌐 저희 웹사이트를 방문하세요
  • 💬 Discord 커뮤니티 에 가입하세요(해당되는 경우)

Context7 미디어에서

스타 역사

특허

MIT

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

라이브러리에서 최신 버전별 설명서와 코드 예제를 직접 LLM 프롬프트로 가져오는 모델 컨텍스트 프로토콜 서버로, 개발자가 오래되거나 왜곡된 정보 없이 정확한 답변을 얻을 수 있도록 도와줍니다.

  1. ❌ 맥락 없이7
    1. ✅ Context7을 사용하여
      1. 🛠️ 시작하기
        1. 요구 사항
        2. Smithery를 통해 설치
        3. 커서에 설치
        4. 윈드서프에 설치
        5. VS Code에 설치
        6. Zed에 설치
        7. Claude Code에 설치
        8. Claude Desktop에 설치
        9. BoltAI에 설치
        10. Docker 사용
        11. 윈도우에 설치
        12. 환경 변수
        13. 사용 가능한 도구
      2. 개발
        1. 로컬 구성 예
        2. MCP Inspector로 테스트
      3. 문제 해결
        1. 오류\모듈\찾을\수\없습니다
        2. ESM 해결 문제
        3. TLS/인증서 문제
        4. MCP 클라이언트 오류
      4. 부인 성명
        1. 저희와 연결하세요
          1. Context7 미디어에서
            1. 스타 역사
              1. 특허

                Related MCP Servers

                • -
                  security
                  A
                  license
                  -
                  quality
                  A Model Context Protocol server that enables LLMs to read, search, and analyze code files with advanced caching and real-time file watching capabilities.
                  Last updated -
                  45
                  8
                  JavaScript
                  MIT License
                  • Linux
                  • Apple
                • -
                  security
                  A
                  license
                  -
                  quality
                  A Model Context Protocol server that allows LLMs to interact with web content through standardized tools, currently supporting web scraping functionality.
                  Last updated -
                  Python
                  MIT License
                  • Linux
                  • Apple
                • -
                  security
                  F
                  license
                  -
                  quality
                  A Model Context Protocol server that enables LLMs to extract and use content from unstructured documents across a wide variety of file formats.
                  Last updated -
                  2
                  Python
                  • Apple
                • -
                  security
                  A
                  license
                  -
                  quality
                  A Model Context Protocol Server that enables LLMs to interact with and execute REST API calls through natural language prompts, supporting GET/PUT/POST/PATCH operations on configured APIs.
                  Last updated -
                  5
                  Python
                  Apache 2.0

                View all related MCP servers

                MCP directory API

                We provide all the information about MCP servers via our MCP API.

                curl -X GET 'https://glama.ai/api/mcp/v1/servers/upstash/context7-mcp'

                If you have feedback or need assistance with the MCP directory API, please join our Discord server