@jephilli-patternfly-docs/mcp
v1.1.0
Published
PatternFly documentation MCP server built with Node.js and TypeScript
Maintainers
Readme
PatternFly MCP Server
A Model Context Protocol (MCP) server that provides access to PatternFly React development rules and documentation, built with Node.js and TypeScript.
What is MCP?
The Model Context Protocol (MCP) is an open standard that enables AI assistants to securely access external data sources and tools. This server provides a standardized way to expose PatternFly documentation and development rules to MCP-compatible clients.
Features
- TypeScript: Full type safety and modern JavaScript features
- PatternFly Documentation Access: Browse, search, and retrieve PatternFly development rules
- Comprehensive Rule Coverage: Access setup, guidelines, components, charts, chatbot, and troubleshooting documentation
- Smart Search: Find specific rules and patterns across all documentation
- Error Handling: Robust error handling with proper MCP error codes
- Modern Node.js: Uses ES modules and latest Node.js features
Prerequisites
- Node.js 18.0.0 or higher
- npm or yarn package manager
Installation
For Development
- Install dependencies:
npm install- Build the project:
npm run buildFor Use with npx
After publishing to npm, you can use this server directly with npx:
npx @jephilli-patternfly-docs/mcpOr if installing locally in a project:
npm install @jephilli-patternfly-docs/mcp
npx @jephilli-patternfly-docs/mcpDevelopment
Scripts
npm run dev- Run the server in development mode with hot reloadnpm run build- Build the TypeScript code to JavaScriptnpm run start- Start the built servernpm run watch- Watch for changes and rebuild automaticallynpm run clean- Clean the build directory
Running in Development
npm run devThis will start the server using tsx for TypeScript execution without compilation.
Usage
The MCP server communicates over stdio and provides access to PatternFly documentation through the following tools:
Available Tools
list_documentation
Lists available PatternFly documentation categories and files.
Parameters:
path(string, optional): Specific directory path to list (relative to documentation)
get_documentation
Retrieves the full content of a specific PatternFly documentation file.
Parameters:
file_path(string, required): Path to the documentation file (relative to documentation)
search_documentation
Searches for specific text across all PatternFly documentation files.
Parameters:
query(string, required): Text to search for in the documentationcase_sensitive(boolean, optional): Whether the search should be case sensitive (default: false)
get_quick_rules
Gets essential PatternFly development rules and guidelines for specific categories.
Parameters:
category(string, optional): Specific category of rules (charts, chatbot, component-groups, components, guidelines, resources, setup, troubleshooting). If not provided, returns overview of all categories.
get_all_standards
Gets comprehensive PatternFly standards and guidelines from all documentation in a single response.
Parameters:
include_examples(boolean, optional): Whether to include code examples and detailed explanations (default: true)sections(array, optional): Specific sections to include (charts, chatbot, component-groups, components, guidelines, resources, setup, troubleshooting). If not provided, includes all sections.
Example Client Integration
To use this server with an MCP client, you typically need to configure the client to run this server as a subprocess. The exact configuration depends on your MCP client.
Example configuration for MCP clients using npx (see mcp-config-example.json):
{
"mcpServers": {
"patternfly-docs": {
"command": "npx",
"args": ["-y", "@jephilli-patternfly-docs/mcp@latest"]
"description": "PatternFly React development rules and documentation"
}
}
}For local development (without npx):
{
"mcpServers": {
"patternfly-docs": {
"command": "node",
"args": ["dist/index.js"],
"cwd": "/path/to/patternfly-mcp",
"description": "PatternFly React development rules and documentation"
}
}
}Project Structure
patternfly-mcp/
├── documentation/ # PatternFly development rules and guidelines
├── src/
│ └── index.ts # Main server implementation
├── dist/ # Compiled JavaScript (after build)
├── package.json # Project dependencies and scripts
├── tsconfig.json # TypeScript configuration
├── mcp-config-example.json # Example MCP client configuration
├── .gitignore # Git ignore patterns
└── README.md # This fileDocumentation Structure
The server provides access to the PatternFly documentation located in documentation/:
- charts/ - PatternFly Charts implementation rules
- chatbot/ - PatternFly Chatbot component rules
- component-groups/ - Component grouping and organization patterns
- components/ - Component-specific usage rules and best practices
- guidelines/ - Core development principles and standards
- resources/ - External links and local documentation references
- setup/ - Project initialization and environment setup rules
- troubleshooting/ - Common issues and solutions
Example Usage
Browse Available Documentation
Use list_documentation to see what's available:
- List root categories:
list_documentation(no parameters) - List specific directory:
list_documentationwithpath: "guidelines"
Get Specific Rules
Use get_documentation to retrieve specific files:
- Get setup rules:
get_documentationwithfile_path: "setup/README.md" - Get styling standards:
get_documentationwithfile_path: "guidelines/styling-standards.md" - Get component groups rules:
get_documentationwithfile_path: "component-groups/README.md" - Get external links:
get_documentationwithfile_path: "resources/external-links.md"
Search for Specific Information
Use search_documentation to find relevant rules:
- Find all references to "v6":
search_documentationwithquery: "v6" - Search for accessibility rules:
search_documentationwithquery: "accessibility"
Quick Access to Essential Rules
Use get_quick_rules for common categories:
- Overview of all rules:
get_quick_rules(no parameters) - Specific category:
get_quick_ruleswithcategory: "components"
Comprehensive Standards Access
Use get_all_standards to get all PatternFly standards in one response:
- All standards with examples:
get_all_standards(no parameters) - All standards without code examples:
get_all_standardswithinclude_examples: false - Only specific sections:
get_all_standardswithsections: ["components", "guidelines"] - Component groups and charts only:
get_all_standardswithsections: ["component-groups", "charts"]
Publishing
To make this package available via npx, you need to publish it to npm:
- Ensure you have an npm account and are logged in:
npm login- Update the version in package.json if needed:
npm version patch # or minor/major- Publish to npm:
npm publishAfter publishing, users can run your MCP server with:
npx @jephilli-patternfly-docs/mcpContributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
License
MIT License - see LICENSE file for details.
