Sandbox Studio MCP Server
Connects AI assistants to the Sandbox Studio API to manage AWS sandbox accounts, leases, templates, events, and settings through natural language conversations.
README
Sandbox Studio MCP Server
A local Model Context Protocol (MCP) server that connects AI assistants to the Sandbox Studio API. This lets you manage AWS sandbox accounts, leases, templates, events, and settings through natural language conversations.
Install
After installing, run
npx sandbox-studio-mcp initto configure your credentials.
What is this?
Sandbox Studio is a platform for managing temporary AWS accounts — useful for training, labs, hackathons, and development sandboxes. This MCP server exposes the full Sandbox Studio API as tools that AI assistants (Claude, Kiro, Cursor, etc.) can call on your behalf.
Example conversations:
"Create a template for my students with a $50 budget and EC2 access only"
"Request a lease for the VS Code Server template and tell me when it's ready"
"Show me all pending approvals and deny Emma's requests"
"Terminate all my leases except the GPU one"
How it works
┌─────────────────┐ stdio ┌──────────────────┐ HTTPS ┌─────────────────────┐
│ AI Assistant │◄────────────────►│ MCP Server │◄───────────────►│ Sandbox Studio │
│ (Kiro/Claude/ │ │ (this project) │ OAuth2 │ API │
│ Cursor) │ │ │ │ │
└─────────────────┘ └──────────────────┘ └─────────────────────┘
- The AI assistant spawns the MCP server as a local subprocess
- When you ask a question, the AI decides which tools to call
- The MCP server authenticates with Sandbox Studio using OAuth2 client credentials
- API responses are returned to the AI, which formats them for you
Prerequisites
- Node.js >= 18
- pnpm (or npm)
- A Sandbox Studio instance with API access
- OAuth client credentials — create these in the Sandbox Studio admin panel
Quick Start
1. Configure credentials
npx sandbox-studio-mcp init
This will prompt you for:
- Instance URL — your Sandbox Studio API endpoint (e.g.
https://sandbox.example.com/api) - Client ID — from your OAuth client in the Sandbox Studio admin panel
- Client Secret — from your OAuth client
To create OAuth credentials, go to your Sandbox Studio admin panel → API Clients → Create new client.
2. Connect to your AI assistant
Kiro
Add to ~/.kiro/settings/mcp.json:
{
"mcpServers": {
"sandbox-studio": {
"command": "npx",
"args": ["-y", "sandbox-studio-mcp"]
}
}
}
Claude Code
claude mcp add sandbox-studio -- npx -y sandbox-studio-mcp
Cursor / VS Code (manual)
Add to your MCP settings (or use the one-click badges above):
{
"mcp": {
"servers": {
"sandbox-studio": {
"command": "npx",
"args": ["-y", "sandbox-studio-mcp"]
}
}
}
}
Codex
Add to ~/.codex/config.json:
{
"mcpServers": {
"sandbox-studio": {
"command": "npx",
"args": ["-y", "sandbox-studio-mcp"]
}
}
}
AI Behaviour Guidance
The MCP server includes guidance in tool descriptions that shapes how the AI interacts with you. This is one of the key design patterns of this project:
Safety guardrails
- Lease termination — When terminating multiple leases, the AI will list them clearly, distinguish between your own and others' leases, and ask for confirmation before proceeding.
- Bulk operations — The AI won't batch-terminate or batch-deny without explicit confirmation.
Template creation prompts
When creating templates, the AI is guided to ask about:
- Tags for categorisation
- Custom icon and colour
- Manager/approver configuration
Launch script convention
When the AI writes launch scripts for templates, it uses set-sandbox-output instead of echo to expose variables to the lease owner in the Sandbox Studio UI:
set-sandbox-output --name "Public IP" --value "$PUBLIC_IP"
set-sandbox-output --name "Admin Password" --value "$PASSWORD" --is-secret
The --is-secret flag masks the value in the UI.
Response enrichment
When templates or leases are created, the response includes a _link field with a direct URL to the resource in the Sandbox Studio UI.
OAuth2 Authentication
The server uses the OAuth2 client credentials grant flow:
- On first API call, it requests a token from
{instanceUrl}/oauth/token - The token is cached in memory with a 60-second refresh buffer
- On 401 responses, it automatically clears the cache and retries
- HTML responses (login page redirects) are detected and trigger a token refresh
To create OAuth credentials, go to your Sandbox Studio admin panel → API Clients → Create new client.
Available Tools (65+)
Leases
| Tool | Description |
|---|---|
list_leases |
List leases with filtering by status, user, date |
get_lease |
Get lease details by ID |
request_lease |
Request a new lease from a template |
update_lease |
Update lease budget/duration/expiration |
suspend_lease |
Suspend an active lease |
resume_lease |
Resume a suspended lease |
review_lease |
Approve or deny a lease request |
terminate_lease |
Terminate a lease (irreversible) |
withdraw_lease |
Withdraw a pending request |
get_lease_team_members |
List shared users |
share_lease |
Share with additional users |
unshare_lease |
Remove shared users |
get_lease_logs |
Get setup/activity logs |
get_lease_secrets |
Get build output secrets |
Templates
| Tool | Description |
|---|---|
list_public_templates |
List templates available for lease requests |
list_managed_templates |
List templates you manage |
create_template |
Create a new template |
get_template |
Get full template details |
delete_template |
Delete a template |
get_template_info |
Get basic info (name, description, icon) |
update_template_info |
Update basic info |
get_template_leases |
List leases for a template |
get_template_permissions |
Get IAM permission config |
update_template_permissions |
Update IAM permissions |
get_template_launch_settings |
Get launch/setup scripts |
update_template_launch_settings |
Update launch/setup scripts |
update_template_budget |
Update budget settings |
update_template_duration |
Update duration settings |
update_template_managers |
Update managers/approvers |
update_template_sharing |
Update sharing settings |
update_template_tags |
Update tags |
Accounts
| Tool | Description |
|---|---|
list_accounts |
List sandbox accounts |
list_unregistered_accounts |
List available unregistered accounts |
get_account |
Get account details |
import_accounts |
Import AWS accounts into the pool |
eject_accounts |
Eject accounts from the pool |
get_account_lease_history |
Get lease history for an account |
retry_account_cleanup |
Retry failed cleanup |
get_account_cleanup_logs |
Get cleanup logs |
get_account_failed_resources |
Get failed cleanup resources |
Events
| Tool | Description |
|---|---|
list_events |
List events with status filtering |
create_event |
Create a new event |
get_event |
Get event details |
update_event |
Update an event |
get_event_teams |
Get event teams |
add_event_teams |
Add teams to an event |
assign_event_team_owner |
Assign a team owner |
provision_event |
Provision event accounts |
start_event |
Start a provisioned event |
terminate_event |
Terminate an event |
Approvals & Reporting
| Tool | Description |
|---|---|
list_approvals |
List pending approval requests |
get_lease_costs |
Get cost reporting data |
Admin Jobs
| Tool | Description |
|---|---|
trigger_drift_detection |
Run drift detection |
trigger_lease_monitoring |
Run lease monitoring |
Settings
| Tool | Description |
|---|---|
get_global_config |
Get global platform config |
update_global_config |
Update global config |
get_runtime_config |
Get runtime config |
get_cleanup_settings |
Get nuke config |
update_cleanup_settings |
Update nuke config |
get_cleanup_hook |
Get cleanup hook script |
update_cleanup_hook |
Update cleanup hook |
get_email_settings |
Get email templates |
update_email_settings |
Update email templates |
send_test_email |
Send test email |
get_smtp_settings |
Get SMTP config |
update_smtp_settings |
Update SMTP config |
Users & Identity
| Tool | Description |
|---|---|
list_users |
List users from identity provider |
list_groups |
List groups from identity provider |
validate_users |
Validate user IDs exist |
update_preferences |
Update user preferences |
list_all_oauth_clients |
List all OAuth clients (admin) |
list_my_oauth_clients |
List your OAuth clients |
create_oauth_client |
Create an OAuth client |
update_oauth_client |
Update an OAuth client |
delete_oauth_client |
Delete an OAuth client |
get_terms_of_service |
Get current terms of service |
list_terms_versions |
List ToS versions |
get_terms_version |
Get specific ToS version |
publish_terms_of_service |
Publish new ToS |
get_tags |
Get all template tags |
validate_s3_path |
Validate an S3 path |
Project Structure
src/
├── index.ts # Entry point — registers all tools, connects via stdio
├── config.ts # Config file management (~/.sandbox-studio-mcp/config.json)
├── auth.ts # OAuth2 client_credentials token management
├── client.ts # HTTP client with auth, retry, and HTML detection
├── init-config.ts # Interactive config setup CLI
└── tools/
├── leases.ts # Lease lifecycle tools
├── accounts.ts # Account pool management
├── templates.ts # Template configuration (with AI guidance)
├── events.ts # Events, approvals, reporting, admin jobs
├── settings.ts # Cleanup, email, SMTP, global config
└── users.ts # Users, groups, OAuth clients, ToS, tags
Development
# Build
pnpm build
# Watch mode (rebuild on change)
pnpm dev
# Run directly
node dist/index.js
Extending
Adding a new tool
- Choose the appropriate file in
src/tools/ - Register the tool with
server.registerTool(name, schema, handler) - Use
apiRequest(config, options)to call the Sandbox Studio API
Adding AI guidance
Use the tool's description field to influence AI behaviour:
server.registerTool("my_tool", {
description: `Do something.
IMPORTANT: Always ask the user about X before calling this tool.
Never do Y without explicit confirmation.`,
inputSchema: { ... }
}, handler);
This is the primary mechanism for shaping how AI assistants use your tools.
Troubleshooting
| Problem | Solution |
|---|---|
| HTML responses instead of JSON | Check that instanceUrl in config includes /api |
| 401 errors | Verify client credentials are valid and the OAuth client is active |
| Token refresh loops | The OAuth client may have been deleted — recreate in admin panel |
| Tools not appearing | Rebuild (pnpm build) and restart the MCP server |
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。