Skip to content

Commit a29017c

Browse files
authored
Merge pull request #13 from redhat-ai-tools/prompt
Add prompt providing a workflow for ROSA HCP Cluster pre-req guidance
2 parents baf2d6f + 6a99081 commit a29017c

File tree

5 files changed

+445
-17
lines changed

5 files changed

+445
-17
lines changed

README.md

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,6 @@ Flags:
6464
--transport string transport mode (stdio/sse) (default "stdio")
6565
```
6666

67-
### Environment Variables
68-
69-
- `OCM_OFFLINE_TOKEN`: Your OCM offline token for authentication - only used in stdio transport
70-
7167
### TOML Configuration File
7268

7369
```toml
@@ -81,6 +77,8 @@ sse_base_url = "https://example.com:8080"
8177

8278
### Stdio Transport (Local)
8379

80+
Stdio transport requires the `OCM_OFFLINE_TOKEN` environment variable for authentication.
81+
8482
```bash
8583
# Set your OCM token
8684
export OCM_OFFLINE_TOKEN="your-ocm-token-here"
@@ -91,14 +89,16 @@ export OCM_OFFLINE_TOKEN="your-ocm-token-here"
9189

9290
### SSE Transport (Remote)
9391

92+
SSE transport uses header-based authentication with the `X-OCM-OFFLINE-TOKEN` header. No environment variables required.
93+
9494
```bash
9595
# Start SSE server
9696
./rosa-mcp-server --transport=sse --port=8080
9797

9898
# Server will be available at:
9999
# - SSE stream: http://localhost:8080/sse
100100
# - MCP messages: http://localhost:8080/message
101-
# Send X-OCM-OFFLINE-TOKEN header with requests
101+
# Authentication: Send X-OCM-OFFLINE-TOKEN header with requests
102102
```
103103

104104
## Authentication Setup
@@ -264,7 +264,9 @@ make undeploy # Remove from OpenShift
264264

265265
## Integration with AI Assistants
266266

267-
Add to your mcpServers list:
267+
### Stdio Transport Configuration
268+
269+
For local stdio-based integration:
268270

269271
```json
270272
{
@@ -280,19 +282,21 @@ Add to your mcpServers list:
280282
}
281283
```
282284

283-
### SSE Integration
285+
### SSE Transport Configuration
284286

285-
For remote integrations, use the SSE endpoints:
287+
For remote SSE-based integration (no environment variables needed):
286288

287-
```bash
288-
# SSE stream endpoint (for Server-Sent Events)
289-
GET http://localhost:8080/sse
290-
291-
# MCP message endpoint (for sending JSON-RPC messages)
292-
POST http://localhost:8080/message
293-
294-
# Required header for both endpoints
295-
X-OCM-OFFLINE-TOKEN: your-token-here
289+
```json
290+
{
291+
"mcpServers": {
292+
"rosa-hcp": {
293+
"url": "http://your-server:8080/sse",
294+
"headers": {
295+
"X-OCM-OFFLINE-TOKEN": "your-token-here"
296+
}
297+
}
298+
}
299+
}
296300
```
297301

298302
## Error Handling

pkg/mcp/prompts.go

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package mcp
2+
3+
import (
4+
"context"
5+
_ "embed"
6+
7+
"github.com/mark3labs/mcp-go/mcp"
8+
)
9+
10+
//go:embed prompts/rosa-hcp-prerequisites-guide.md
11+
var prereqsGuide string
12+
13+
// registerPrompts registers all MCP prompts with the server
14+
func (s *Server) registerPrompts() {
15+
// ROSA HCP Prerequisites Guide prompt
16+
s.mcpServer.AddPrompt(mcp.NewPrompt("rosa_hcp_prerequisites_guide",
17+
mcp.WithPromptDescription("Comprehensive guidance on ROSA HCP cluster creation prerequisites and setup steps"),
18+
), s.handleROSAHCPPrereqsPrompt)
19+
}
20+
21+
// handleROSAHCPPrereqsPrompt provides comprehensive ROSA HCP prerequisites guidance as a prompt
22+
func (s *Server) handleROSAHCPPrereqsPrompt(ctx context.Context, request mcp.GetPromptRequest) (*mcp.GetPromptResult, error) {
23+
return mcp.NewGetPromptResult(
24+
"ROSA HCP Prerequisites Guide",
25+
[]mcp.PromptMessage{
26+
mcp.NewPromptMessage(
27+
mcp.RoleUser,
28+
mcp.NewTextContent(prereqsGuide),
29+
),
30+
mcp.NewPromptMessage(
31+
mcp.RoleUser,
32+
mcp.NewResourceLink(
33+
"https://cloud.redhat.com/learning/learn:getting-started-red-hat-openshift-service-aws-rosa/resource/resources:creating-rosa-hcp-clusters-using-default-options#page-title",
34+
"ROSA HCP Documentation",
35+
"Official Red Hat documentation for creating ROSA HCP clusters using default options",
36+
"text/html",
37+
),
38+
),
39+
},
40+
), nil
41+
}

0 commit comments

Comments
 (0)