xpay tools logo
  • Tools
  • Collections
  • Skills
  • Docs
  • xpay.sh
  1. Home
  2. ›
  3. Providers
  4. ›
  5. Context7

Context7 logo

Context7

2 tools

$0.01/call

Library documentation lookup for coding assistance (by Upstash)

​
​
How it works ↓
Resolve Library Id
resolve-library-id

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: 1. Analyze the query to understand what library/package the user is looking for 2. 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.


flat

$0.01/call

Query Docs
query-docs

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.


flat

$0.01/call

Connect Context7 tools
​
​

Cursor

Claude Code

Claude Desktop

Windsurf

VS Code

Cline

Roo Code

ChatGPT

Gemini CLI

Amazon Q

Goose

Augment

n8n

API / cURL

AI SDK

TypeScript SDK

Add to ~/.cursor/mcp.json
{
  "mcpServers": {
    "context7": {
      "url": "https://context7.mcp.xpay.sh/mcp?key=YOUR_API_KEY"
    }
  }
}
Or connect all tools

Access all tools (including Context7) through a single MCP connection.

https://mcp.xpay.sh/mcp?key=***
{
  "mcpServers": {
    "xpay": {
      "url": "https://mcp.xpay.sh/mcp?key=YOUR_API_KEY"
    }
  }
}
Agent Discovery

Machine-readable catalogs for LLM agents and automation.

llms.txt — Human-readable tool catalog
curl https://xpay.tools/llms.txt
agents.txt — Structured JSON for agents
curl https://xpay.tools/agents.txt
skill.md — Claude Code skill
curl https://xpay.tools/skill.md
Pricing

Pay per tool call. No subscriptions.

2 Context7 tools available
About Context7

Context7 on xpay — Real-time library documentation lookup for coding agents

Context7 is a documentation and code-example lookup service built by Upstash that helps developers and AI agents find accurate, up-to-date information about programming libraries and frameworks. Instead of relying on stale training data or incomplete local docs, agents can query live documentation in real time—perfect for answering version-specific questions, finding API signatures, or pulling working code examples during development.

Developers typically reach for Context7 when they need their AI assistant to have access to current library APIs, when they're working with rapidly-evolving frameworks, or when they want to reduce hallucination by grounding agent responses in authoritative source material.

What's available

  • resolve-library-id — Convert a human-readable package or product name (e.g., "React", "lodash", "FastAPI") into a Context7-compatible library ID. This step is required before querying docs, ensuring the agent targets the exact library you want.
  • query-docs — Retrieve and search live documentation and code examples for any programming library or framework. Pass the library ID from resolve-library-id and a query string to get relevant snippets, API signatures, and working examples.

When Context7 is the right tool

  • You need your agent to access current library documentation without waiting for model retraining.
  • You're building coding assistants that must provide accurate, version-aware API information.
  • You want to reduce hallucination by grounding agent responses in authoritative docs.
  • You're working with rapidly-evolving frameworks where docs change frequently (e.g., Next.js, Svelte, FastAPI).
  • You need working code examples pulled directly from official sources.
  • You're building developer tools that integrate library lookup as a core feature.

When to choose something else

  • If you only need general programming knowledge (algorithms, design patterns, language fundamentals), a large language model's training data may suffice.
  • If you're querying proprietary or internal documentation, Context7 won't help—you'd need a custom integration or a general RAG solution.
  • If you need multi-language documentation search across hundreds of libraries simultaneously, a dedicated search engine or aggregator might be more cost-effective at scale.
  • If your use case is one-off lookups rather than agent-driven queries, a browser search or IDE inline docs may be faster.

Pricing snapshot

ToolPrice per call
resolve-library-id$0.01
query-docs$0.01

Both tools are priced at $0.01 per invocation. Typical workflows (resolve ID + query docs) cost $0.02 per lookup.

Quickstart

First, sign up at xpay.tools with email or Google, then copy your xpay API key.

Option 1: Context7 alone (recommended for single-provider use)

claude mcp add --transport http context7 "https://context7.mcp.xpay.sh/mcp?key=YOUR_XPAY_KEY"

