Skip to content

Conversation

@ax-vasquez
Copy link

@ax-vasquez ax-vasquez commented Sep 27, 2025

This PR aims to:

  1. Remove the need for the user to bootstrap their own environment to ensure the server is used
  2. Implement a rough-draft prompt to be used as the root server prompt

Testing

  1. Delete anything in your test project CLAUDE.md files (or similar) instructing it to use the MCP server explicitly (to make sure the root server prompt is used)
  2. pnpm run storybook
  3. In the test separate project (and using Claude Code, already configured to use this MCP server) > Ask it to help you create a new Storybook file
  4. Claude Code should respond and ask you to use the get_ui_building_instructions tool

Screenshot:
Screenshot 2025-09-27 at 6 55 58 PM

Additional Context

This prompt setup is modeled after the setup I used in a side project MCP server I've been working on here:

Through testing, I can confirm that the prompt added like this does in fact make the MCP server be used very proactively. It was actually a bit too strong at first and would get used for things it wasn't exactly intended for.

Why is the prompt so long?

I modeled the prompt loosely after Notion's MCP server tools which are very specific and quite lengthy. That being said, it seems this approach is generally better since it removes most of the need for the user to have lengthy back-and-forths with the tool to get a usable response.

Going further

Each description field on the tools should probably have a similarly-specific prompt, but I wanted to start with a baseline that we can iterate on first. Let me know what you think!

@changeset-bot
Copy link

changeset-bot bot commented Sep 27, 2025

⚠️ No Changeset found

Latest commit: 5af8834

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ax-vasquez
Copy link
Author

@JReinhold @shilman I am not locked into the current prompt, but it does work as-intended. I just took a first-pass loosely-modeled after what I've seen Notion use. Their MCP server has worked well for me.

Looking forward to hearing your thoughts!

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!! I'll let @JReinhold test but the change makes sense and LGTM. However, we'd also want to update the README as part of this change too, right?

@ax-vasquez
Copy link
Author

Ohhhh yeah good call! I'll push up the change 👍

@ax-vasquez ax-vasquez requested a review from shilman September 28, 2025 05:27
@ax-vasquez
Copy link
Author

Just some added context!

I was having trouble getting the MCP server to be used automatically, but I think Claude is just acting a little strange. It wasn't using the tool automatically, but now that I've made a few stories, it seems to have picked up that I want to use the tool.

That being said, I do think this prompt change will be helpful! Been using the MCP server to add a bunch of stories to my blog site this weekend and it's been going well!

Copy link
Contributor

@JReinhold JReinhold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh this is really interesting, thank you! I didn't know MCP servers supported root instructions like this, is there any way I can read up on this? I can't really find documentation about this anywhere. Is this supported by all clients?

@ax-vasquez
Copy link
Author

ax-vasquez commented Oct 6, 2025

@JReinhold sorry for the delay here! I haven't been able to poke at MCP stuff as much as I would have liked to recently, but as far as I know, that instructions field wasn't documented online that I could find. I found it by checking into the types provided by the Model Context Protocol package and tested it out.

The documentation also doesn't really mention what the description field is on each tool, either (aside from mentioning it exists and is a "description"). It seemed to me that maybe they just hadn't gotten around to documenting it further yet 🤷

@ax-vasquez
Copy link
Author

I've been testing this out lately with the update to Sonnet 4.5 and have been seeing some issues where it's not applying the prompt anymore. When I ask it why didn't use the server, it gives me the usual "You're absolutely right!" junk.

But it goes on to say that it jumped right into evaluating the code, which seems to somehow be making it opt to not use the server unless explicitly asked. Doing some testing to see if I can tweak the prompt! I have switched it to using Markdown locally, but I don't think that's the issue here - there have been some updates to the models I've been using, so I suspect it's related.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think something weird happened when resolving the file conflicts earlier - I will update this! Just need to make sure we don't include docs on modifying their AGENT.md and/or their CLAUDE.md files since it should no longer be required. Need to step out for some errands, but will get to this later!

@ax-vasquez ax-vasquez requested a review from JReinhold October 26, 2025 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants