feat(vefaas): add vefaas_cli_sdk module for streamlined deployment and local development#370
Merged
ZhengfengGao merged 1 commit intovolcengine:mainfrom Jan 8, 2026
Merged
Conversation
## 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 support
ZhengfengGao
approved these changes
Jan 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a major refactoring of the veFaaS MCP Server, porting core capabilities from vefaas-cli to Python. The new
vefaas_cli_sdkmodule provides:.vefaas/config.jsonformatHighlights
🚀 One-Command Deployment
Before (6 tool calls required):
After (1 tool call):
💻 Local Development Workflow
⚙️ Cross-Region Deployment
New Module:
vefaas_cli_sdkA new SDK module ported from vefaas-cli (TypeScript):
detector.pydeploy.pyconfig.pySupported Frameworks
Node.js: Next.js, Nuxt, Vite, VitePress, Rspress, Express, Astro, SvelteKit, Remix, Angular, Gatsby, CRA
Python: FastAPI, Flask, Streamlit, Django
Static: HTML sites, Hugo, MkDocs, Zola, Hexo
Tool Changes
Enhanced Tools
deploy_applicationdetect_projectget_function_detailsource_type, better optional field handlingpull_function_codevefaas.yamlfor local dev, graceful error handlingupdate_function.vefaasignorefiltering for code packagingRemoved Tools (Merged into
deploy_application)create_vefaas_applicationpoll_vefaas_application_statuslist_vefaas_application_templatesget_vefaas_application_templateKey Features
1. Region-Aware Configuration
Config IDs are only used when the stored region matches the target region:
2. Dual Config Format Support
Writes to both formats for compatibility:
.vefaas/config.json- vefaas-cli formatvefaas.yaml- Legacy MCP format3.
.vefaasignoreSupportPackage code with gitignore-style patterns:
4. Actionable Error Messages
{ "success": false, "error": "build_command is required for Node.js project", "next_action": "Provide build_command or set skip_build=True" }File Changes
vefaas_cli_sdk/__init__.pyvefaas_cli_sdk/deploy.pyvefaas_cli_sdk/detector.pyvefaas_cli_sdk/config.pyvefaas_server.pyvefaas_server_test.pypyproject.tomlNew Dependencies
pathspec-.vefaasignorepattern matchingpyyaml- YAML config file supportTesting
vefaas_cli_sdkmodule