云环境配置MCP服务器
总结
目录
安装
Claude Desktop
使用预构建的作为桌面扩展安装MCP服务器 mcp-server.mcpb 文件:
只需拖放 mcp-server.mcpb 将文件安装到Claude Desktop上以安装扩展。
MCP捆绑包包括MCP服务器和所有必要的配置。安装后,服务器将无需额外设置即可使用。
\[!注意\] MCP捆绑包提供了一种简化的方式来打包和分发MCP服务器。更多了解 桌面扩展.
Cursor

或手动:
- 打开光标设置
- 选择工具和集成
- 选择新MCP服务器
- 如果配置文件为空,请将以下JSON粘贴到MCP服务器配置中:
{
"command": "npx",
"args": [
"@cloudinary/environment-config-mcp",
"start",
"--api-key",
"",
"--api-secret",
"",
"--cloud-name",
""
]
}Claude Code CLI
claude mcp add CloudinaryEnvConfig -- npx -y @cloudinary/environment-config-mcp start --api-key --api-secret --cloud-name Gemini
gemini mcp add CloudinaryEnvConfig -- npx -y @cloudinary/environment-config-mcp start --api-key --api-secret --cloud-name Windsurf
参见 官方Windsurf文档 获取最新信息
- 打开风帆设置
- 在左侧菜单中选择Cascade
- 点击
Manage MCPs(要管理MCP,您应该使用Windsurf帐户登录) - 点击
View raw config打开mcp配置文件。 - 如果配置文件为空,请粘贴完整的json
{
"command": "npx",
"args": [
"@cloudinary/environment-config-mcp",
"start",
"--api-key",
"",
"--api-secret",
"",
"--cloud-name",
""
]
}VS Code

