Context7 Platform -- Up-to-date docs for AI agents
docs: add MCP tools reference and REST API mapping (#3218)
context7[bot]888e013425ed
diff --git a/docs/api-guide.mdx b/docs/api-guide.mdxindex 55789f34..2bf27a28 100644--- a/docs/api-guide.mdx+++ b/docs/api-guide.mdx@@ -146,6 +146,17 @@ for info in docs["infoSnippets"]:For TypeScript SDK usage, see [Search](/sdks/ts/commands/search), [Search Library](/sdks/ts/commands/search-library), and [Get Context](/sdks/ts/commands/get-context).</Info>+## MCP Tools++The [Context7 MCP server](/resources/all-clients) exposes the same lookups as agent tools. Each tool maps to one REST endpoint, with the same parameters as the query fields:++| MCP tool | Endpoint | Parameters |+|----------|----------|------------|+| `resolve-library-id` | [Search Library](/api-reference/search/search-for-libraries) — `GET /api/v2/libs/search` | `libraryName`, `query` |+| `query-docs` | [Get Context](/api-reference/context/get-documentation-context) — `GET /api/v2/context` | `libraryId`, `query` |++Call the REST API directly to control requests from your own code, or use the MCP tools when you want an agent to fetch documentation automatically during inference. Both use the same [API key](#authentication).+## Rate Limits- **Without API key**: Low rate limits and no custom configurationdiff --git a/docs/resources/all-clients.mdx b/docs/resources/all-clients.mdxindex d50e8743..74e7f2c4 100644--- a/docs/resources/all-clients.mdx+++ b/docs/resources/all-clients.mdx@@ -30,6 +30,37 @@ To use OAuth, change the endpoint from `/mcp` to `/mcp/oauth` in your client conOAuth is only available for remote HTTP connections. For local MCP connections using stdio transport, use API key authentication instead.+## MCP Tools++The Context7 MCP server exposes two tools. Clients list them under these exact names:++| Tool | Description |+|------|-------------|+| `resolve-library-id` | Resolve a library name to a Context7-compatible library ID |+| `query-docs` | Fetch up-to-date documentation and code examples for a library |++### `resolve-library-id`++Search for a library by name and resolve it to a Context7-compatible library ID (e.g., `/vercel/next.js`). Call this tool before `query-docs` unless the user already provides a library ID in the `/owner/repo` format.++| Parameter | Type | Description |+|-----------|------|-------------|+| `libraryName` | string, required | Library name to search for, with the official punctuation — e.g., `Next.js`, not `nextjs` |+| `query` | string, required | What you want to do with the library, e.g., `set up middleware` |++The tool returns the matching libraries with their ID, title, description, code snippet count, source reputation, benchmark score, and available versions.++### `query-docs`++Fetch documentation context for a library and a specific question.++| Parameter | Type | Description |+|-----------|------|-------------|+| `libraryId` | string, required | Exact Context7-compatible library ID, e.g., `/vercel/next.js` or `/vercel/next.js/v15.1.8` |+| `query` | string, required | What to look up, scoped to a single concept |++The tool returns the relevant documentation and code examples as text.+<AccordionGroup><Accordion title="Claude Code">