Context7
$0.01/call
Library documentation lookup for coding assistance (by Upstash)
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
{
"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.
{
"mcpServers": {
"xpay": {
"url": "https://mcp.xpay.sh/mcp?key=YOUR_API_KEY"
}
}
}Agent Discovery
Machine-readable catalogs for LLM agents and automation.
curl https://xpay.tools/llms.txt
curl https://xpay.tools/agents.txt
curl https://xpay.tools/skill.md
Pricing
Pay per tool call. No subscriptions.
2 Context7 tools availableAbout 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 fromresolve-library-idand 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
| Tool | Price 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.