Option 2: All xpay providers in one connection

claude mcp add --transport http xpay "https://mcp.xpay.sh/mcp?key=YOUR_XPAY_KEY"

For Cursor, Windsurf, Cline, or VS Code (Copilot): Add a server entry to your mcp.json file:

{
  "mcpServers": {
    "context7": {
      "url": "https://context7.mcp.xpay.sh/mcp?key=YOUR_XPAY_KEY"
    }
  }
}

Once connected, your agent can call resolve-library-id with a package name, then pass the returned library ID to query-docs with a search query. For example: "Use resolve-library-id to find the React library, then query-docs to find the useState hook signature."

Why route Context7 through xpay?

  • No Context7 signup required — xpay holds the upstream credentials; you authenticate once with your xpay API key.
  • Pay only for what you use — $0.01 per call, no subscriptions or monthly minimums. $5 free credit to start.
  • MCP-native integration — Works seamlessly with Claude Code, Cursor, Windsurf, Cline, and VS Code—no custom client needed.
  • Unified billing across providers — If you use multiple xpay providers (Tavily, Apollo, etc.), one invoice covers all of them.
  • Instant provisioning — Start querying docs immediately after signup; no waiting for approval or account setup with Context7 directly.
Frequently Asked Questions

Context7 is a library documentation and code-example lookup service by Upstash. It lets AI agents and developers query live, up-to-date documentation for programming libraries and frameworks in real time, reducing hallucination and ensuring responses are grounded in current API signatures and working examples.

Both `resolve-library-id` and `query-docs` cost $0.01 per call. A typical workflow (resolve a library ID, then query its docs) costs $0.02. You pay only for calls you make; there are no subscriptions or monthly minimums. New xpay users get $5 free credit.

No. xpay holds the upstream Context7 credentials on your behalf. You sign up once at xpay.tools with email or Google, get your xpay API key, and start querying Context7 immediately. You never create a separate Context7 account.

Use Context7 when you need your AI agent to access current library documentation, answer version-specific API questions, retrieve working code examples, or reduce hallucination by grounding responses in authoritative sources. It's ideal for coding assistants, developer tools, and workflows that depend on accurate, up-to-date library information.

Alternatives include relying on your LLM's training data (faster but potentially stale), building a custom RAG system over your own docs, using general web search APIs, or integrating with IDE inline documentation. Context7 is best when you need live, authoritative library docs without the overhead of a custom solution.

Run `claude mcp add --transport http context7 "https://context7.mcp.xpay.sh/mcp?key=YOUR_XPAY_KEY"` (replace YOUR_XPAY_KEY with your actual key from xpay.tools). For Cursor or VS Code, add the same URL to your `mcp.json` file under `mcpServers`.

Call `resolve-library-id` with a package name (e.g., "React") to get a library ID, then pass that ID to `query-docs` with your search query (e.g., "useState hook"). Your agent can chain these calls automatically to retrieve relevant documentation and code examples.

Yes. You can connect the unified xpay MCP endpoint (`https://mcp.xpay.sh/mcp?key=YOUR_XPAY_KEY`) to access Context7, Tavily, Apollo, and other providers through a single connection. All calls are billed to your xpay account on one invoice.

xpay tools logo

Marketplace for AI Capabilities. Run agents, tools & prompts with pay-per-use micropayments.

or ask your AI app
Popular Tools
FirecrawlTavilyExaHunterPerplexityRecraftIdeogramFlux
Collections
AI Image & MediaContent & ResearchDev ToolsFinanceLead GenWeb ScrapingCompetitive Intel
Developers
DocumentationAPI ReferenceQuickstartSDKsSkillsskill.mdllms.txt
Resources
The Agentic EconomyAgentic CommerceAgent Frameworksx402 ProtocolBlog
Company
About xpayxpay.shGitHubDiscordTwitter / X

© 2026 Agentically Inc. All rights reserved.
Privacy PolicyTerms of Service
✦
xpay Assistant
Context7 Tools

Ask me about tools, pricing, or how to connect

What tools does Context7 offer?
How do I connect via MCP?
Show me pricing
DocsCollectionsExplore