Add 3 files
Browse files- README.md +6 -4
- index.html +291 -19
- prompts.txt +1 -0
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
colorTo: purple
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: termux
|
| 3 |
+
emoji: 🐳
|
| 4 |
+
colorFrom: gray
|
| 5 |
colorTo: purple
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
|
@@ -1,19 +1,291 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>PayPal MCP Termux Installer</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 9 |
+
<style>
|
| 10 |
+
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&display=swap');
|
| 11 |
+
|
| 12 |
+
body {
|
| 13 |
+
font-family: 'Fira Code', monospace;
|
| 14 |
+
background-color: #1a1a1a;
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
.terminal {
|
| 18 |
+
background-color: #0a0a0a;
|
| 19 |
+
border-radius: 10px;
|
| 20 |
+
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
|
| 21 |
+
overflow: hidden;
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
.terminal-header {
|
| 25 |
+
background: linear-gradient(90deg, #333, #222);
|
| 26 |
+
padding: 8px 15px;
|
| 27 |
+
border-top-left-radius: 8px;
|
| 28 |
+
border-top-right-radius: 8px;
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
.terminal-body {
|
| 32 |
+
height: 500px;
|
| 33 |
+
overflow-y: auto;
|
| 34 |
+
padding: 20px;
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
.command-line {
|
| 38 |
+
display: flex;
|
| 39 |
+
align-items: center;
|
| 40 |
+
margin-top: 15px;
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
.prompt {
|
| 44 |
+
color: #4CAF50;
|
| 45 |
+
margin-right: 10px;
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
.cursor {
|
| 49 |
+
display: inline-block;
|
| 50 |
+
width: 10px;
|
| 51 |
+
height: 18px;
|
| 52 |
+
background-color: #4CAF50;
|
| 53 |
+
animation: blink 1s infinite;
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
@keyframes blink {
|
| 57 |
+
0%, 100% { opacity: 1; }
|
| 58 |
+
50% { opacity: 0; }
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
.red { color: #ff5555; }
|
| 62 |
+
.green { color: #50fa7b; }
|
| 63 |
+
.yellow { color: #f1fa8c; }
|
| 64 |
+
.blue { color: #8be9fd; }
|
| 65 |
+
|
| 66 |
+
.progress-bar {
|
| 67 |
+
height: 5px;
|
| 68 |
+
background: linear-gradient(90deg, #4CAF50, #8BC34A);
|
| 69 |
+
border-radius: 3px;
|
| 70 |
+
transition: width 0.5s ease;
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
.btn-paypal {
|
| 74 |
+
background: linear-gradient(90deg, #0070BA, #003087);
|
| 75 |
+
color: white;
|
| 76 |
+
border: none;
|
| 77 |
+
transition: all 0.3s;
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
+
.btn-paypal:hover {
|
| 81 |
+
transform: translateY(-2px);
|
| 82 |
+
box-shadow: 0 5px 15px rgba(0, 112, 186, 0.4);
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
/* Custom scrollbar */
|
| 86 |
+
::-webkit-scrollbar {
|
| 87 |
+
width: 8px;
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
::-webkit-scrollbar-track {
|
| 91 |
+
background: #222;
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
::-webkit-scrollbar-thumb {
|
| 95 |
+
background: #444;
|
| 96 |
+
border-radius: 4px;
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
::-webkit-scrollbar-thumb:hover {
|
| 100 |
+
background: #555;
|
| 101 |
+
}
|
| 102 |
+
</style>
|
| 103 |
+
</head>
|
| 104 |
+
<body class="min-h-screen flex items-center justify-center p-4">
|
| 105 |
+
<div class="terminal w-full max-w-3xl">
|
| 106 |
+
<div class="terminal-header flex items-center">
|
| 107 |
+
<div class="flex space-x-2 mr-4">
|
| 108 |
+
<div class="w-3 h-3 rounded-full bg-red-500"></div>
|
| 109 |
+
<div class="w-3 h-3 rounded-full bg-yellow-500"></div>
|
| 110 |
+
<div class="w-3 h-3 rounded-full bg-green-500"></div>
|
| 111 |
+
</div>
|
| 112 |
+
<div class="text-white text-sm">PayPal MCP Termux Installer</div>
|
| 113 |
+
<div class="ml-auto flex items-center">
|
| 114 |
+
<i class="fab fa-paypal text-white mr-2"></i>
|
| 115 |
+
<i class="fab fa-node-js text-green-400"></i>
|
| 116 |
+
</div>
|
| 117 |
+
</div>
|
| 118 |
+
|
| 119 |
+
<div class="terminal-body text-gray-200">
|
| 120 |
+
<div class="mb-4">
|
| 121 |
+
<div class="text-blue-400"># PayPal MCP Termux Installer</div>
|
| 122 |
+
<div class="text-blue-400"># This script automates the setup of PayPal MCP server in Termux</div>
|
| 123 |
+
</div>
|
| 124 |
+
|
| 125 |
+
<div class="mb-6">
|
| 126 |
+
<div class="flex items-center mb-2">
|
| 127 |
+
<span class="yellow mr-2">[1/5]</span>
|
| 128 |
+
<span>Updating packages...</span>
|
| 129 |
+
</div>
|
| 130 |
+
<div class="progress-bar w-full mb-2"></div>
|
| 131 |
+
<div class="text-green-500 text-sm">✓ Successfully updated all packages</div>
|
| 132 |
+
</div>
|
| 133 |
+
|
| 134 |
+
<div class="mb-6">
|
| 135 |
+
<div class="flex items-center mb-2">
|
| 136 |
+
<span class="yellow mr-2">[2/5]</span>
|
| 137 |
+
<span>Installing dependencies...</span>
|
| 138 |
+
</div>
|
| 139 |
+
<div class="text-sm mb-2">
|
| 140 |
+
<div class="text-gray-400">> Installing nodejs...</div>
|
| 141 |
+
<div class="text-gray-400">> Installing curl...</div>
|
| 142 |
+
<div class="text-gray-400">> Installing jq...</div>
|
| 143 |
+
</div>
|
| 144 |
+
<div class="progress-bar w-3/4 mb-2"></div>
|
| 145 |
+
<div class="text-green-500 text-sm">✓ Node.js v18.15.0 installed successfully</div>
|
| 146 |
+
</div>
|
| 147 |
+
|
| 148 |
+
<div class="mb-6">
|
| 149 |
+
<div class="yellow mb-2">PayPal Access Token Generation</div>
|
| 150 |
+
<div class="bg-gray-800 p-4 rounded mb-4">
|
| 151 |
+
<div class="mb-3">
|
| 152 |
+
<label class="block text-gray-400 mb-1">PayPal Client ID</label>
|
| 153 |
+
<input type="text" class="w-full bg-gray-700 text-white p-2 rounded" value="AeA**********************">
|
| 154 |
+
</div>
|
| 155 |
+
<div class="mb-3">
|
| 156 |
+
<label class="block text-gray-400 mb-1">PayPal Client Secret</label>
|
| 157 |
+
<input type="text" class="w-full bg-gray-700 text-white p-2 rounded" value="EC0**********************">
|
| 158 |
+
</div>
|
| 159 |
+
<div class="mb-3">
|
| 160 |
+
<label class="block text-gray-400 mb-1">Environment</label>
|
| 161 |
+
<select class="w-full bg-gray-700 text-white p-2 rounded">
|
| 162 |
+
<option>SANDBOX</option>
|
| 163 |
+
<option>PRODUCTION</option>
|
| 164 |
+
</select>
|
| 165 |
+
</div>
|
| 166 |
+
<button class="btn-paypal px-4 py-2 rounded font-bold w-full">
|
| 167 |
+
Generate Access Token
|
| 168 |
+
</button>
|
| 169 |
+
</div>
|
| 170 |
+
<div class="text-green-500">
|
| 171 |
+
✓ Access token generated successfully!
|
| 172 |
+
<div class="text-yellow-300 mt-1">Token: <span class="text-gray-400">A21**********************</span></div>
|
| 173 |
+
<div class="text-yellow-300">Environment: <span class="text-gray-400">SANDBOX</span></div>
|
| 174 |
+
<div class="text-yellow-300">Expires in: <span class="text-gray-400">32400 seconds</span></div>
|
| 175 |
+
</div>
|
| 176 |
+
</div>
|
| 177 |
+
|
| 178 |
+
<div class="mb-6">
|
| 179 |
+
<div class="flex items-center mb-2">
|
| 180 |
+
<span class="yellow mr-2">[3/5]</span>
|
| 181 |
+
<span>Installing PayPal MCP server...</span>
|
| 182 |
+
</div>
|
| 183 |
+
<div class="text-sm mb-2">
|
| 184 |
+
<div class="text-gray-400">> npm install -g @paypal/mcp</div>
|
| 185 |
+
<div class="text-gray-400">+ @paypal/mcp@2.1.3</div>
|
| 186 |
+
</div>
|
| 187 |
+
<div class="progress-bar w-1/2 mb-2"></div>
|
| 188 |
+
<div class="text-green-500 text-sm">✓ PayPal MCP installed successfully</div>
|
| 189 |
+
</div>
|
| 190 |
+
|
| 191 |
+
<div class="mb-6">
|
| 192 |
+
<div class="flex items-center mb-2">
|
| 193 |
+
<span class="yellow mr-2">[4/5]</span>
|
| 194 |
+
<span>Creating run script...</span>
|
| 195 |
+
</div>
|
| 196 |
+
<div class="bg-gray-800 p-3 rounded text-sm mb-2 font-mono overflow-x-auto">
|
| 197 |
+
<div class="text-blue-400">#!/bin/bash</div>
|
| 198 |
+
<div>echo -e "\033[0;32mStarting PayPal MCP server...\033[0m"</div>
|
| 199 |
+
<div>npx -y @paypal/mcp --tools=all \</div>
|
| 200 |
+
<div>PAYPAL_ACCESS_TOKEN="$PAYPAL_ACCESS_TOKEN" \</div>
|
| 201 |
+
<div>PAYPAL_ENVIRONMENT="$PAYPAL_ENVIRONMENT"</div>
|
| 202 |
+
</div>
|
| 203 |
+
<div class="text-green-500 text-sm">✓ Run script created at ~/paypal-mcp.sh</div>
|
| 204 |
+
</div>
|
| 205 |
+
|
| 206 |
+
<div class="mb-6">
|
| 207 |
+
<div class="flex items-center mb-2">
|
| 208 |
+
<span class="yellow mr-2">[5/5]</span>
|
| 209 |
+
<span>Setting up alias...</span>
|
| 210 |
+
</div>
|
| 211 |
+
<div class="text-gray-400 mb-2">Added to ~/.bashrc: alias paypal-mcp='~/paypal-mcp.sh'</div>
|
| 212 |
+
<div class="progress-bar w-full mb-2"></div>
|
| 213 |
+
<div class="text-green-500 text-sm">✓ Alias configured successfully</div>
|
| 214 |
+
</div>
|
| 215 |
+
|
| 216 |
+
<div class="bg-green-900 bg-opacity-30 p-4 rounded border border-green-700">
|
| 217 |
+
<div class="text-green-400 font-bold mb-2">Setup completed successfully!</div>
|
| 218 |
+
<div class="mb-1">You can now start the PayPal MCP server by typing: <span class="yellow">paypal-mcp</span></div>
|
| 219 |
+
<div class="mb-1">To use this in Claude Desktop, configure with these values:</div>
|
| 220 |
+
<div class="ml-4">
|
| 221 |
+
<div>Access Token: <span class="yellow">A21**********************</span></div>
|
| 222 |
+
<div>Environment: <span class="yellow">SANDBOX</span></div>
|
| 223 |
+
</div>
|
| 224 |
+
</div>
|
| 225 |
+
|
| 226 |
+
<div class="command-line mt-6">
|
| 227 |
+
<span class="prompt">$</span>
|
| 228 |
+
<span class="flex-1">paypal-mcp</span>
|
| 229 |
+
<span class="cursor"></span>
|
| 230 |
+
</div>
|
| 231 |
+
</div>
|
| 232 |
+
</div>
|
| 233 |
+
|
| 234 |
+
<script>
|
| 235 |
+
// Animate progress bars
|
| 236 |
+
document.addEventListener('DOMContentLoaded', function() {
|
| 237 |
+
const progressBars = document.querySelectorAll('.progress-bar');
|
| 238 |
+
|
| 239 |
+
progressBars.forEach(bar => {
|
| 240 |
+
// Reset width to 0
|
| 241 |
+
bar.style.width = '0';
|
| 242 |
+
|
| 243 |
+
// Animate after a small delay
|
| 244 |
+
setTimeout(() => {
|
| 245 |
+
const targetWidth = bar.parentElement.querySelector('.yellow') ?
|
| 246 |
+
(bar.parentElement.querySelector('.yellow').textContent.includes('[1/5]') ? '100%' :
|
| 247 |
+
bar.parentElement.querySelector('.yellow').textContent.includes('[2/5]') ? '75%' :
|
| 248 |
+
bar.parentElement.querySelector('.yellow').textContent.includes('[3/5]') ? '50%' :
|
| 249 |
+
bar.parentElement.querySelector('.yellow').textContent.includes('[4/5]') ? '25%' : '100%') : '100%';
|
| 250 |
+
|
| 251 |
+
bar.style.width = targetWidth;
|
| 252 |
+
}, 300);
|
| 253 |
+
});
|
| 254 |
+
|
| 255 |
+
// Simulate typing in the command line
|
| 256 |
+
const commands = [
|
| 257 |
+
"paypal-mcp",
|
| 258 |
+
"npm start",
|
| 259 |
+
"node server.js"
|
| 260 |
+
];
|
| 261 |
+
|
| 262 |
+
let currentCommand = 0;
|
| 263 |
+
let currentChar = 0;
|
| 264 |
+
const commandLine = document.querySelector('.command-line span:nth-child(2)');
|
| 265 |
+
|
| 266 |
+
function typeCommand() {
|
| 267 |
+
if (currentChar < commands[currentCommand].length) {
|
| 268 |
+
commandLine.textContent += commands[currentCommand].charAt(currentChar);
|
| 269 |
+
currentChar++;
|
| 270 |
+
setTimeout(typeCommand, 100);
|
| 271 |
+
} else {
|
| 272 |
+
setTimeout(eraseCommand, 1500);
|
| 273 |
+
}
|
| 274 |
+
}
|
| 275 |
+
|
| 276 |
+
function eraseCommand() {
|
| 277 |
+
if (commandLine.textContent.length > 0) {
|
| 278 |
+
commandLine.textContent = commandLine.textContent.substring(0, commandLine.textContent.length - 1);
|
| 279 |
+
setTimeout(eraseCommand, 50);
|
| 280 |
+
} else {
|
| 281 |
+
currentCommand = (currentCommand + 1) % commands.length;
|
| 282 |
+
currentChar = 0;
|
| 283 |
+
setTimeout(typeCommand, 500);
|
| 284 |
+
}
|
| 285 |
+
}
|
| 286 |
+
|
| 287 |
+
setTimeout(typeCommand, 1000);
|
| 288 |
+
});
|
| 289 |
+
</script>
|
| 290 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Drewtu/termux" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 291 |
+
</html>
|
prompts.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
Created:29 Apr 2025, 20:32:15(4 hours) #!/bin/bash # PayPal MCP Termux Installer # This script automates the setup of PayPal MCP server in Termux # Colors RED='\033[0;31m' GREEN='\033[0;32m' YELLOW='\033[1;33m' NC='\033[0m' # Check if running in Termux if ! [ -x "$(command -v termux-setup-storage)" ]; then echo -e "${RED}Error: This script is designed to run in Termux only.${NC}" exit 1 fi # Update packages echo -e "${YELLOW}[1/5] Updating packages...${NC}" pkg update -y && pkg upgrade -y # Install required packages echo -e "${YELLOW}[2/5] Installing dependencies...${NC}" pkg install -y nodejs curl jq # Verify Node.js installation if ! [ -x "$(command -v node)" ]; then echo -e "${RED}Error: Node.js installation failed.${NC}" exit 1 fi echo -e "${GREEN}Node.js $(node -v) installed successfully.${NC}" # Function to generate PayPal access token generate_access_token() { echo -e "\n${YELLOW}PayPal Access Token Generation${NC}" read -p "Enter PayPal Client ID: " client_id read -p "Enter PayPal Client Secret: " client_secret read -p "Environment (SANDBOX/PRODUCTION): " environment if [ "$environment" = "PRODUCTION" ]; then api_url="https://api-m.paypal.com" else api_url="https://api-m.sandbox.paypal.com" environment="SANDBOX" fi echo -e "${YELLOW}Generating access token...${NC}" response=$(curl -s "$api_url/v1/oauth2/token" \ -H "Accept: application/json" \ -H "Accept-Language: en_US" \ -u "$client_id:$client_secret" \ -d "grant_type=client_credentials") access_token=$(echo "$response" | jq -r '.access_token') if [ -z "$access_token" ] || [ "$access_token" = "null" ]; then echo -e "${RED}Error generating access token:${NC}" echo "$response" exit 1 fi echo -e "${GREEN}Access token generated successfully!${NC}" echo -e "Token: ${YELLOW}$access_token${NC}" echo -e "Environment: ${YELLOW}$environment${NC}" echo -e "Expires in: ${YELLOW}$(echo "$response" | jq -r '.expires_in') seconds${NC}" # Save to environment variables export PAYPAL_ACCESS_TOKEN="$access_token" export PAYPAL_ENVIRONMENT="$environment" } # Generate or use existing token if [ -z "$PAYPAL_ACCESS_TOKEN" ]; then generate_access_token else echo -e "${GREEN}Using existing PayPal access token from environment variables.${NC}" read -p "Do you want to generate a new token? (y/n): " choice if [[ "$choice" =~ [yY] ]]; then generate_access_token fi fi # Install PayPal MCP echo -e "\n${YELLOW}[3/5] Installing PayPal MCP server...${NC}" npm install -g @paypal/mcp # Create run script echo -e "${YELLOW}[4/5] Creating run script...${NC}" cat > ~/paypal-mcp.sh <<EOF #!/bin/bash echo -e "${GREEN}Starting PayPal MCP server...${NC}" npx -y @paypal/mcp --tools=all PAYPAL_ACCESS_TOKEN="$PAYPAL_ACCESS_TOKEN" PAYPAL_ENVIRONMENT="$PAYPAL_ENVIRONMENT" EOF chmod +x ~/paypal-mcp.sh # Add alias to bashrc echo -e "${YELLOW}[5/5] Setting up alias...${NC}" echo "alias paypal-mcp='~/paypal-mcp.sh'" >> ~/.bashrc source ~/.bashrc # Completion message echo -e "\n${GREEN}Setup completed successfully!${NC}" echo -e "You can now start the PayPal MCP server by typing: ${YELLOW}paypal-mcp${NC}" echo -e "To use this in Claude Desktop, configure with these values:" echo -e "Access Token: ${YELLOW}$PAYPAL_ACCESS_TOKEN${NC}" echo -e "Environment: ${YELLOW}$PAYPAL_ENVIRONMENT${NC}" # Start server prompt read -p "Do you want to start the PayPal MCP server now? (y/n): " start_now if [[ "$start_now" =~ [yY] ]]; then ~/paypal-mcp.sh fi Paste
|