# How to Set Up MCP Servers for Documentation Lookup in Claude Code: A Complete Guide

> Learn how to set up MCP servers for documentation lookup in Claude Code. Configure servers, set environment variables, and manage your context window for efficient code assistance.

- Repository: [Affaan Mustafa/everything-claude-code](https://github.com/affaan-m/everything-claude-code)
- Tags: how-to-guide
- Published: 2026-03-20

---

**To set up MCP servers for documentation lookup in Claude Code, copy server definitions from [`mcp-configs/mcp-servers.json`](https://github.com/affaan-m/everything-claude-code/blob/main/mcp-configs/mcp-servers.json) into your global `~/.claude.json` configuration, provide required environment variables, and use the `disabledMcpServers` array to disable unused servers and preserve your context window.**

The everything-claude-code repository by affaan-m provides the reference implementation for extending Claude Code with live data through the Model Context Protocol (MCP). Setting up MCP servers for documentation lookup and other integrations involves configuring JSON definitions that specify how Claude invokes external tools like Context7 for real-time library documentation.

## Global User Configuration (~/.claude.json)

Claude Code reads MCP server definitions from a global configuration file located at `~/.claude.json` in your home directory. According to the source code in [`mcp-configs/mcp-servers.json`](https://github.com/affaan-m/everything-claude-code/blob/main/mcp-configs/mcp-servers.json), this file contains a map of server definitions that Claude can invoke to fetch external data.

To enable servers, copy the desired definitions into your global config:

```json
{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp@latest"],
      "description": "Live documentation lookup — use with /docs command and documentation-lookup skill."
    },
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_GITHUB_PAT_HERE" },
      "description": "GitHub operations – PRs, issues, repos"
    },
    "supabase": {
      "command": "npx",
      "args": ["-y", "@supabase/mcp-server-supabase@latest", "--project-ref=YOUR_PROJECT_REF"],
      "description": "Supabase database operations"
    }
  },
  "disabledMcpServers": []
}

```

Only servers listed under `mcpServers` become available in Claude Code sessions. Replace placeholder values with actual credentials and **never commit this file** to version control.

## Project-Level Configuration (.claude.json)

Projects can fine-tune available servers by creating a [`.claude.json`](https://github.com/affaan-m/everything-claude-code/blob/main/.claude.json) file in the repository root. This file inherits global definitions but allows you to override settings or disable specific servers.

The `disabledMcpServers` array, documented in [`mcp-configs/mcp-servers.json`](https://github.com/affaan-m/everything-claude-code/blob/main/mcp-configs/mcp-servers.json) (lines 48-51), lets you exclude heavy or irrelevant servers:

```json
{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp@latest"],
      "description": "Documentation lookup for this project"
    }
  },
  "disabledMcpServers": [
    "clickhouse",
    "browser-use",
    "devfleet"
  ]
}

```

The repository recommends keeping **under 10 MCPs enabled** to preserve Claude's context window and token budget.

## Enabling Documentation Lookup with Context7

The **documentation-lookup** skill provides live library documentation by wrapping the **Context7** MCP server. Implemented in [`skills/documentation-lookup/SKILL.md`](https://github.com/affaan-m/everything-claude-code/blob/main/skills/documentation-lookup/SKILL.md), this skill orchestrates two key operations when you ask library-specific questions:

1. **`resolve-library-id`**: Queries Context7 with the library name and full user query to find the best matching library ID based on name match, benchmark score, reputation, and version.
2. **`query-docs`**: Fetches specific documentation content using the resolved library ID.

The skill caps the number of calls to **3 per question** to minimize context usage (see line 55 of the skill documentation). It also explicitly redacts potential secrets from user prompts before sending queries to third-party services (line 90).

## Configuring Additional MCP Integrations

Beyond documentation, you can enable various integrations by adding their definitions to `~/.claude.json`:

- **GitHub**: Requires `GITHUB_PERSONAL_ACCESS_TOKEN` environment variable for PR and issue automation.
- **Supabase**: Requires `--project-ref` argument matching your Supabase project reference.
- **Browser-use, ClickHouse, Fal-ai**: Specialized servers for web automation, analytics, and AI model inference.

Each server definition follows the same structure: a `command` (usually `npx`), `args` array, optional `env` variables, and a `description` field explaining the server's purpose.

## Adding Custom HTTP-Based MCP Servers

For internal APIs or services that expose HTTP endpoints, define servers with `type: "http"` instead of command-based execution:

```json
"my-custom-api": {
  "type": "http",
  "url": "https://api.myservice.com/mcp",
  "description": "Custom internal API for proprietary data"
}

```

Command-based servers require `command` and `args` arrays, while HTTP servers need only `url` and `type` specifications.

## Security and Performance Best Practices

Follow these guidelines when setting up MCP servers:

- **Never commit secrets**: Store API keys only in `~/.claude.json` outside version control.
- **Limit active servers**: Keep under 10 enabled MCPs to preserve context window, as warned in [`mcp-configs/mcp-servers.json`](https://github.com/affaan-m/everything-claude-code/blob/main/mcp-configs/mcp-servers.json).
- **Version-specific queries**: Include version numbers in questions to help `resolve-library-id` select accurate documentation.
- **Redact sensitive data**: The documentation-lookup skill explicitly scrubs potential secrets from prompts before querying external services.

## Summary

- **MCP server configurations** reside in [`mcp-configs/mcp-servers.json`](https://github.com/affaan-m/everything-claude-code/blob/main/mcp-configs/mcp-servers.json) and must be copied to your global `~/.claude.json` file to activate them.
- **Project-level overrides** use [`.claude.json`](https://github.com/affaan-m/everything-claude-code/blob/main/.claude.json) in the repository root with the `disabledMcpServers` array to disable unnecessary servers.
- **Context7 powers documentation lookup** through the `documentation-lookup` skill, which calls `resolve-library-id` and `query-docs` methods defined in [`skills/documentation-lookup/SKILL.md`](https://github.com/affaan-m/everything-claude-code/blob/main/skills/documentation-lookup/SKILL.md).
- **Environment variables** such as `GITHUB_PERSONAL_ACCESS_TOKEN` provide authentication for services like GitHub and Supabase.
- **Performance constraints** require limiting active servers to under 10 to maintain Claude's context window efficiency.

## Frequently Asked Questions

### What file do I edit to enable MCP servers globally in Claude Code?

Create or edit `~/.claude.json` in your home directory and add server definitions from the repository's [`mcp-configs/mcp-servers.json`](https://github.com/affaan-m/everything-claude-code/blob/main/mcp-configs/mcp-servers.json) file. This global configuration makes servers available across all Claude Code sessions on your machine.

### How does the documentation-lookup skill fetch library information?

The skill calls the Context7 MCP server's `resolve-library-id` method to identify the correct library based on name, version, and relevance scoring, then uses `query-docs` to retrieve specific documentation content. It limits itself to 3 calls per question to conserve context window.

### Why should I disable unused MCP servers?

Each active MCP server consumes tokens from Claude's context window. The repository recommends disabling servers via the `disabledMcpServers` array to stay under the 10-server limit, ensuring optimal performance and preventing context overflow during complex operations.

### Can I use HTTP-based MCP servers instead of command-based ones?

Yes, define servers with `"type": "http"` and provide a `url` field pointing to your MCP endpoint. This avoids spawning npm processes and works well for proprietary internal APIs that expose Model Context Protocol endpoints over HTTP.