Claude Code MCP setup and context management
Learn how Claude Code connects to MCP servers, shares project settings through .mcp.json, and manages the context cost of tool definitions.
Player not loading? Watch on YouTube
This tutorial explains how MCP connects Claude Code to external tools and data sources. Examples include retrieving Linear issue details and using Context7 for dependency documentation. The focus is on giving a coding assistant access to information outside the codebase.
The speaker distinguishes HTTP servers, which connect to remote services over the network, from STDIO servers, which run as local processes on your machine. The setup covers adding servers and using /mcp within a session to inspect connection status or disable servers.
Server scope determines where a configuration applies. Local scope covers the current project for one user; user scope applies across that user's projects. Project scope stores configuration in a .mcp.json file that a team can check into version control.
The final section addresses context costs. According to the speaker, MCP tool definitions consume context even when unused, so disabling unnecessary servers leaves more room for other information. The tutorial suggests CLI equivalents and skills as alternatives for some tasks. It also states that Claude Code switches to tool search when MCP tools exceed 10% of the context window, discovering tools on demand, while warning that this approach may work less well than keeping definitions in context.