或手动:
参见 官方VS Code文档 获取最新信息
- 打开 命令面板
- 搜索并打开
MCP: Open User Configuration。这应该会打开mcp.json文件 - 如果配置文件为空,请粘贴完整的json
{
"command": "npx",
"args": [
"@cloudinary/environment-config-mcp",
"start",
"--api-key",
"",
"--api-secret",
"",
"--cloud-name",
""
]
}Stdio installation via npm To start the MCP server, run:
npx @cloudinary/environment-config-mcp start --api-key --api-secret --cloud-name 有关服务器参数的完整列表,请运行:
npx @cloudinary/environment-config-mcp --help配置
环境变量
MCP服务器支持以下环境变量:
| 变量 | 描述 | 必填 |
|---|---|---|
CLOUDINARY_CLOUD_NAME | 您的Cloudinary云名称 | 是 |
CLOUDINARY_API_KEY | 您的Cloudinary API密钥 | 是 |
CLOUDINARY_API_SECRET | 您的Cloudinary API秘密 | 是 |
CLOUDINARY_URL | 完整的Cloudinary URL(可替代单个变量) | 否 |
CLOUDINARY_URL格式
您可以使用单个 CLOUDINARY_URL 而不是单个变量:
CLOUDINARY_URL=cloudinary://API_KEY:API_SECRET@CLOUD_NAME认证
MCP服务器使用您的Cloudinary API密钥和机密进行身份验证:
{
"env": {
"CLOUDINARY_CLOUD_NAME": "demo",
"CLOUDINARY_API_KEY": "123456789012345",
"CLOUDINARY_API_SECRET": "abcdefghijklmnopqrstuvwxyz12"
}
}可用工具
MCP服务器将Cloudinary的环境配置API作为工具公开。使用您的AI应用程序来发现和调用用于管理转换、上传预设、流式配置文件、触发器和上传映射的可用工具。
使用示例
示例1:管理命名转换
1. List transformations: "Show me all named transformations in my account"
2. Create transformation: "Create a named transformation 't_thumbnail' with 'c_fill,w_200,h_200'"
3. Update transformation: "Update transformation 't_thumbnail' to add sharpen effect"
4. Delete transformation: "Delete the transformation named 't_old_banner'"示例2:配置上传预设
1. List presets: "Show all my upload presets"
2. Create preset: "Create an upload preset named 'user_avatars' with auto tagging enabled"
3. Get details: "Show me the configuration for upload preset 'product_images'"
4. Update preset: "Update 'user_avatars' preset to use 'square' eager transformation"示例3:管理流媒体配置文件
1. List profiles: "Show all streaming profiles"
2. Get profile: "Get details for the 'hd' streaming profile"
3. Create profile: "Create a custom streaming profile for 4K video"
4. Update profile: "Update the 'mobile' profile with lower bitrate settings"示例4:配置Webhooks(触发器)
1. List triggers: "Show all webhook triggers configured in my account"
2. Create trigger: "Create a webhook trigger for upload events to https://myapp.com/webhooks"
3. Update trigger: "Update the webhook URL for trigger [trigger-id]"
4. Delete trigger: "Delete the webhook trigger [trigger-id]"示例5:管理上传映射
1. List mappings: "Show all upload folder mappings"
2. Create mapping: "Map folder 'blog' to template 'https://example.com/blog/%s'"
3. Update mapping: "Update the mapping for 'blog' folder"
4. Delete mapping: "Remove the upload mapping for 'old-site' folder"发展
从源头构建
先决条件
- Node.js v20或更高版本
- npm、pnpm、包子或纱线
构建步骤
# Clone the repository
git clone https://github.com/cloudinary/environment-config-mcp.git
cd environment-config-mcp
# Install dependencies
npm install
# Build the project
npm run build
# Run locally
npm start项目结构
environment-config-mcp/
├── src/
│ ├── hooks/ # Custom authentication hooks
│ ├── mcp-server/ # MCP server implementation
│ │ ├── server.ts # Main server (auto-generated)
│ │ └── tools/ # Generated tool wrappers
│ ├── funcs/ # API function implementations
│ └── models/ # Type definitions
├── .github/
│ └── workflows/ # CI/CD workflows
└── .speakeasy/ # Speakeasy configuration贡献
虽然我们重视对此MCP服务器的贡献,但代码是以编程方式生成的。对生成文件的任何手动更改都将在下一代上被覆盖。
您可以贡献什么:
- ✅ 自定义挂钩
src/hooks/ - ✅ 文档改进
- ✅ 错误报告
生成的文件(不可编辑):
- ❌
src/mcp-server/server.ts - ❌
src/mcp-server/tools/*.ts - ❌
src/funcs/*.ts - ❌
src/models/*.ts
我们期待着您的反馈。请随时打开PR或问题,并提供概念证明,我们将尽最大努力将其纳入未来的版本中。
______________________________________________________________________
MCP服务器由创建 地下酒吧
渐进式发现
具有许多工具的MCP服务器可能会使LLM上下文窗口膨胀,导致令牌使用增加和工具混乱。动态模式通过只公开一小部分元工具来解决这个问题,这些元工具让代理根据需要逐步发现和调用工具。
要启用动态模式,请传递 --mode dynamic 启动服务器时标记:
{
"mcpServers": {
"CloudinaryEnvConfig": {
"command": "npx",
"args": ["@cloudinary/environment-config-mcp", "start", "--mode", "dynamic"],
// ... other server arguments
}
}
}在动态模式下,服务器只注册以下元工具,而不是每个单独的工具:
list_tools:列出所有可用工具及其名称和描述。describe_tool:按名称返回一个或多个工具的输入架构。execute_tool:使用提供的输入参数按名称执行工具。list_scopes:列出服务器上可用的作用域。
这种方法显著减少了每次请求时发送到LLM的令牌数量,这对于具有大量工具的服务器特别有用。
您可以将动态模式与范围和工具过滤器相结合:
{
"mcpServers": {
"CloudinaryEnvConfig": {
"command": "npx",
"args": ["@cloudinary/environment-config-mcp", "start", "--mode", "dynamic", "--scope", "admin"],
// ... other server arguments
}
}
}