Context7 MCP
Context7 MCP - 모든 프롬프트에 대한 최신 코드 문서
❌ 맥락 없이7
LLM은 사용하는 도서관에 대한 오래되거나 일반적인 정보에 의존합니다. 다음과 같은 정보를 얻게 됩니다.
❌ 코드 예제는 오래되었으며 1년 된 교육 데이터를 기반으로 합니다.
❌ 환각 API는 존재하지도 않습니다.
❌ 이전 패키지 버전에 대한 일반적인 답변
Related MCP server: docs-mcp-server
✅ Context7을 사용하여
Context7 MCP는 최신 버전별 설명서와 코드 예제를 소스에서 직접 가져와 프롬프트에 바로 배치합니다.
커서의 프롬프트에 use context7 추가하세요:
지엑스피1
Create a script to delete the rows where the city is "" given PostgreSQL credentials. use context7Context7은 최신 코드 예제와 문서를 귀하의 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-mcpClaude 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 서버를 실행하려면 다음을 수행하세요.
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 .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 등)에 대한 구체적인 예시를 참조하여 구조를 조정하세요(예:
mcpServers대servers). 또한,args에 지정된 이미지 이름이docker build명령에서 사용된 태그와 일치하는지 확인하세요.
윈도우에 설치
Windows의 구성은 Linux나 macOS와 약간 다릅니다( 예시에서는 Cline 사용했습니다 ). 다른 편집기에도 동일한 원칙이 적용됩니다. command 및 args 구성을 참조하세요.
{
"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 클라이언트 오류
패키지 이름에
@latest추가해보세요.대안으로
bunx사용해보세요.대안으로
deno사용해보세요.npx에서 네이티브 Fetch 지원을 받으려면 Node v18 이상을 사용해야 합니다.
부인 성명
Context7 프로젝트는 커뮤니티 기여로 운영되며, 높은 품질을 유지하기 위해 최선을 다하지만 모든 라이브러리 문서의 정확성, 완전성 또는 보안을 보장할 수는 없습니다. Context7에 등록된 프로젝트는 Context7이 아닌 해당 소유자가 개발 및 관리합니다. 의심스럽거나 부적절하거나 잠재적으로 유해한 콘텐츠를 발견하시면 프로젝트 페이지의 "신고" 버튼을 사용하여 즉시 알려주시기 바랍니다. Context7은 모든 신고를 중요하게 생각하며, 플랫폼의 무결성과 안전성을 유지하기 위해 신고된 콘텐츠를 신속하게 검토합니다. Context7을 사용함으로써 귀하는 본인의 재량과 책임 하에 사용함을 인정합니다.
저희와 연결하세요
최신 소식을 받아보시고, 커뮤니티에 가입하세요:
📢 최신 뉴스와 업데이트를 받으려면 X 에서 저희를 팔로우하세요.
🌐 저희 웹사이트를 방문하세요
💬 Discord 커뮤니티 에 가입하세요(해당되는 경우)
Context7 미디어에서
스타 역사
특허
MIT
Available Tools
2 toolsquery-docsQuery DocumentationARead-onlyInspect
Retrieves and queries up-to-date documentation and code examples from Context7 for any programming library or framework.
You must call 'resolve-library-id' first to obtain the exact Context7-compatible library ID required to use this tool, UNLESS the user explicitly provides a library ID in the format '/org/project' or '/org/project/version' in their query.
IMPORTANT: Do not call this tool more than 3 times per question. If you cannot find what you need after 3 calls, use the best information you have.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The question or task you need help with. Be specific and include relevant details. Good: 'How to set up authentication with JWT in Express.js' or 'React useEffect cleanup function examples'. Bad: 'auth' or 'hooks'. IMPORTANT: Do not include any sensitive or confidential information such as API keys, passwords, credentials, or personal data in your query. | |
| libraryId | Yes | Exact Context7-compatible library ID (e.g., '/mongodb/docs', '/vercel/next.js', '/supabase/supabase', '/vercel/next.js/v14.3.0-canary.87') retrieved from 'resolve-library-id' or directly from user query in the format '/org/project' or '/org/project/version'. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Adds behavioral context beyond the readOnlyHint annotation: the 3-call limit, prerequisite step, and warning against sensitive data. No contradiction with annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three short paragraphs each serving a distinct purpose: purpose, prerequisite, limitation. Front-loaded with the core action, no redundant information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Covers prerequisite, usage limit, and parameter guidance. Lacks explicit description of output format, but since the tool retrieves documentation and code examples, the output type is reasonably inferable.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema provides 100% coverage with detailed descriptions for both parameters. The tool description reinforces the relationship between libraryId and resolve-library-id but adds little semantic meaning beyond what's already in the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it retrieves and queries documentation and code examples from Context7 for any library, distinguishing it from the sibling 'resolve-library-id' tool which is for obtaining library IDs.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly instructs to use 'resolve-library-id' first unless user provides library ID, and imposes a 3-call limit per question, providing clear guidance on when and how many times to use.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
resolve-library-idResolve Context7 Library IDARead-onlyInspect
Resolves a package/product name to a Context7-compatible library ID and returns matching libraries.
You MUST call this function before 'query-docs' to obtain a valid Context7-compatible library ID UNLESS the user explicitly provides a library ID in the format '/org/project' or '/org/project/version' in their query.
Selection Process:
Analyze the query to understand what library/package the user is looking for
Return the most relevant match based on:
Name similarity to the query (exact matches prioritized)
Description relevance to the query's intent
Documentation coverage (prioritize libraries with higher Code Snippet counts)
Source reputation (consider libraries with High or Medium reputation more authoritative)
Benchmark Score: Quality indicator (100 is the highest score)
Response Format:
Return the selected library ID in a clearly marked section
Provide a brief explanation for why this library was chosen
If multiple good matches exist, acknowledge this but proceed with the most relevant one
If no good matches exist, clearly state this and suggest query refinements
For ambiguous queries, request clarification before proceeding with a best-guess match.
IMPORTANT: Do not call this tool more than 3 times per question. If you cannot find what you need after 3 calls, use the best result you have.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The user's original question or task. This is used to rank library results by relevance to what the user is trying to accomplish. IMPORTANT: Do not include any sensitive or confidential information such as API keys, passwords, credentials, or personal data in your query. | |
| libraryName | Yes | Library name to search for and retrieve a Context7-compatible library ID. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations indicate readOnlyHint=true, which is consistent with the tool's purpose. The description adds important behavioral details beyond annotations, such as a 3-call limit per question, handling of ambiguous queries, and a warning not to include sensitive information in the 'query' parameter.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with clear sections, but it is somewhat lengthy. It front-loads the essential purpose and usage note, but the selection process details could be more succinct. Still, it remains clear and organized.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given there is no output schema, the description adequately explains the response format. It covers edge cases like multiple matches, no matches, and ambiguous queries, providing complete guidance for the agent to handle various scenarios.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline is 3. The description adds value by explaining the role of each parameter: 'libraryName' is the name to search for, and 'query' is the user's original question used for ranking. It also includes a critical warning about sensitive data in 'query', which enhances understanding.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states that the tool resolves a package/product name to a Context7-compatible library ID. It distinguishes itself from the sibling tool 'query-docs' by noting it must be called first, and includes specific details about selection criteria and response format.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly specifies when to call this tool: before 'query-docs' unless the user provides a library ID in a specific format. It also provides a detailed selection process and response format, guiding the agent on how to use the tool correctly.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
2 tool updates
v1.0.8- Added
query-docs - Added
resolve-library-id
2 tool updates
v1.0.6- Removed
query-docs - Removed
resolve-library-id
TDQS
Scored across 2 tools
Each tool has a distinct and complementary purpose: one resolves library names to IDs, the other queries documentation using that ID. There is no overlap.
Both tools follow the same verb_noun pattern with snake_case: 'resolve-library-id' and 'query-docs'. Consistent and predictable.
With only two tools, the surface is minimal but still covers the core workflow for querying documentation. It is slightly thin but appropriate for a focused server.
The two tools form a complete workflow: resolve then query. No obvious gaps for the stated purpose, though additional tools like list_libraries could enhance completeness.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
The Cortex MCP server provides read-only access to real-time engineering context from the Cortex developer portal, allowing AI coding assistants to answer natural language questions about your organization's catalog (microservices, libraries, domains, teams, infrastructure), scorecards (engineering standards and best practices), initiatives (goals and deadlines), and Engineering Intelligence metrics. It includes tools for querying documentation, tracking personal entities, and accessing AI-assisted insights across the entire Cortex ecosystem.
A Model Context Protocol server for Wix AI tools
The AWS Knowledge MCP server is a fully managed remote Model Context Protocol server that provides real-time access to official AWS content in an LLM-compatible format. It offers structured access to AWS documentation, code samples, blog posts, What's New announcements, Well-Architected best practices, and regional availability information for AWS APIs and CloudFormation resources. Key capabilities include searching and reading documentation in markdown format, getting content recommendations, listing AWS regions, and checking regional availability for services and features.
Related MCP Servers
- FlicenseBqualityDmaintenanceAn MCP server that fetches real-time documentation for popular libraries like Langchain, Llama-Index, MCP, and OpenAI, allowing LLMs to access updated library information beyond their knowledge cut-off dates.13-
- AlicenseNot gradedqualityAmaintenanceA Model Context Protocol (MCP) server that scrapes, indexes, and searches documentation for third-party software libraries and packages, supporting versioning and hybrid search.550 npm1,724MIT
- AlicenseNot gradedqualityDmaintenanceA server that provides organized documentation content for various applications using the Model Context Protocol, enabling AI assistants to access quickstart guides and code examples.MIT
- AlicenseCqualityCmaintenanceA Model Context Protocol server that enables intelligent searching across documentation for 30+ programming libraries and frameworks, fetching relevant information from official sources.238MIT