docs(AI): Adds PatternFly MCP documentation.#4857
docs(AI): Adds PatternFly MCP documentation.#4857edonehoo wants to merge 14 commits intopatternfly:mainfrom
Conversation
| ``` { | ||
| "mcpServers": { | ||
| "patternfly-docs": { | ||
| "command": "npx", | ||
| "args": [ | ||
| "-y", | ||
| "@patternfly/patternfly-mcp" | ||
| ], | ||
| "description": "PatternFly React development rules and documentation" | ||
| } | ||
| } | ||
| } | ||
| ``` |
There was a problem hiding this comment.
It looks like the very opening { got cut off and the indentation got a little thrown off following that:
| ``` { | |
| "mcpServers": { | |
| "patternfly-docs": { | |
| "command": "npx", | |
| "args": [ | |
| "-y", | |
| "@patternfly/patternfly-mcp" | |
| ], | |
| "description": "PatternFly React development rules and documentation" | |
| } | |
| } | |
| } | |
| ``` | |
| ``` | |
| { | |
| "mcpServers": { | |
| "patternfly-docs": { | |
| "command": "npx", | |
| "args": [ | |
| "-y", | |
| "@patternfly/patternfly-mcp" | |
| ], | |
| "description": "PatternFly React development rules and documentation" | |
| } | |
| } | |
| } | |
| ``` |
| For full technical documentation, setup instructions, and to contribute, visit our [PatternFly MCP GitHub Repository](https://github.com/patternfly/patternfly-mcp). | ||
|
|
||
| ## What is the PatternFly MCP? | ||
| The **PatternFly MCP** is a new tool designed to integrate our design guidelines, component documentation, and accessibility best practices directly into your AI-powered development environment. |
There was a problem hiding this comment.
Seeing "new" in our docs immediately makes me think we're building in tech debt as this becomes dated.
| The **PatternFly MCP** is a new tool designed to integrate our design guidelines, component documentation, and accessibility best practices directly into your AI-powered development environment. | |
| The **PatternFly MCP** is a tool designed to integrate our design guidelines, component documentation, and accessibility best practices directly into your AI-powered development environment. |
| - **Response:** Yes, the PatternFly MCP is running successfully. There are 2 available tools for you to use: `mcp_patternfly-docs_usePatternFlyDocs` and `mcp_patternfly-docs_fetchDocs`. | ||
|
|
||
| ### Fetching specific documentation | ||
| - **Prompt:** "Yes, fetch docs for card" |
There was a problem hiding this comment.
This was copy/pasted as a direct follow-up to the output from the "verifying installation" prompt above, but we've reframed these here as unrelated sample prompts so I'd suggest rewording this as an independent prompt:
| - **Prompt:** "Yes, fetch docs for card" | |
| - **Prompt:** "Fetch docs for PatternFly card" |
| - **Response:** “Here’s the current PatternFly card documentation, including the general design guidelines and key accessibility requirements: [documentation summary]“ | ||
|
|
||
| ### Get design guidance | ||
| - **Prompt:** "Which components should I use if we want a user to be able to select several different cards from a gallery view?" |
There was a problem hiding this comment.
User feedback indicated that the PF MCP isn't always used (the AI tool has to make that decision) so tweaking the prompt from those results to explicitly call out PatternFly could lead to more consistent results:
| - **Prompt:** "Which components should I use if we want a user to be able to select several different cards from a gallery view?" | |
| - **Prompt:** "Which PatternFly components should I use if we want a user to be able to select several different cards from a gallery view?" |
evwilkin
left a comment
There was a problem hiding this comment.
Added a few small tweaks to help adopt this from our testing overview to our official docs.
One thing potentially missing here is that we're focusing on direct communication with the MCP in all examples - asking it a question and getting an answer to that question. I'd suspect the more common use case is having this work in the background as an always-on reference that's incorporated into existing workflows. For example, a designer vibe coding a design or interactive POC, or developer building/enhancing a product codebase, that automatically pulls in the correct components, props, accessibility considerations, etc. without them needing to specifically ask what that is but just for the agent to be aware of & use that information.
I originally tried to hint at this with the below statement, but not sure how to more clearly indicate the power of the MCP as the magic behind the curtain rather than just a chatbot-style interaction
Here are a few sample prompts to get you started, but the MCP tools are available for reference by your AI agent across all applicable use cases (code generation, design review, etc.):
packages/documentation-site/patternfly-docs/content/PatternFly-AI/patternfly-mcp.md
Outdated
Show resolved
Hide resolved
|
I couldn't get the mcp set up in cursor myself until I added |
@nicolethoen it looks like I was hitting an error with @latest due to a caching issue, clearing my npm cache and trying again with @latest worked just fine 👍 |
|
This should be rebased given the nav redesign - and this page should go under |
|
@evwilkin @nicolethoen I added |
packages/documentation-site/patternfly-docs/content/AI/patternfly-mcp.md
Outdated
Show resolved
Hide resolved
packages/documentation-site/patternfly-docs/content/AI/patternfly-mcp.md
Outdated
Show resolved
Hide resolved
packages/documentation-site/patternfly-docs/content/AI/patternfly-mcp.md
Outdated
Show resolved
Hide resolved
packages/documentation-site/patternfly-docs/content/AI/patternfly-mcp.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Evan <8651509+evwilkin@users.noreply.github.com>
|
@edonehoo following up on this, the tools in the MCP are being finalized in the next week or two and at that point we should be good to update the wording here and move forward - thanks for the patience! 😄 |
| ## What does the PatternFly MCP provide? | ||
| There are 2 main tools provided by the PatternFly MCP: | ||
| - `usePatternFlyDocs`: Used to answer high-level questions about components, design guidelines, and accessibility. | ||
| - `fetchDocs`: Used to retrieve the full documentation for a specific component via a URL provided by `usePatternFlyDocs`. |
There was a problem hiding this comment.
the tools and resources have evolved a bit, just need to update the names and descriptions
possible description
## What does the PatternFly MCP provide?
The PatternFly MCP provides two primary tools and a set of rich resources:
possible tool descriptions
### Tools
- `searchPatternFlyDocs`: Search for PatternFly components and guidelines. It returns names and URLs that can be used for deep-diving into specific documentation.
- `usePatternFlyDocs`: The primary tool for retrieving content. It fetches full markdown documentation and automatically attaches machine-readable JSON schemas (props, types) for React components.
possible resource description adds (MCP resources help power the MCP tools, can think of them as indexes... we have more than what's below, just a short list)
### Resources
The server exposes an indexed library via the `patternfly://` URI scheme:
- `patternfly://context`: A high-level overview of PatternFly rules and server capabilities.
- `patternfly://schemas/{name}`: Direct access to component property specifications.
- `patternfly://docs/index`: A browsable index of all available documentation.
There was a problem hiding this comment.
@edonehoo you may have overlooked this, i put 3 updates in the comment... the MCP tools have been renamed and restructured for different behavior
usePatternFlyDocsis now about retrieving contentfetchDocsdoesn't exist
### Tools
- `searchPatternFlyDocs`: Search for PatternFly components and guidelines. It returns names and URLs that can be used for deep-diving into specific documentation.
- `usePatternFlyDocs`: The primary tool for retrieving content. It fetches full markdown documentation and automatically attaches machine-readable JSON schemas (props, types) for React components.
packages/documentation-site/patternfly-docs/content/AI/patternfly-mcp.md
Outdated
Show resolved
Hide resolved
packages/documentation-site/patternfly-docs/content/AI/patternfly-mcp.md
Outdated
Show resolved
Hide resolved
|
ty @cdcabrera ! I made those updates, but we can keep refining as needed |
cdcabrera
left a comment
There was a problem hiding this comment.
The MCP tools are the primary thing that need to be updated
| ## What does the PatternFly MCP provide? | ||
| There are 2 main tools provided by the PatternFly MCP: | ||
| - `usePatternFlyDocs`: Used to answer high-level questions about components, design guidelines, and accessibility. | ||
| - `fetchDocs`: Used to retrieve the full documentation for a specific component via a URL provided by `usePatternFlyDocs`. |
There was a problem hiding this comment.
@edonehoo you may have overlooked this, i put 3 updates in the comment... the MCP tools have been renamed and restructured for different behavior
usePatternFlyDocsis now about retrieving contentfetchDocsdoesn't exist
### Tools
- `searchPatternFlyDocs`: Search for PatternFly components and guidelines. It returns names and URLs that can be used for deep-diving into specific documentation.
- `usePatternFlyDocs`: The primary tool for retrieving content. It fetches full markdown documentation and automatically attaches machine-readable JSON schemas (props, types) for React components.
packages/documentation-site/patternfly-docs/content/AI/patternfly-mcp.md
Outdated
Show resolved
Hide resolved
packages/documentation-site/patternfly-docs/content/AI/patternfly-mcp.md
Outdated
Show resolved
Hide resolved
packages/documentation-site/patternfly-docs/content/AI/patternfly-mcp.md
Outdated
Show resolved
Hide resolved
|
@cdcabrera ah, my bad! Could've sworn I made those changes, but I must have been half awake 😅 I think I just got to the remainder of what you commented -- lmk if I missed anything. I also added a few links to the repo to try and increase visibility to some of those docs, but we can back those out if you think it's not helpful or if the links are too likely to change |
Closes #4844
This PR adds a new page to patternfly.org in the PatternFly AI section explaining & overviewing the PatternFly MCP.
Preview: https://pf-org--pr-4857-site.surge.sh/ai/patternfly-mcp