Skip to content

Commit 00b7649

Browse files
patch: Added HTTP server mode (#107)
* patch: Added HTTP server mode * Update src/index.ts Co-authored-by: Copilot <[email protected]> * patch: Use commander for command line parsing * patch: Added --host flag for configuring the mcp servers host --------- Co-authored-by: Copilot <[email protected]>
1 parent 32d7a2d commit 00b7649

File tree

5 files changed

+285
-193
lines changed

5 files changed

+285
-193
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @dynatrace-oss/dynatrace-mcp-server
22

3+
## Unreleased Changes
4+
5+
### Added
6+
7+
- Added Streamable HTTP transport support with `--http`/`--server`, `--port`, and `--host` arguments (default remains stdio for backward compatibility)
8+
39
## 0.5.0 (Release Candidate 3)
410

511
- Improved `list_vulnerabilities` tool to use DQL statement instead of classic API, and aligned parameters with `list_problems` tool

README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,57 @@ The [Amazon Q Developer CLI](https://docs.aws.amazon.com/amazonq/latest/qdevelop
207207

208208
This configuration should be stored in `<your-repo>/.amazonq/mcp.json`.
209209

210+
### HTTP Server Mode (Alternative)
211+
212+
For scenarios where you need to run the MCP server as an HTTP service instead of using stdio (e.g., for stateful sessions, load balancing, or integration with web clients), you can use the HTTP server mode:
213+
214+
**Running as HTTP server:**
215+
216+
```bash
217+
# Get help and see all available options
218+
npx -y @dynatrace-oss/dynatrace-mcp-server --help
219+
220+
# Run with HTTP server on default port 3000
221+
npx -y @dynatrace-oss/dynatrace-mcp-server --http
222+
223+
# Run with custom port (using short or long flag)
224+
npx -y @dynatrace-oss/dynatrace-mcp-server --server -p 8080
225+
npx -y @dynatrace-oss/dynatrace-mcp-server --http --port 3001
226+
227+
# Run with custom host/IP (using short or long flag)
228+
npx -y @dynatrace-oss/dynatrace-mcp-server --http --host 127.0.0.1
229+
npx -y @dynatrace-oss/dynatrace-mcp-server --http -H 192.168.0.1
230+
231+
# Check version
232+
npx -y @dynatrace-oss/dynatrace-mcp-server --version
233+
```
234+
235+
**Configuration for MCP clients that support HTTP transport:**
236+
237+
```json
238+
{
239+
"mcpServers": {
240+
"dynatrace-http": {
241+
"url": "http://localhost:3000",
242+
"transport": "http"
243+
}
244+
}
245+
}
246+
```
247+
248+
**Configuration for MCP clients that support HTTP transport:**
249+
250+
```json
251+
{
252+
"mcpServers": {
253+
"dynatrace-http": {
254+
"url": "http://localhost:3000",
255+
"transport": "http"
256+
}
257+
}
258+
}
259+
```
260+
210261
### Rule File
211262

212263
For efficient result retrieval from Dynatrace, please consider creating a rule file (e.g., [.github/copilot-instructions.md](https://docs.github.com/en/copilot/how-tos/configure-custom-instructions/add-repository-instructions), [.amazonq/rules/](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/context-project-rules.html)), instructing coding agents on how to get more details for your component/app/service. Here is an example for [easytrade](https://github.com/Dynatrace/easytrade), please adapt the names and filters to fit your use-cases and components:

0 commit comments

Comments
 (0)