-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy_gcf.py
More file actions
executable file
·41 lines (30 loc) · 1.14 KB
/
deploy_gcf.py
File metadata and controls
executable file
·41 lines (30 loc) · 1.14 KB
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
#!/usr/bin/env python
"""
Script to deploy the Google Cloud Function for code execution.
Usage: python deploy_gcf.py [--project PROJECT_ID]
"""
import argparse
import sys
from src.code_mcp.gcf_deployer import GCFDeployer
def main():
parser = argparse.ArgumentParser(description="Deploy Code Interpreter Google Cloud Function")
parser.add_argument(
"--project",
help="Google Cloud Project ID (defaults to current gcloud config)",
default=None
)
args = parser.parse_args()
deployer = GCFDeployer(project_id=args.project)
print("🚀 Deploying Code Interpreter Cloud Function...")
result = deployer.deploy()
if result["success"]:
print(f"✅ Successfully deployed!")
print(f"📍 Function URL: {result['function_url']}")
print(f"🔧 Project ID: {result['project_id']}")
print(f"\nTo use with the MCP server, set the environment variable:")
print(f"export GCF_URL=\"{result['function_url']}\"")
else:
print(f"❌ Deployment failed: {result.get('error', 'Unknown error')}")
sys.exit(1)
if __name__ == "__main__":
main()