This guide covers how to set up the Context7 MCP server locally for development and testing.Documentation Index
Fetch the complete documentation index at: https://context7.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Getting Started
Clone the project and install dependencies:CLI Arguments
context7-mcp accepts the following CLI flags:
| Flag | Description | Default |
|---|---|---|
--transport <stdio|http> | Transport to use. Use http for remote HTTP server or stdio for local integration. | stdio |
--port <number> | Port to listen on when using http transport. | 3000 |
--api-key <key> | API key for authentication (or set CONTEXT7_API_KEY env var). | - |
Get your API key by creating an account at context7.com/dashboard.
Examples
HTTP transport on port 8080:Environment Variables
You can use theCONTEXT7_API_KEY environment variable instead of passing the --api-key flag. This is useful for:
- Storing API keys securely in
.envfiles - Integration with MCP server setups that use dotenv
- Tools that prefer environment variable configuration