Tutorial

How to Verify Claude Code Loads MCP Tools On Demand

Verify that Claude Code loads MCP tools on demand rather than all at once. Use the /context command to check tool loading behavior.

A viral r/AI_Agents post titled 'Stop Building MCP Servers' argued MCP loads all tools at once, wasting context. That was true for early implementations, but Claude Code now loads tools on demand. This tutorial shows how to verify this behavior and optimize your MCP configuration.

Prerequisites

  • Claude Code installed
  • At least one MCP server configured
  • Scavio API key (optional, for testing)

Walkthrough

Step 1: Add Scavio MCP server

Register Scavio as an MCP server to test with.

Bash
claude mcp add scavio https://mcp.scavio.dev/mcp \
  --header 'x-api-key: YOUR_SCAVIO_KEY'

Step 2: Check registered MCP servers

Verify your MCP servers are registered.

Bash
claude mcp list
# Should show scavio and any other MCP servers
# Each server lists its available tools

Step 3: Test on-demand loading with a non-search prompt

Ask Claude something that does not require search. Check if Scavio tools were loaded.

Bash
# Ask Claude a code question (no search needed):
# 'Write a Python function that reverses a linked list'
#
# Then check context usage:
# Type: /context
#
# You should see that Scavio tools were NOT loaded
# because they were not needed for the task

Step 4: Test on-demand loading with a search prompt

Ask Claude something that requires search. Verify Scavio tools load.

Bash
# Ask Claude a search question:
# 'What is the current pricing for Tavily API?'
#
# Then check context usage:
# Type: /context
#
# Now you should see Scavio tools ARE loaded
# because Claude needed search to answer the question

Step 5: Optimize your MCP configuration

Separate high-frequency and low-frequency MCP servers.

Text
# In .mcp.json, group by frequency:
# High-frequency: search, file operations, git
# Low-frequency: database, deployment, monitoring
#
# Claude Code loads what it needs per task
# You do NOT need to manually unregister servers
# to save context -- on-demand loading handles it

Python Example

Python
# This tutorial is CLI-focused, not code-focused.
# The key insight: Claude Code loads MCP tools on demand.
# You can register many MCP servers without context waste.
# Verify with /context after different types of prompts.

JavaScript Example

JavaScript
// MCP configuration in .mcp.json:
// {"mcpServers": {"scavio": {"url": "https://mcp.scavio.dev/mcp",
//   "headers": {"x-api-key": "YOUR_KEY"}}}}
// Tools load only when Claude decides search is needed.

Expected Output

JSON
Verified that Claude Code loads MCP tools on demand. Non-search prompts do not load Scavio tools. Search prompts load them automatically. No context waste from unused MCP servers.

Related Tutorials

Frequently Asked Questions

Most developers complete this tutorial in 15 to 30 minutes. You will need a Scavio API key (free tier works) and a working Python or JavaScript environment.

Claude Code installed. At least one MCP server configured. Scavio API key (optional, for testing). A Scavio API key gives you 500 free credits per month.

Yes. The free tier includes 500 credits per month, which is more than enough to complete this tutorial and prototype a working solution.

Scavio has a native LangChain package (langchain-scavio), an MCP server, and a plain REST API that works with any HTTP client. This tutorial uses the raw REST API, but you can adapt to your framework of choice.

Start Building

Verify that Claude Code loads MCP tools on demand rather than all at once. Use the /context command to check tool loading behavior.