PayPal Sandbox MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@PayPal Sandbox MCP ServerCreate a PayPal payment for order ORD-00001, amount 49.99 EUR"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
PayPal Sandbox MCP Server
Servidor MCP remoto (Streamable HTTP) que expone dos tools de pago contra PayPal Sandbox, pensado exclusivamente para una demo de Salesforce Agentforce. Sin autenticación en el endpoint /mcp — solo apto para esta demo, nunca para producción.
1. Requisitos
Node.js >= 20
Una app de PayPal Developer (Sandbox) con
Client IDyClient Secret
Related MCP server: PayPal MCP Server
2. Instalación
cd paypal-mcp-server
npm install3. Variables de entorno
Copia .env.example a .env y rellena tus credenciales de Sandbox:
cp .env.example .envVariable | Descripción | Por defecto |
| Client ID de tu app de PayPal Sandbox | (obligatorio) |
| Client Secret de tu app de PayPal Sandbox | (obligatorio) |
| Debe ser |
|
| URL pública donde se desplegará este servidor (se usa para |
|
| Puerto HTTP |
|
| Nivel de log de pino |
|
El servidor nunca registra Client Secret, tokens de acceso ni cabeceras Authorization (ver src/logger.ts).
4. Arrancar localmente
npm run devo compilado:
npm run build
npm start5. Probar GET /health
curl http://localhost:3000/healthRespuesta esperada:
{ "status": "UP", "environment": "sandbox", "mcpEndpoint": "/mcp" }6. Probarlo con MCP Inspector
npx @modelcontextprotocol/inspectorEn la UI del Inspector, elige transporte Streamable HTTP y apunta a http://localhost:3000/mcp. Deberías poder listar las tools create_paypal_payment y finalize_paypal_payment y ejecutarlas.
7. Despliegue
Cualquier hosting Node 20 sirve (Render, Railway, Fly.io, etc.). Con el Dockerfile incluido (multi-stage, usuario no root):
docker build -t paypal-mcp-server .
docker run -p 3000:3000 --env-file .env paypal-mcp-serverEste proyecto vive en el repo público Horizon-CX/PayPal-Sandbox-MCP-Server — puedes conectarlo directamente desde Render/Railway como origen de despliegue continuo.
8. Variables de entorno en el hosting
Configura en el panel del proveedor (Render/Railway/Fly.io):
PAYPAL_CLIENT_IDPAYPAL_CLIENT_SECRETPAYPAL_ENVIRONMENT=sandboxPUBLIC_BASE_URL→ la URL pública final asignada por el hosting (por ejemplohttps://paypal-mcp-demo.onrender.com)PORT→ normalmente la inyecta el propio hosting; déjala solo si el proveedor lo requiere explícito
9. Registrar el servidor en Salesforce
En Setup → MCP Servers → New:
Campo | Valor |
MCP Server Name |
|
Server URL |
|
Authentication Method |
|
⚠️ "No Authentication" solo es aceptable para esta demo con PayPal Sandbox. No debe utilizarse así en producción.
10. Tools a seleccionar
create_paypal_paymentfinalize_paypal_payment
11. Ejemplos de input/output
create_paypal_payment
Input:
{
"salesforceOrderId": "801xx0000000001",
"orderNumber": "ORD-00001",
"amount": "49.99",
"currency": "EUR",
"description": "Pedido demo Agentforce"
}Output (structuredContent):
{
"success": true,
"salesforceOrderId": "801xx0000000001",
"orderNumber": "ORD-00001",
"paypalOrderId": "5O190127TN364715T",
"approvalUrl": "https://www.sandbox.paypal.com/checkoutnow?token=5O190127TN364715T",
"status": "CREATED",
"paid": false,
"amount": "49.99",
"currency": "EUR"
}finalize_paypal_payment
Input:
{
"salesforceOrderId": "801xx0000000001",
"paypalOrderId": "5O190127TN364715T"
}Output cuando el comprador ya aprobó y se captura correctamente:
{
"success": true,
"salesforceOrderId": "801xx0000000001",
"paypalOrderId": "5O190127TN364715T",
"paypalStatus": "COMPLETED",
"paymentStatus": "PAID",
"paid": true,
"captureId": "3C679366NW308354M",
"amount": "49.99",
"currency": "EUR"
}Output cuando el comprador aún no ha aprobado:
{
"success": true,
"salesforceOrderId": "801xx0000000001",
"paypalOrderId": "5O190127TN364715T",
"paypalStatus": "CREATED",
"paymentStatus": "PENDING_CUSTOMER_APPROVAL",
"paid": false,
"amount": "49.99",
"currency": "EUR"
}12. Advertencia
No Authentication solo es aceptable para esta demo con PayPal Sandbox. No debe utilizarse así en producción. Cualquier despliegue real de este patrón necesita autenticación en el endpoint /mcp (OAuth, API key, mTLS, etc.).
13. Crear un comprador PayPal Sandbox y aprobar el enlace
Entra en developer.paypal.com → Sandbox → Accounts.
Usa la cuenta personal (buyer) de sandbox que PayPal crea por defecto, o crea una nueva de tipo Personal.
Copia su email y contraseña de sandbox (botón "..." → View/edit account → Profile).
Abre el
approvalUrldevuelto porcreate_paypal_paymenten un navegador.Inicia sesión con las credenciales del comprador sandbox del paso 3.
Aprueba el pago ficticio.
Verás la página
/paypal/returnde este servidor confirmando la aprobación.Vuelve al chat de Agentforce y confirma que has pagado — esto debe disparar
finalize_paypal_payment.
Scripts
Script | Descripción |
| Arranca en modo desarrollo con recarga ( |
| Compila TypeScript a |
| Ejecuta el build compilado |
| Ejecuta los tests con Vitest |
| ESLint sobre |
| Comprueba tipos sin emitir ( |
Arquitectura
src/
index.ts Bootstrap: config, servidor HTTP, graceful shutdown
config.ts Validación de variables de entorno (Zod)
logger.ts Logger pino con redacción de secretos
paypal/
paypalClient.ts Cliente PayPal: OAuth2 con cache de token, createOrder/getOrder/captureOrder
paypalTypes.ts Tipos de las respuestas de PayPal
paypalErrors.ts Errores de dominio (nunca exponen credenciales/tokens)
mcp/
createServer.ts Registro de las dos tools MCP
tools/
createPayPalPayment.ts
finalizePayPalPayment.ts
http/
app.ts Express: /health, /paypal/return, /paypal/cancel, /mcp (POST/GET/DELETE)
errorHandler.ts Middleware de errores centralizado
tests/
paypalClient.test.ts
createPayPalPayment.test.ts
finalizePayPalPayment.test.tsThis server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityCmaintenanceThe PayPal Model Context Protocol server allows you to integrate with PayPal APIs through function calling. This protocol supports various tools to interact with different PayPal services.393189
- Alicense-qualityDmaintenanceA Python implementation that enables Large Language Models to interact with PayPal's APIs through function calling, supporting features like invoices, orders, products, subscriptions, and transactions.1MIT
- Flicense-qualityDmaintenanceEnables AI systems to interact with PayPal Braintree payment processing, allowing them to fetch transactions, create payments, and manage customer data via MCP tools.4
- Flicense-qualityDmaintenanceEnables LLMs to create PayPal invoices through a simple tool interface.
Related MCP Connectors
PayPal MCP Pack — read-only access to PayPal transactions, orders, invoices, and disputes.
Agent Commerce Protocol MCP — bridges Stripe ACP + Google AP2 + Coinbase x402 for agent payments
Taiwan payments (ECPay 綠界 + NewebPay 藍新) & e-invoices for AI agents. Stateless, never holds funds.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Horizon-CX/PayPal-Sandbox-MCP-Server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server