Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
---
id: PatternFly MCP
section: PatternFly-AI
---
import '../design-guidelines/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 new tool designed to integrate our design guidelines, component documentation, and accessibility best practices directly into your AI-powered development environment.
Copy link
Member

Choose a reason for hiding this comment

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

Seeing "new" in our docs immediately makes me think we're building in tech debt as this becomes dated.

Suggested change
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.


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.

## 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-docs` block inside it.

``` {
"mcpServers": {
"patternfly-docs": {
Copy link
Member

@cdcabrera cdcabrera Nov 11, 2025

Choose a reason for hiding this comment

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

it's a minor thing, can't tell if its on purpose and technically everything functions, but we flip between naming the server setup patternfly-docs for Cursor vs patternfly-mcp for Claude... we may want to be consistent... this would cause a few more updates throughout the pr if we flip to just patternfly-mcpvs flipping to patternfly-docs for everything

(the pf-mcp readme references patternfly-docs but dependent on the direction we take here we can always make sure that aligns after-the-fact)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@evwilkin do we want to go with one or the other? or still deciding

Copy link
Member

Choose a reason for hiding this comment

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

@edonehoo @cdcabrera I vote we stick with patternfly-mcp to match the name of the repo and the NPM package shipped that's referenced in the code just below these lines @patternfly/patternfly-mcp.

I think the consistency in name could remove one possible source of confusion 👍

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sounds good! I just updated it in my last commit, but lmk if anything looks off

"command": "npx",
"args": [
"-y",
"@patternfly/patternfly-mcp"
],
"description": "PatternFly React development rules and documentation"
}
}
}
```
Copy link
Member

Choose a reason for hiding this comment

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

It looks like the very opening { got cut off and the indentation got a little thrown off following that:

Suggested change
``` {
"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"
}
}
}
```

1. Save and close mcp.json. The MCP Settings will now show "patternfly-docs" as an installed server with its tools enabled.
<br/ ><br/ >
<div class="ws-docs-content-img">
![Cursor's MCP settings, which display patternfly-docs as turned "on".](./img/cursor-mcp-settings.svg)
</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```
- To install for the current project only, run:
```claude mcp add patternfly-mcp -- npx -y @patternfly/patternfly-mcp```
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">
![Terminal results from the "/mcp" command displaying patternfly-mcp as a connected server.](./img/claude-mcp-servers.svg)
</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-docs_usePatternFlyDocs and mcp_patternfly-docs_fetchDocs.
- **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"
Copy link
Member

Choose a reason for hiding this comment

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

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:

Suggested change
- **Prompt:** "Yes, fetch docs for card"
- **Prompt:** "Fetch docs for 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 components should I use if we want a user to be able to select several different cards from a gallery view?"
Copy link
Member

Choose a reason for hiding this comment

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

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:

Suggested change
- **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?"

- **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.