# Context7 MCP — how to use (mcp.ai)

Connect your Context7 MCP account and use 2 tools for developer tools and devops straight from your AI agent. Connect with your own API key. Context7 MCP pulls up-to-date, version-specific documentation and code examples straight from the source, and places them directly into your prompt.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_context7_mcp?ms=1787293500000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `context7_mcp_query_docs`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/context7_mcp`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/context7_mcp/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/context7_mcp/query/docs` — Retrieves and queries up-to-date documentation and code examples from Context7 for any programming library or framework.
  - body: { query: string, libraryId: string }
- `POST https://api.mcp.ai/api/context7_mcp/resolve/library/id` — Resolves a package/product name to a Context7-compatible library ID and returns matching libraries.
  - body: { query: string, libraryName: string }

## Example prompts
- "What can I do in Context7 MCP?"
- "Show me a summary of my Context7 MCP account"

## More
- Page: https://mcp.ai/context7_mcp
- Agent spec (llms.txt): https://mcp.ai/context7_mcp/llms.txt
- Postman collection: https://mcp.ai/context7_mcp/postman.json
