{
  "@context": "https://schema.org",
  "@id": "https://aggr.aymericbeaumet.com/items/ampcode-com/2026-01-08-efficient-mcp-tool-loading/#webpage",
  "@type": [
    "WebPage",
    "ArchiveComponent"
  ],
  "articleBody": "MCP servers often provide a lot of tools, many of which aren't used. That costs a lot of tokens, because these tool definitions have to be inserted into the context window whether they're used by the agent or not.\n\nAs an example: the [chrome-devtools MCP](https://github.com/ChromeDevTools/chrome-devtools-mcp) currently provides 26 tools that together take up 17k tokens; that's 10% of Opus 4.5's context window and 26 tools isn't even a lot for many MCP servers.\n\nTo help with that, Amp now allows you to combine MCP server configurations with [Agent Skills](https://ampcode.com/news/agent-skills), allowing the agent to load an MCP server's tool definitions only when the skill is invoked.\n\n## How It Works\n\nCreate an `mcp.json` file in the skill definition, next to the `SKILL.md` file, containing the MCP servers and tools you want the agent to load along with the skill:\n\n```json\n{\n\t\"chrome-devtools\": {\n\t\t\"command\": \"npx\",\n\t\t\"args\": [\"-y\", \"chrome-devtools-mcp@latest\"],\n\t\t\"includeTools\": [\n\t\t\t// Tool names or glob patterns\n\t\t\t\"navigate_page\",\n\t\t\t\"take_screenshot\",\n\t\t\t\"new_page\",\n\t\t\t\"list_pages\"\n\t\t]\n\t}\n}\n```\n\nAt the start of a thread, all the agent will see in the context window is the skill description. When (and if) it then invokes the skill, Amp will append the tool descriptions matching the `includeTools` list to the context window, making them available just in time.\n\nWith this specific configuration, instead of loading all 26 tools that `chrome-devtools` provides, we instead load only four tools, **taking up 1.5k tokens instead of 17k**.\n\nTake a look at our [ui-preview skill](https://github.com/ampcode/amp-contrib/tree/main/.agents/skills/ui-preview), that makes use of the `chrome-devtools` MCP, for a full example.\n\nIf you want to learn more about skills in Amp, take a look [at the Agent Skills section in the manual](https://ampcode.com/manual#agent-skills).\n\nTo find out more about the implementation of this feature and how we arrived at it, read [this blog post by Nicolay](https://nicolaygerold.com/posts/tool-search-is-dead-long-live-skills).\n",
  "authors": [],
  "captured_at": "2026-10-03T23:09:50.514863041+00:00",
  "category": "programming",
  "content_html": "<p>MCP servers often provide a lot of tools, many of which aren't used. That costs a lot of tokens, because these tool definitions have to be inserted into the context window whether they're used by the agent or not.</p>\n<p>As an example: the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/ChromeDevTools/chrome-devtools-mcp\">chrome-devtools MCP</a> currently provides 26 tools that together take up 17k tokens; that's 10% of Opus 4.5's context window and 26 tools isn't even a lot for many MCP servers.</p>\n<p>To help with that, Amp now allows you to combine MCP server configurations with <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://ampcode.com/news/agent-skills\">Agent Skills</a>, allowing the agent to load an MCP server's tool definitions only when the skill is invoked.</p>\n<h2>How It Works</h2>\n<p>Create an <code>mcp.json</code> file in the skill definition, next to the <code>SKILL.md</code> file, containing the MCP servers and tools you want the agent to load along with the skill:</p>\n<pre><code class=\"language-json\"><span class=\"code-snippet\" data-language=\"JSON\"><span class=\"syntax-source syntax-json\"><span class=\"syntax-meta syntax-structure syntax-dictionary syntax-json\"><span class=\"syntax-punctuation syntax-section syntax-dictionary syntax-begin syntax-json\">{</span>\n\t<span class=\"syntax-meta syntax-structure syntax-dictionary syntax-key syntax-json\"><span class=\"syntax-string syntax-quoted syntax-double syntax-json\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-json\">&quot;</span>chrome-devtools<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-json\">&quot;</span></span></span><span class=\"syntax-meta syntax-structure syntax-dictionary syntax-value syntax-json\"><span class=\"syntax-punctuation syntax-separator syntax-dictionary syntax-key-value syntax-json\">:</span> <span class=\"syntax-meta syntax-structure syntax-dictionary syntax-json\"><span class=\"syntax-punctuation syntax-section syntax-dictionary syntax-begin syntax-json\">{</span>\n\t\t<span class=\"syntax-meta syntax-structure syntax-dictionary syntax-key syntax-json\"><span class=\"syntax-string syntax-quoted syntax-double syntax-json\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-json\">&quot;</span>command<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-json\">&quot;</span></span></span><span class=\"syntax-meta syntax-structure syntax-dictionary syntax-value syntax-json\"><span class=\"syntax-punctuation syntax-separator syntax-dictionary syntax-key-value syntax-json\">:</span> <span class=\"syntax-string syntax-quoted syntax-double syntax-json\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-json\">&quot;</span>npx<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-json\">&quot;</span></span><span class=\"syntax-punctuation syntax-separator syntax-dictionary syntax-pair syntax-json\">,</span></span>\n\t\t<span class=\"syntax-meta syntax-structure syntax-dictionary syntax-key syntax-json\"><span class=\"syntax-string syntax-quoted syntax-double syntax-json\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-json\">&quot;</span>args<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-json\">&quot;</span></span></span><span class=\"syntax-meta syntax-structure syntax-dictionary syntax-value syntax-json\"><span class=\"syntax-punctuation syntax-separator syntax-dictionary syntax-key-value syntax-json\">:</span> <span class=\"syntax-meta syntax-structure syntax-array syntax-json\"><span class=\"syntax-punctuation syntax-section syntax-array syntax-begin syntax-json\">[</span><span class=\"syntax-string syntax-quoted syntax-double syntax-json\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-json\">&quot;</span>-y<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-json\">&quot;</span></span><span class=\"syntax-punctuation syntax-separator syntax-array syntax-json\">,</span> <span class=\"syntax-string syntax-quoted syntax-double syntax-json\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-json\">&quot;</span>chrome-devtools-mcp@latest<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-json\">&quot;</span></span><span class=\"syntax-punctuation syntax-section syntax-array syntax-end syntax-json\">]</span></span><span class=\"syntax-punctuation syntax-separator syntax-dictionary syntax-pair syntax-json\">,</span></span>\n\t\t<span class=\"syntax-meta syntax-structure syntax-dictionary syntax-key syntax-json\"><span class=\"syntax-string syntax-quoted syntax-double syntax-json\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-json\">&quot;</span>includeTools<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-json\">&quot;</span></span></span><span class=\"syntax-meta syntax-structure syntax-dictionary syntax-value syntax-json\"><span class=\"syntax-punctuation syntax-separator syntax-dictionary syntax-key-value syntax-json\">:</span> <span class=\"syntax-meta syntax-structure syntax-array syntax-json\"><span class=\"syntax-punctuation syntax-section syntax-array syntax-begin syntax-json\">[</span>\n\t\t\t<span class=\"syntax-comment syntax-line syntax-double-slash syntax-js\"><span class=\"syntax-punctuation syntax-definition syntax-comment syntax-json\">//</span> Tool names or glob patterns\n</span>\t\t\t<span class=\"syntax-string syntax-quoted syntax-double syntax-json\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-json\">&quot;</span>navigate_page<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-json\">&quot;</span></span><span class=\"syntax-punctuation syntax-separator syntax-array syntax-json\">,</span>\n\t\t\t<span class=\"syntax-string syntax-quoted syntax-double syntax-json\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-json\">&quot;</span>take_screenshot<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-json\">&quot;</span></span><span class=\"syntax-punctuation syntax-separator syntax-array syntax-json\">,</span>\n\t\t\t<span class=\"syntax-string syntax-quoted syntax-double syntax-json\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-json\">&quot;</span>new_page<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-json\">&quot;</span></span><span class=\"syntax-punctuation syntax-separator syntax-array syntax-json\">,</span>\n\t\t\t<span class=\"syntax-string syntax-quoted syntax-double syntax-json\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-json\">&quot;</span>list_pages<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-json\">&quot;</span></span>\n\t\t<span class=\"syntax-punctuation syntax-section syntax-array syntax-end syntax-json\">]</span></span>\n\t</span><span class=\"syntax-punctuation syntax-section syntax-dictionary syntax-end syntax-json\">}</span></span>\n</span><span class=\"syntax-punctuation syntax-section syntax-dictionary syntax-end syntax-json\">}</span></span>\n</span></span></code></pre>\n<p>At the start of a thread, all the agent will see in the context window is the skill description. When (and if) it then invokes the skill, Amp will append the tool descriptions matching the <code>includeTools</code> list to the context window, making them available just in time.</p>\n<p>With this specific configuration, instead of loading all 26 tools that <code>chrome-devtools</code> provides, we instead load only four tools, <strong>taking up 1.5k tokens instead of 17k</strong>.</p>\n<p>Take a look at our <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/ampcode/amp-contrib/tree/main/.agents/skills/ui-preview\">ui-preview skill</a>, that makes use of the <code>chrome-devtools</code> MCP, for a full example.</p>\n<p>If you want to learn more about skills in Amp, take a look <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://ampcode.com/manual#agent-skills\">at the Agent Skills section in the manual</a>.</p>\n<p>To find out more about the implementation of this feature and how we arrived at it, read <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://nicolaygerold.com/posts/tool-search-is-dead-long-live-skills\">this blog post by Nicolay</a>.</p>\n",
  "content_markdown": "MCP servers often provide a lot of tools, many of which aren't used. That costs a lot of tokens, because these tool definitions have to be inserted into the context window whether they're used by the agent or not.\n\nAs an example: the [chrome-devtools MCP](https://github.com/ChromeDevTools/chrome-devtools-mcp) currently provides 26 tools that together take up 17k tokens; that's 10% of Opus 4.5's context window and 26 tools isn't even a lot for many MCP servers.\n\nTo help with that, Amp now allows you to combine MCP server configurations with [Agent Skills](https://ampcode.com/news/agent-skills), allowing the agent to load an MCP server's tool definitions only when the skill is invoked.\n\n## How It Works\n\nCreate an `mcp.json` file in the skill definition, next to the `SKILL.md` file, containing the MCP servers and tools you want the agent to load along with the skill:\n\n```json\n{\n\t\"chrome-devtools\": {\n\t\t\"command\": \"npx\",\n\t\t\"args\": [\"-y\", \"chrome-devtools-mcp@latest\"],\n\t\t\"includeTools\": [\n\t\t\t// Tool names or glob patterns\n\t\t\t\"navigate_page\",\n\t\t\t\"take_screenshot\",\n\t\t\t\"new_page\",\n\t\t\t\"list_pages\"\n\t\t]\n\t}\n}\n```\n\nAt the start of a thread, all the agent will see in the context window is the skill description. When (and if) it then invokes the skill, Amp will append the tool descriptions matching the `includeTools` list to the context window, making them available just in time.\n\nWith this specific configuration, instead of loading all 26 tools that `chrome-devtools` provides, we instead load only four tools, **taking up 1.5k tokens instead of 17k**.\n\nTake a look at our [ui-preview skill](https://github.com/ampcode/amp-contrib/tree/main/.agents/skills/ui-preview), that makes use of the `chrome-devtools` MCP, for a full example.\n\nIf you want to learn more about skills in Amp, take a look [at the Agent Skills section in the manual](https://ampcode.com/manual#agent-skills).\n\nTo find out more about the implementation of this feature and how we arrived at it, read [this blog post by Nicolay](https://nicolaygerold.com/posts/tool-search-is-dead-long-live-skills).\n",
  "dateCreated": "2026-10-03T23:09:50.514863041+00:00",
  "date_created": "2026-01-08T00:00:00+00:00",
  "date_modified": "2026-01-08T00:00:00+00:00",
  "date_published": "2026-01-08T00:00:00+00:00",
  "description": "MCP servers often provide a lot of tools, many of which aren't used. That costs a lot of tokens, because these tool definitions have to be inserted into the context window whether they're used by the agent or not. As an example: the…",
  "external_url": "https://ampcode.com/news/lazy-load-mcp-with-skills",
  "git": {
    "commit": "ebb0941c5c06a2ab2377342d607535262a3e969e",
    "path": "items/ampcode-com/2026/01/2026-01-08-efficient-mcp-tool-loading.md",
    "permalink": "https://github.com/aymericbeaumet/aggr-instance/blob/ebb0941c5c06a2ab2377342d607535262a3e969e/items/ampcode-com/2026/01/2026-01-08-efficient-mcp-tool-loading.md"
  },
  "id": "urn:aggr:item:01ce3acce36d19df5a2f82403ad98dea678945a1",
  "isBasedOn": {
    "@id": "https://ampcode.com/news/lazy-load-mcp-with-skills"
  },
  "mainEntity": {
    "@id": "https://ampcode.com/news/lazy-load-mcp-with-skills",
    "@type": "CreativeWork",
    "archivedAt": {
      "@id": "https://aggr.aymericbeaumet.com/items/ampcode-com/2026-01-08-efficient-mcp-tool-loading/#webpage"
    },
    "dateModified": "2026-01-08T00:00:00+00:00",
    "datePublished": "2026-01-08T00:00:00+00:00",
    "headline": "Efficient MCP Tool Loading",
    "timeRequired": "PT2M",
    "url": "https://ampcode.com/news/lazy-load-mcp-with-skills",
    "wordCount": 296
  },
  "name": "Archived snapshot: Efficient MCP Tool Loading",
  "preview": null,
  "reading_minutes": 2,
  "replicated_at": null,
  "source": "ampcode-com",
  "source_name": "Amp News",
  "summary": "MCP servers often provide a lot of tools, many of which aren't used. That costs a lot of tokens, because these tool definitions have to be inserted into the context window whether they're used by the agent or not. As an example: the chrome-devtools MCP currently provides 26 tools that together take up 17k tokens; that's 10% of Opus 4.5's context window and 26 tools isn't even a lot for many MCP servers. To help with that, Amp now allows you to combine MCP server configurations with Agent Skills, allowing the agent to load an MCP server's tool definitions only when the skill is invoked. How It Works Create an mcp.json file in the skill definition, next to the SKILL.md file, containing the MCP servers and tools you want the agent to load along with the skill: { \"chrome-devtools\": { \"command\": \"npx\", \"args\": [\"-y\", \"chrome-devtools-mcp@latest\"], \"includeTools\": [ // Tool names or glob patterns \"navigate_page\", \"take_screenshot\", \"new_page\", \"list_pages\" ] } } At the start of a thread, all the agent will see in the context window is the skill description. When (and if) it then invokes the skill, Amp will append the tool descriptions matching the includeTools list to the context window, making them available just in time. With this specific configuration, instead of loading all 26 tools that chrome-devtools provides, we instead load only four tools, taking up 1.5k tokens instead of 17k. Take a look at our ui-preview skill, that makes use of the chrome-devtools MCP, for a full example. If you want to learn more about skills in Amp, take a look at the Agent Skills section in the manual. To find out more about the implementation of this feature and how we arrived at it, read this blog post by Nicolay.",
  "tags": [],
  "temporalCoverage": "2026-10-03T23:09:50.514863041+00:00",
  "title": "Efficient MCP Tool Loading",
  "url": "https://aggr.aymericbeaumet.com/items/ampcode-com/2026-01-08-efficient-mcp-tool-loading/",
  "word_count": 296
}