@@ -12,25 +12,28 @@ Complete guide to using the PatternFly MCP Server for development including CLI
1212
1313### Available options
1414
15- | Flag | Description | Default |
16- |:--------------------------------------|:------------------------------------------------------|:---------------------|
17- | `--http` | Enable HTTP transport mode | `false` (stdio mode) |
18- | `--port <num>` | Port for HTTP transport | `8080` |
19- | `--host <string>` | Host to bind to | `127.0.0.1` |
20- | `--allowed-origins <origins>` | Comma-separated list of allowed CORS origins | `none` |
21- | `--allowed-hosts <hosts>` | Comma-separated list of allowed host headers | `none` |
22- | `--tool <path>` | Path to external Tool Plugin (repeatable) | `none` |
23- | `--plugin-isolation <none \| strict>` | Isolation preset for external tools-as-plugins | `strict` |
24- | `--log-stderr` | Enable terminal logging | `false` |
25- | `--log-protocol` | Forward logs to MCP clients | `false` |
26- | `--log-level <level>` | Set log level (`debug`, `info`, `warn`, `error`) | `info` |
27- | `--verbose` | Shortcut for `--log-level debug` | `false` |
15+ | Flag | Description | Default |
16+ |:--------------------------------------|:-------------------------------------------------|:---------------------|
17+ | `--http` | Enable HTTP transport mode | `false` (stdio mode) |
18+ | `--port <num>` | Port for HTTP transport | `8080` |
19+ | `--host <string>` | Host to bind to | `127.0.0.1` |
20+ | `--allowed-origins <origins>` | Comma-separated list of allowed CORS origins | `none` |
21+ | `--allowed-hosts <hosts>` | Comma-separated list of allowed host headers | `none` |
22+ | `--tool <path>` | Path to external Tool Plugin (repeatable) | `none` |
23+ | `--plugin-isolation <none \| strict>` | Isolation preset for external tools-as-plugins | `strict` |
24+ | `--log-stderr` | Enable terminal logging | `false` |
25+ | `--log-protocol` | Forward logs to MCP clients | `false` |
26+ | `--log-level <level>` | Set log level (`debug`, `info`, `warn`, `error`) | `info` |
27+ | `--mode <mode>` | Operational mode (`cli`, `programmatic`, `test`) | `cli` |
28+ | `--mode-test-url <url>` | Base URL for fixture/mock servers in `test` mode | `none` |
29+ | `--verbose` | Shortcut for `--log-level debug` | `false` |
2830
2931#### Notes
3032- **HTTP transport mode** - By default, the server uses `stdio`. Use the `--http` flag to enable HTTP transport.
3133- **Logging** - The server uses a `diagnostics_channel`-based logger that keeps STDIO stdout pure by default.
3234- **Programmatic API** - The server can also be used programmatically with options. See [Programmatic Usage](#programmatic-usage) for more details.
33- - **Tool Plugins** - The server can load external tool plugins at startup. See [Tool Plugins](#tool-plugins) for more details.
35+ - **Tool Plugins** - The server can load external tool plugins at startup. See [Tool Plugins](#tool-plugins) for more details.
36+ - **Test Mode** - When `--mode test` is used, the server redirects resource requests to the URL provided by `--mode-test-url`, enabling E2E testing without local filesystem access.
3437
3538### Basic use scenarios
3639
@@ -53,6 +56,10 @@ npx @patternfly/patternfly-mcp --http --port 3000 --allowed-origins "https://app
5356```bash
5457npx @patternfly/patternfly-mcp --tool ./first-tool.js --tool ./second-tool.ts
5558```
59+ **Testing with a fixture server**:
60+ ```bash
61+ npx @patternfly/patternfly-mcp --mode test --mode-test-url "http://localhost:3000"
62+ ```
5663
5764### Testing with MCP Inspector
5865
@@ -81,20 +88,21 @@ npx @modelcontextprotocol/inspector-cli \
8188
8289The `start()` function accepts an optional `PfMcpOptions` object for programmatic configuration. Use these options to customize behavior, transport, and logging for embedded instances.
8390
84- | Option | Type | Description | Default |
85- |:----------------------|:-----------------------------------------|:----------------------------------------------------------------------|:-------------------|
86- | `toolModules` | `ToolModule \| ToolModule[]` | Array of tool modules or paths to external tool plugins to be loaded. | `[]` |
87- | `isHttp` | `boolean` | Enable HTTP transport mode. | `false` |
88- | `http.port` | `number` | Port for HTTP transport. | `8080` |
89- | `http.host` | `string` | Host to bind to. | `127.0.0.1` |
90- | `http.allowedOrigins` | `string[]` | List of allowed CORS origins. | `[]` |
91- | `http.allowedHosts` | `string[]` | List of allowed host headers. | `[]` |
92- | `pluginIsolation` | `'none' \| 'strict'` | Isolation preset for external tools-as-plugins. | `'strict'` |
93- | `logging.level` | `'debug' \| 'info' \| 'warn' \| 'error'` | Set the logging level. | `'info'` |
94- | `logging.stderr` | `boolean` | Enable terminal logging to stderr. | `false` |
95- | `logging.protocol` | `boolean` | Forward logs to MCP clients. | `false` |
96- | `mode` | `'cli' \| 'programmatic' \| 'test'` | Specifies the operation mode. | `'programmatic'` |
97- | `docsPath` | `string` | Path to the documentation directory. | (Internal default) |
91+ | Option | Type | Description | Default |
92+ |:---------------------------|:-----------------------------------------|:----------------------------------------------------------------------|:-------------------|
93+ | `toolModules` | `ToolModule \| ToolModule[]` | Array of tool modules or paths to external tool plugins to be loaded. | `[]` |
94+ | `isHttp` | `boolean` | Enable HTTP transport mode. | `false` |
95+ | `http.port` | `number` | Port for HTTP transport. | `8080` |
96+ | `http.host` | `string` | Host to bind to. | `127.0.0.1` |
97+ | `http.allowedOrigins` | `string[]` | List of allowed CORS origins. | `[]` |
98+ | `http.allowedHosts` | `string[]` | List of allowed host headers. | `[]` |
99+ | `pluginIsolation` | `'none' \| 'strict'` | Isolation preset for external tools-as-plugins. | `'strict'` |
100+ | `logging.level` | `'debug' \| 'info' \| 'warn' \| 'error'` | Set the logging level. | `'info'` |
101+ | `logging.stderr` | `boolean` | Enable terminal logging to stderr. | `false` |
102+ | `logging.protocol` | `boolean` | Forward logs to MCP clients. | `false` |
103+ | `mode` | `'cli' \| 'programmatic' \| 'test'` | Specifies the operation mode. | `'programmatic'` |
104+ | `modeOptions.test.baseUrl` | `string` | Base URL for fixture/mock servers in `test` mode. | `undefined` |
105+ | `docsPath` | `string` | Path to the documentation directory. | (Internal default) |
98106
99107#### Example usage
100108
@@ -116,6 +124,20 @@ const options: PfMcpOptions = {
116124const server: PfMcpInstance = await start(options);
117125```
118126
127+ **Example: Programmatic test mode**
128+ ```typescript
129+ import { start, type PfMcpInstance } from '@patternfly/patternfly-mcp';
130+
131+ const server: PfMcpInstance = await start({
132+ mode: 'test',
133+ modeOptions: {
134+ test: {
135+ baseUrl: 'http://my-fixture-server:3000'
136+ }
137+ }
138+ });
139+ ```
140+
119141### Server instance
120142
121143The server instance exposes the following methods:
0 commit comments