Commit 3be2fe8
committed
feat(vefaas): add vefaas_cli_sdk module and refactor deploy workflow
## Summary
This is a major refactoring of the veFaaS MCP Server to introduce a new
vefaas_cli_sdk module ported from vefaas-cli, providing better project
detection, deployment workflow, and configuration management.
## New Components
### vefaas_cli_sdk module (new)
- **deploy.py**: Core deployment logic
- VeFaaSClient: Unified API client with error handling
- Package directory with .vefaasignore support
- Static site deployment with Caddyfile generation
- Full deployment workflow (create/update function, build, release, poll status)
- **detector.py**: Project detection module
- Auto-detect framework (Next.js, Vite, FastAPI, Flask, Streamlit, etc.)
- Detect runtime, build command, start command, and port
- Support for Node.js, Python, and static site projects
- **config.py**: Configuration management
- Read/write .vefaas/config.json (vefaas-cli compatible)
- Read/write vefaas.yaml (legacy MCP format)
- Region-aware configuration linking
## Tool Changes
### deploy_application (enhanced)
- Now the PRIMARY deployment tool - one command to deploy
- Handles full workflow: detect → build → package → upload → create/update → release
- Region-aware configuration: only uses cached IDs if region matches
- Explicit build_command validation for non-Python runtimes
- Clear error messages with actionable next_action guidance
### detect_project (enhanced)
- Uses new detector module for accurate framework detection
- Returns comprehensive project configuration
### get_function_detail / pull_function_code (enhanced)
- Better error handling for optional fields
- Returns SourceType for early validation
### Removed tools
- create_vefaas_application (merged into deploy_application)
- poll_vefaas_application_status (handled internally)
- list_vefaas_application_templates (no longer needed)
- get_vefaas_application_template (no longer needed)
## Test Updates
- Added tests for new vefaas_cli_sdk module
- Updated existing tests for refactored tools
- Added region-aware deployment tests
## Dependencies
- Added 'pathspec' for .vefaasignore pattern matching
- Added 'pyyaml' for YAML config file support1 parent 65743a3 commit 3be2fe8
File tree
9 files changed
+3067
-894
lines changed- server/mcp_server_vefaas_function
- src/mcp_server_vefaas_function
- vefaas_cli_sdk
9 files changed
+3067
-894
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
Lines changed: 13 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
| 103 | + | |
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
| |||
150 | 151 | | |
151 | 152 | | |
152 | 153 | | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
158 | 159 | | |
159 | 160 | | |
160 | 161 | | |
| |||
195 | 196 | | |
196 | 197 | | |
197 | 198 | | |
198 | | - | |
| 199 | + | |
199 | 200 | | |
200 | 201 | | |
201 | | - | |
| 202 | + | |
202 | 203 | | |
203 | 204 | | |
204 | | - | |
| 205 | + | |
205 | 206 | | |
206 | 207 | | |
207 | 208 | | |
| |||
Lines changed: 52 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
0 commit comments