-
Notifications
You must be signed in to change notification settings - Fork 145
docs(AI): Adds PatternFly MCP documentation. #4857
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
edonehoo
wants to merge
9
commits into
patternfly:main
Choose a base branch
from
edonehoo:iss4844
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+116
−0
Open
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e05183b
docs(AI): Adds PatternFly MCP documentation.
edonehoo 75e1887
Content updates from pr review
edonehoo 9b4a216
adjust patternfly-docs to patternfly-mcp
edonehoo 62e8780
Merge branch 'main' into iss4844
edonehoo f5bc90a
Merge branch 'main' into iss4844
edonehoo 035cf44
Update nav placement and add @latest to args
edonehoo c61c6be
Apply suggestions from code review
edonehoo db551af
Merge branch 'main' into iss4844
edonehoo 2d56eea
Merge branch 'main' into iss4844
edonehoo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
packages/documentation-site/patternfly-docs/content/AI/img/claude-mcp-servers.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions
9
packages/documentation-site/patternfly-docs/content/AI/img/cursor-mcp-settings.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
99 changes: 99 additions & 0 deletions
99
packages/documentation-site/patternfly-docs/content/AI/patternfly-mcp.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| --- | ||
| id: PatternFly MCP | ||
| section: AI | ||
| --- | ||
| import '../components/components.css'; | ||
|
|
||
| This guide provides an overview of the PatternFly MCP server, including its benefits and instructions for setting up the tool. | ||
|
|
||
| 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 tool designed to integrate our design guidelines, component documentation, and accessibility best practices directly into your AI-powered development environment. | ||
|
|
||
| MCP stands for Model Context Protocol, an open standard that allows AI assistants to securely and accurately access external data sources and tools. The PatternFly MCP is a server that connects your AI assistant (like those within Cursor or Claude Code) directly to official PatternFly documentation. Instead of relying on a model's potentially outdated or overgeneralized knowledge, your assistant can query the PatternFly MCP to get answers based on real, up-to-date, and verified sources. | ||
|
|
||
| Beyond offering these enhanced AI assistant conversations, the PatternFly MCP can also work in the background and incorporate into your existing workflows. For example, it can ensure that vibe coding will automatically utilize the latest and most applicable PatternFly elements, without requiring you to specifically ask an assistant to do so. It will quietly supply an assistant with the information necessary to make these recommendations and decisions. | ||
|
|
||
| ## What are the benefits of the PatternFly MCP? | ||
|
|
||
| This tool is valuable for developers, designers, and other stakeholders, like product managers. This can look different depending on your needs, but the primary benefit is trust. The PatternFly MCP helps reduce AI "hallucinations" by ensuring the answers you receive are quoted directly from our documentation and are linked to the correct sources. | ||
|
|
||
| - **For developers:** Receive quick and accurate information about component props, implementation details, and accessibility requirements. The PatternFly MCP can also help validate component usage or choose the right component for a specific need. | ||
| - **For designers:** Quickly reference design guidelines and usage patterns while you work. You can ask for best practices, such as "Which component should I use for a gallery view?", and get answers rooted in our official standards. | ||
| - **For stakeholders:** By embedding the design system directly into the development workflow, the PatternFly MCP ensures consistency and adherence to design and accessibility standards across all projects. This speeds up development and review cycles by reducing errors and guesswork. | ||
|
|
||
| ## 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`. | ||
|
|
||
| ## Get started | ||
| You can install the PatternFly MCP in your preferred development environment. Here are the instructions for popular clients. | ||
|
|
||
| ### Cursor | ||
| 1. While in Cursor, press **cmd** + **shift** +**P**. | ||
| 1. Search for and select **View: Open MCP Settings**. | ||
| 1. At the bottom of the settings menu, click **New MCP Server** to open the `mcp.json` file. | ||
| 1. Add the following JSON block within the `mcpServers` object. If `mcpServers` already exists, just add the `patternfly-mcp` block inside it. | ||
|
|
||
| ``` | ||
| { | ||
| "mcpServers": { | ||
| "patternfly-mcp": { | ||
| "command": "npx", | ||
| "args": [ | ||
| "-y", | ||
| "@patternfly/patternfly-mcp", | ||
| "@latest" | ||
edonehoo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ], | ||
| "description": "PatternFly React development rules and documentation" | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
| 1. Save and close mcp.json. The MCP Settings will now show "patternfly-mcp" as an installed server with its tools enabled. | ||
| <br/ ><br/ > | ||
| <div class="ws-docs-content-img"> | ||
|  | ||
| </div> | ||
|
|
||
| ### Claude Code | ||
|
|
||
| 1. From your terminal (before opening Claude Code), run the `claude mcp add` command with your preferred configuration: | ||
| - To install the server globally (recommended, so it's available across all your projects), use the `-s user` flag: | ||
| ```claude mcp add patternfly-mcp -s user -- npx -y @patternfly/patternfly-mcp @latest``` | ||
edonehoo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - To install for the current project only, run: | ||
| ```claude mcp add patternfly-mcp -- npx -y @patternfly/patternfly-mcp @latest``` | ||
edonehoo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 1. Open Claude Code by typing `claude`. | ||
| 1. Inside Claude Code, type the `/mcp` command to view and manage your running MCP servers. You should see `patternfly-mcp` listed as "connected". | ||
| <br/ ><br/ > | ||
| <div class="ws-docs-content-img"> | ||
|  | ||
| </div> | ||
|
|
||
| ## Example prompts | ||
| Once installed, you can begin asking questions in your chat window and the PatternFly MCP will automatically be referenced for PatternFly-related requests. You can use the PatternFly MCP’s tools for a range of use cases, but here are a few sample scenarios to explore: | ||
|
|
||
| ### Verifying installation | ||
| - **Prompt:** "Can you see the PF MCP running? If so, what are the tools?" | ||
| - **Expected AI behavior:** The assistant will confirm it sees the PatternFly MCP and list the available tools: mcp_patternfly-mcp_usePatternFlyDocs and mcp_patternfly-mcp_fetchDocs. | ||
| - **Response:** Yes, the PatternFly MCP is running successfully. There are 2 available tools for you to use: `mcp_patternfly-mcp_usePatternFlyDocs` and `mcp_patternfly-mcp_fetchDocs`. | ||
|
|
||
| ### Fetching specific documentation | ||
| - **Prompt:** "Fetch docs for a PatternFly card" | ||
| - **Expected AI behavior:** This will trigger the `fetchDocs` tool. The assistant will return a detailed, organized summary of the card component's documentation, including design guidelines (elements, usage, variations), accessibility guidelines (key requirements, React props), and more. | ||
| - **Response:** “Here’s the current PatternFly card documentation, including the general design guidelines and key accessibility requirements: [documentation summary]“ | ||
|
|
||
| ### Get design guidance | ||
| - **Prompt:** "Which PatternFly components should I use if we want a user to be able to select several different cards from a gallery view?" | ||
| - **Expected AI behavior:** This will trigger the `usePatternFlyDocs tool`. The AI assistant will analyze your request and provide a recommendation based on PatternFly's design guidelines, likely suggesting the use of selectable cards and noting that multi-select is achieved using cards with checkboxes. | ||
| - **Response:** “If you want to let users select several cards within a gallery view, you could use the selectable cards variation, which would allow multiple card selection via checkboxes that are placed within a card’s header.” | ||
|
|
||
| ## Experimentation and feedback | ||
|
|
||
| The PatternFly MCP is still an evolving experiment, and we'd love to learn from your experiences: | ||
| - Share your feedback and experiences on our [GitHub discussions board](https://github.com/orgs/patternfly/discussions). | ||
| - Connect with the community on our [PatternFly Slack workspace](https://join.slack.com/t/patternfly/shared_invite/zt-1npmqswgk-bF2R1E2rglV8jz5DNTezMQ). | ||
|
|
||
| As our AI tooling evolves, we'll continue to refine our recommendations based on community feedback and real-world usage. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.