Skip to main content
This quickstart guide will get you up and running with Context7 MCP server in your preferred AI coding assistant.
API Key Recommended: Get a free API key at context7.com/dashboard for higher rate limits. Context7 works without an API key, but you’ll have lower rate limits.
The fastest way to set up Context7 is using the ctx7 CLI:
1

Run setup command

This command will:
  • Authenticate via OAuth
  • Generate an API key automatically
  • Configure the MCP server for your detected agents
  • Add a rule to auto-invoke Context7
2

Select your AI coding assistant

The CLI will detect installed agents (Cursor, Claude Code, OpenCode) and let you choose which to configure.You can also target a specific agent:
3

Start using Context7

Restart your AI coding assistant and add use context7 to your prompts:
Or set up a rule to auto-invoke Context7 for all code-related questions.

Manual Setup

If you prefer to configure manually, follow the instructions for your AI coding assistant.
For project-specific configuration instead of global, use the --project flag:
Go to: SettingsCursor SettingsMCPAdd new global MCP serverAdd this configuration to your ~/.cursor/mcp.json file:

Local Server

Since Cursor 1.0, you can also use the one-click install button in the README.

Local Server

Remove --scope user to install for the current project only.
Add this to your OpenCode configuration file:

Local Server

Add an Auto-Invoke Rule

To avoid typing use context7 in every prompt, add a rule to your AI coding assistant: Cursor: Cursor SettingsRules Claude Code: Create or edit CLAUDE.md in your project OpenCode: Configuration rules section

Example Rule

Using Library IDs

If you already know the exact library you want, specify its Context7 ID to skip the library-matching step:
The slash syntax tells the MCP tool exactly which library to load docs for.

Specifying Versions

To get documentation for a specific library version, mention it in your prompt:
Context7 will automatically match the appropriate version.

Verify Installation

1

Restart your AI coding assistant

Close and reopen Cursor, Claude Code, or OpenCode to load the new MCP configuration.
2

Test with a simple prompt

You should see Context7 being invoked to fetch Express.js documentation.
3

Check MCP server logs

Most AI coding assistants show MCP server status in their settings or debug panel. Look for Context7 in the list of active servers.

Troubleshooting

Common Issues:
  • Make sure your API key starts with ctx7sk
  • For local servers, ensure Node.js 18+ is installed
  • Check that your AI coding assistant supports MCP (most recent versions do)
  • Verify the configuration file path is correct for your OS
If Context7 isn’t working:
  1. Check API Key: Get a fresh key from context7.com/dashboard
  2. Check Configuration: Ensure JSON syntax is valid (no trailing commas)
  3. Check Logs: Look for error messages in your AI assistant’s MCP logs
  4. Try Remote Server: Remote servers are more reliable than local ones

Next Steps

Installation Guide

Learn about SDK, CLI, and AI SDK tools installation

API Reference

Explore the REST API for custom integrations