R2 Bucket MCP
Enables file operations (upload, download, list, delete) on Cloudflare R2 (S3-compatible) storage, with dedicated APK upload tool.
README
r2-bucket-mcp
Servidor MCP stdio para Cursor y otros clientes MCP. Sube archivos locales a Cloudflare R2 (S3-compatible) sin ejecutar scripts shell. Pensado para APKs de proyectos (vitalo, linkbox, nestle, …) y cualquier otro archivo.
Qué hace
Expone cinco tools MCP:
| Tool | Uso |
|---|---|
upload_apk |
APKs con key {project}/{version}/{filename} |
upload_file |
Cualquier archivo con key opcional |
get_file |
Descargar por key (URL o guardar local) |
list_files |
Listar objetos por prefijo |
delete_file |
Borrar objeto por key |
La respuesta incluye downloadUrl (URL pública CDN si R2_PUBLIC_BASE_URL está configurada, o presigned URL temporal).
Instalación
cd /Users/samuelgerardocastrolopez/Desktop/r2-bucket-mcp
npm install
Credenciales R2
Usa las mismas variables que opencode_whatsapp/.env (sin copiar secretos al repo):
- Abre
opencode_whatsapp/.enven tu máquina. - Copia los valores de
R2_ACCESS_KEY_ID,R2_SECRET_ACCESS_KEY,R2_BUCKET,R2_ENDPOINT(oR2_ACCOUNT_ID), y opcionalmenteR2_PUBLIC_BASE_URL. - Para pruebas locales, crea
.enven este repo desde.env.example(nunca lo commitees).
| Variable | Requerida | Descripción |
|---|---|---|
R2_ACCESS_KEY_ID |
sí | Access key R2 |
R2_SECRET_ACCESS_KEY |
sí | Secret key R2 |
R2_BUCKET |
sí | Bucket (default: apks) |
R2_ENDPOINT |
sí* | Endpoint S3-compatible |
R2_ACCOUNT_ID |
sí* | Alternativa a endpoint explícito |
R2_KEY_PREFIX |
no | Prefijo global opcional |
R2_PUBLIC_BASE_URL |
no | CDN pública; si falta, presigned URL |
R2_PRESIGNED_TTL_SECS |
no | Default: 604800 (7 días) |
R2_MAX_FILE_BYTES |
no | Límite validación MCP (default: 500 MB) |
* Al menos uno de R2_ENDPOINT o R2_ACCOUNT_ID.
Prueba manual
Arranque stdio (proceso queda esperando; Ctrl+C para salir):
node index.js
# stderr: [r2-bucket-mcp] ready (stdio)
Smoke test con credenciales en .env local (sube un .smoke-test.txt temporal):
npm run smoke
Registrar en Cursor
Settings → MCP o edita ~/.cursor/mcp.json.
Usa la ruta absoluta de node (which node). Ejemplo:
{
"mcpServers": {
"r2-bucket": {
"type": "stdio",
"command": "/Users/samuelgerardocastrolopez/.nvm/versions/node/v22.17.0/bin/node",
"args": [
"/Users/samuelgerardocastrolopez/Desktop/r2-bucket-mcp/index.js"
],
"env": {
"R2_ACCESS_KEY_ID": "PEGAR_ACCESS_KEY",
"R2_SECRET_ACCESS_KEY": "PEGAR_SECRET_KEY",
"R2_BUCKET": "apks",
"R2_ENDPOINT": "https://<account-id>.r2.cloudflarestorage.com",
"R2_PUBLIC_BASE_URL": "https://cdn.tudominio.com"
}
}
}
}
Reinicia Cursor o recarga servidores MCP tras cambiar mcp.json.
Uso desde agentes
- APKs: preferir
upload_apkconproject,versionyfilePathabsoluto. - Otros archivos:
upload_fileconfilePathy opcionalmentekey,prefix,contentType. - Listar:
list_filesconprefixopcional (ej.vitalo/). - Descargar:
get_fileconkey; opcionalfilePathabsoluto para guardar en disco. - Borrar:
delete_fileconkeycompleta (ej.vitalo/2.1.0/app-release.apk).
Ejemplo de key generada por upload_apk:
vitalo/2.1.0/app-release.apk
Respuesta JSON (campo principal para compartir el enlace):
{
"ok": true,
"bucket": "apks",
"key": "vitalo/2.1.0/app-release.apk",
"size": 12345678,
"contentType": "application/vnd.android.package-archive",
"downloadUrl": "https://cdn.tudominio.com/vitalo/2.1.0/app-release.apk",
"publicUrl": "https://cdn.tudominio.com/vitalo/2.1.0/app-release.apk",
"presignedUrl": null
}
Si no hay R2_PUBLIC_BASE_URL, downloadUrl será una presigned URL y publicUrl será null.
Integración SDK
Con un agente SDK local y settingSources: ['user'], el agente carga el mismo MCP definido en ~/.cursor/mcp.json. También puedes pasar mcpServers inline en la config del agente con las mismas credenciales en env.
Tools
upload_file
| Parámetro | Requerido | Descripción |
|---|---|---|
filePath |
sí | Ruta absoluta al archivo local |
key |
no | Clave en el bucket (default: basename) |
prefix |
no | Prefijo override (sin R2_KEY_PREFIX global) |
contentType |
no | MIME explícito |
upload_apk
| Parámetro | Requerido | Descripción |
|---|---|---|
filePath |
sí | Ruta absoluta al APK |
project |
sí | Alias (vitalo, linkbox, …) |
version |
sí | Versión (2.1.0) |
filename |
no | Default: app-release.apk |
get_file
| Parámetro | Requerido | Descripción |
|---|---|---|
key |
sí | Clave del objeto (ej. vitalo/2.1.0/app-release.apk) |
filePath |
no | Ruta absoluta local para guardar; sin ella solo devuelve URLs |
list_files
| Parámetro | Requerido | Descripción |
|---|---|---|
prefix |
no | Filtro de prefijo (ej. vitalo/, vitalo/2.1.0/) |
maxKeys |
no | Máximo por página (default: 100, max: 1000) |
continuationToken |
no | Token de paginación de una respuesta anterior |
delete_file
| Parámetro | Requerido | Descripción |
|---|---|---|
key |
sí | Clave del objeto (ej. vitalo/2.1.0/app-release.apk) |
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.