Skip to content

Commit e527f40

Browse files
authored
Merge pull request #32 from oslabs-beta/paython-mcp
Paython mcp
2 parents d1b49ec + c04f5f1 commit e527f40

14 files changed

Lines changed: 1496 additions & 43 deletions

package-lock.json

Lines changed: 86 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"@aws-sdk/client-sts": "^3.921.0",
2828
"@aws-sdk/credential-provider-sso": "^3.921.0",
2929
"@openai/agents": "^0.2.1",
30+
"@supabase/supabase-js": "^2.81.1",
3031
"axios": "^1.12.2",
3132
"chalk": "^5.6.2",
3233
"cookie-parser": "^1.4.7",

server/agent/api_calls_doc.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# MCP CI/CD Builder – API Usage Guide
2+
3+
This short guide explains how to use the **Wizard Agent API** to generate pipelines, confirm workflows, and commit the final YAML to GitHub. It also highlights the new **confirmation flow** that ensures pipelines are only committed when the user explicitly approves.
4+
5+
---
6+
7+
## 🚀 Overview
8+
The Wizard Agent provides a multi‑step workflow for generating and committing CI/CD pipelines via API calls:
9+
10+
1. **User requests a pipeline** → Agent generates YAML
11+
2. **Agent asks for confirmation**`requires_confirmation: true`
12+
3. **User confirms** → Agent commits workflow to GitHub
13+
14+
The session must include a valid `mcp_session` cookie for authentication.
15+
16+
---
17+
18+
## 📌 Step 1 — Generate a Pipeline
19+
Send a prompt describing the pipeline you want.
20+
21+
```bash
22+
curl -X POST http://localhost:3000/agent/wizard/ai \
23+
-H "Content-Type: application/json" \
24+
-H "Cookie: mcp_session=YOUR_SESSION_TOKEN" \
25+
-d '{
26+
"prompt": "Generate pipeline for PVeazie951/google-extention-ai-summarizer"
27+
}'
28+
```
29+
30+
### ✔ Expected Response
31+
```json
32+
{
33+
"success": true,
34+
"requires_confirmation": true,
35+
"message": "A pipeline has been generated. Would you like me to commit this workflow file?",
36+
"generated_yaml": "...",
37+
"pipeline_metadata": { ... }
38+
}
39+
```
40+
41+
The agent stores the repo name + generated YAML internally for the next step.
42+
43+
---
44+
45+
## 📌 Step 2 — Confirm the Commit
46+
Once the agent asks for confirmation, send a follow-up prompt such as:
47+
48+
```bash
49+
curl -X POST http://localhost:3000/agent/wizard/ai \
50+
-H "Content-Type: application/json" \
51+
-H "Cookie: mcp_session=YOUR_SESSION_TOKEN" \
52+
-d '{
53+
"prompt": "yes commit"
54+
}'
55+
```
56+
57+
### ✔ Expected Response
58+
```json
59+
{
60+
"success": true,
61+
"tool_called": "pipeline_commit",
62+
"committed_repo": "PVeazie951/google-extention-ai-summarizer",
63+
"committed_path": ".github/workflows/ci.yml",
64+
"sha": "...",
65+
"html_url": "https://github.com/.../ci.yml"
66+
}
67+
```
68+
This confirms the workflow file was successfully committed to the repo.
69+
70+
---
71+
72+
## 🛡 How Confirmation Works
73+
To avoid accidental commits:
74+
75+
- Only explicit intent triggers `pipeline_commit` (e.g., **"yes commit", "commit workflow", "apply pipeline"**)
76+
- The agent now **ignores model-generated phrases** like "recent commits" or "show commits" during confirmation
77+
- User intent always overrides the agent's reasoning
78+
79+
This makes the multi-step flow consistent and safe.
80+
81+
---
82+
83+
## 📌 Extra: Listing Repositories
84+
You can ask the agent anything:
85+
86+
```bash
87+
curl -X POST http://localhost:3000/agent/wizard/ai \
88+
-H "Content-Type: application/json" \
89+
-H "Cookie: mcp_session=YOUR_SESSION_TOKEN" \
90+
-d '{ "prompt": "List my repositories" }'
91+
```
92+
93+
---
94+
95+
## ✅ Summary
96+
- Use the Wizard Agent API to generate pipelines from natural language prompts
97+
- The agent **requires confirmation** before committing workflows
98+
- Multi-step flow works via persistent session state
99+
- Commits are safe and deterministic due to improved intent detection
100+
101+
If you need a longer doc, diagrams, or frontend usage examples, I can generate those too.
102+

0 commit comments

Comments
 (0)