You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* docs, breakout new options for http support
* build, use the pid-port package, convenience for ports already in use
* cli, move to using mode, prep for future
* index, refactor towards using session context and memo for server instances
* logger, move to session, handler clean up
* options, isolate unique identifiers to session, channelName, sessionID
* options.defaults, expand typings for http, move from DefaultSession to Session
* options, parse http args
* server.http, base http transport, route filtering, existing port/process checks
* server.logger, session setup, allow onLog listeners, clean up for handlers
* server, memoize server instance, expose onLog listener
* tests, expand unit and e2e checks for http
Copy file name to clipboardExpand all lines: README.md
+101-2Lines changed: 101 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,7 +75,7 @@ These are the most relevant NPM scripts from package.json:
75
75
76
76
## Usage
77
77
78
-
The MCP server communicates over stdio and provides access to PatternFly documentation through the following tools. Both tools accept an argument named `urlList` which must be an array of strings. Each string is either:
78
+
The MCP server can communicate over **stdio** (default) or **HTTP** transport. It provides access to PatternFly documentation through the following tools. Both tools accept an argument named `urlList` which must be an array of strings. Each string is either:
79
79
- An external URL (e.g., a raw GitHub URL to a .md file), or
80
80
- A local file path (e.g., documentation/.../README.md). When running with the --docs-host flag, these paths are resolved under the llms-files directory instead.
Then, passing a local path such as react-core/6.0.0/llms.txt in urlList will load from llms-files/react-core/6.0.0/llms.txt.
145
145
146
+
## HTTP transport mode
147
+
148
+
By default, the server communicates over stdio. To run the server over HTTP instead, use the `--http` flag. This enables the server to accept HTTP requests on a specified port and host.
149
+
150
+
### Basic HTTP usage
151
+
152
+
```bash
153
+
npx @patternfly/patternfly-mcp --http
154
+
```
155
+
156
+
This starts the server on `http://127.0.0.1:8080` (default port and host).
157
+
158
+
### HTTP options
159
+
160
+
-`--http`: Enable HTTP transport mode (default: stdio)
161
+
-`--port <number>`: Port number to listen on (default: 8080)
162
+
-`--host <string>`: Host address to bind to (default: 127.0.0.1)
163
+
-`--allowed-origins <origins>`: Comma-separated list of allowed CORS origins
164
+
-`--allowed-hosts <hosts>`: Comma-separated list of allowed host headers
165
+
166
+
#### Security note: DNS rebinding protection (default)
167
+
168
+
This server enables DNS rebinding protection by default when running in HTTP mode. If you're behind a proxy or load balancer, ensure the client sends a correct `Host` header and configure `--allowed-hosts` accordingly. Otherwise, requests may be rejected by design. For example:
169
+
170
+
```bash
171
+
npx @patternfly/patternfly-mcp --http \
172
+
--host 0.0.0.0 --port 8080 \
173
+
--allowed-hosts "localhost,127.0.0.1,example.com"
174
+
```
175
+
176
+
If your client runs on a different origin, also set `--allowed-origins` to allow CORS. Example:
If the specified port is already in use, the server will:
203
+
- Display a helpful error message with the process ID (if available)
204
+
- Suggest using a different port with `--port` or stopping the process using the port
205
+
206
+
**Note**: The server uses memoization to prevent duplicate server instances within the same process. If you need to restart the server, simply stop the existing instance and start a new one.
207
+
146
208
## MCP client configuration examples
147
209
148
210
Most MCP clients use a JSON configuration to specify how to start this server. The server itself only reads CLI flags and environment variables, not the JSON configuration. Below are examples you can adapt to your MCP client.
@@ -190,6 +252,41 @@ Most MCP clients use a JSON configuration to specify how to start this server. T
0 commit comments