Skip to content

Add server instructions #144

@JReinhold

Description

@JReinhold

As originally attempted in #18, we should use tmcp's API to add server instructions to both @storybok/addon-mcp and @storybook/mcp: https://github.com/paoloricciuti/tmcp/blob/94911059f6884bcaa7b1a7c070d2180d54586064/apps/docs/src/content/core/100-mcp-server.md#server-instructions

The purpose is two-fold:

  1. Claude Code recently announced a Tool Search Tool, which among other things means that server instructions are more important: https://x.com/trq212/article/2011523109871108570 . We need the instructions to be precise, and help agents use the MCP servers' tools correctly
  2. We want the agents to use the MCP server as much as possible when valuable, without requiring the user to specifically call out the Storybook MCP server in either the main prompt or system prompt. The theory is, that server instructions can help with that.

For 2, we want one or more eval tasks that grades if the agent used the MCP server tools correctly without requiring explicit guidance to do so.

Announcement

Today we're rolling out MCP Tool Search for Claude Code.

As MCP has grown to become a more popular protocol and agents have become more capable, we've found that MCP servers may have up to 50+ tools and take up a large amount of context.
Tool Search allows Claude Code to dynamically load tools into context when MCP tools would otherwise take up a lot of context.
How it works:

  • Claude Code detects when your MCP tool descriptions would use more than 10% of context
  • When triggered, tools are loaded via search instead of preloaded

Otherwise, MCP tools work exactly as before.
This resolves one of our most-requested features on GitHub: lazy loading for MCP servers. Users were documenting setups with 7+ servers consuming 67k+ tokens.

If you're making a MCP server
Things are mostly the same, but the "server instructions" field becomes more useful with tool search enabled. It helps Claude know when to search for your tools, similar to skills

If you're making a MCP client
We highly suggest implementing the ToolSearchTool, you can find the docs here. We implemented it with a custom search function to make it work for Claude Code.

What about programmatic tool calling?
We experimented with doing programmatic tool calling such that MCP tools could be composed with each other via code. While we will continue to explore this in the future, we felt the most important need was to get Tool Search out to reduce context usage.
Tell us what you think here or on Github as you see the ToolSearchTool work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions