Skip to content

Conversation

binggg
Copy link
Member

@binggg binggg commented Aug 12, 2025

οΏ½οΏ½ Cloud Mode Support for MCP Server

What's Changed

  • Cloud Mode Detection: Add utilities to detect and manage cloud mode
  • Authentication Isolation: Construct auth state from env vars, avoiding local cache pollution
  • CLI Support: Add --cloud-mode parameter (Node.js 18.15+ compatible)
  • Plugin Filtering: Automatically filter incompatible plugins (interactive, setup) in cloud mode
  • File Operation Skip: Skip local file operations when environment variables are present
  • Type Safety: Fix compatibility issues with authentication state changes

Key Features

βœ… Cross-process isolation: Prevents cache pollution between different MCP instances
βœ… Environment-based config: Uses env vars for auth and env ID, no local files
βœ… Tool filtering: Only exposes cloud-compatible tools
βœ… Multiple activation methods: CLI flag, env var, or code configuration
βœ… Backward compatibility: No impact on existing local mode usage

Usage Examples

# CLI parameter
node dist/cli.cjs --cloud-mode

# Environment variable
export CLOUDBASE_MCP_CLOUD_MODE=true
node dist/cli.cjs

# Code configuration
createCloudBaseMcpServer({ cloudMode: true })

Environment Variables

  • CLOUDBASE_MCP_CLOUD_MODE=true - Enable cloud mode
  • TENCENTCLOUD_SECRETID - Authentication secret ID
  • TENCENTCLOUD_SECRETKEY - Authentication secret key
  • CLOUDBASE_ENV_ID - CloudBase environment ID

Testing

  • βœ… Unit tests for cloud mode detection
  • βœ… Integration tests for authentication flow
  • βœ… Build verification with no type errors
  • βœ… Node.js 18.15+ compatibility verified

Documentation

Complete specification documents added in specs/cloud-mode-optimization/

Resolves issues with cross-process cache pollution and tool filtering for cloud deployment.

binggg added 2 commits August 12, 2025 21:17
- Add cloud mode detection and management utilities
- Implement authentication state construction from environment variables
- Add CLI parameter --cloud-mode support (Node.js 18.15+ compatible)
- Filter incompatible plugins (interactive, setup) in cloud mode
- Skip local file operations when environment variables are present
- Add comprehensive tests and documentation
- Fix type compatibility issues with authentication state changes

Resolves cross-process cache pollution and tool filtering for cloud deployment
- Add shouldRegisterTool() and conditionalRegisterTool() functions
- Implement dynamic tool filtering based on cloud mode
- Filter cloud-incompatible tools: uploadFile, uploadFiles, updateFunctionCode, createFunction, downloadTemplate, downloadRemoteFile, interactiveDialog
- Update all tool registration to use conditional registration
- Maintain backward compatibility for local mode
- Add comprehensive tool filtering mechanism documentation

Resolves tool compatibility issues for cloud deployment environments
@binggg binggg merged commit 4e157b9 into main Aug 12, 2025
2 checks passed
binggg added a commit that referenced this pull request Sep 4, 2025
* feat(cloud-mode): add cloud mode support for MCP server πŸš€

- Add cloud mode detection and management utilities
- Implement authentication state construction from environment variables
- Add CLI parameter --cloud-mode support (Node.js 18.15+ compatible)
- Filter incompatible plugins (interactive, setup) in cloud mode
- Skip local file operations when environment variables are present
- Add comprehensive tests and documentation
- Fix type compatibility issues with authentication state changes

Resolves cross-process cache pollution and tool filtering for cloud deployment

* feat(cloud-mode): enhance tool-level conditional registration πŸ› οΈ

- Add shouldRegisterTool() and conditionalRegisterTool() functions
- Implement dynamic tool filtering based on cloud mode
- Filter cloud-incompatible tools: uploadFile, uploadFiles, updateFunctionCode, createFunction, downloadTemplate, downloadRemoteFile, interactiveDialog
- Update all tool registration to use conditional registration
- Maintain backward compatibility for local mode
- Add comprehensive tool filtering mechanism documentation

Resolves tool compatibility issues for cloud deployment environments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant