- Replace API Key/Secret auth with Account SID/Auth Token - Configure MCP during Docker build instead of runtime - Remove mcp-config.json and config directory - Simplify startup script by removing MCP configuration logic - Update documentation and test scripts for new auth method The MCP server is now configured directly in the Dockerfile using 'claude mcp add-json' command, making the setup more reliable and eliminating runtime configuration complexity.
59 lines
1.8 KiB
JavaScript
Executable File
59 lines
1.8 KiB
JavaScript
Executable File
#!/usr/bin/env node
|
|
|
|
// Test script to verify Twilio SMS functionality
|
|
const accountSid = process.env.TWILIO_ACCOUNT_SID;
|
|
const authToken = process.env.TWILIO_AUTH_TOKEN;
|
|
const fromNumber = process.env.TWILIO_FROM_NUMBER;
|
|
const toNumber = process.env.TWILIO_TO_NUMBER;
|
|
|
|
console.log('Twilio Test Configuration:');
|
|
console.log(`Account SID: ${accountSid?.substring(0, 10)}...`);
|
|
console.log(`Auth Token: ${authToken ? '***' + authToken.substring(authToken.length - 4) : 'Not set'}`);
|
|
console.log(`From: ${fromNumber}`);
|
|
console.log(`To: ${toNumber}`);
|
|
|
|
// Using Twilio REST API directly
|
|
const https = require('https');
|
|
|
|
const auth = Buffer.from(`${accountSid}:${authToken}`).toString('base64');
|
|
const data = new URLSearchParams({
|
|
To: toNumber,
|
|
From: fromNumber,
|
|
Body: 'MCP is working! This is a test message from Claude Docker.'
|
|
});
|
|
|
|
const options = {
|
|
hostname: 'api.twilio.com',
|
|
port: 443,
|
|
path: `/2010-04-01/Accounts/${accountSid}/Messages.json`,
|
|
method: 'POST',
|
|
headers: {
|
|
'Authorization': `Basic ${auth}`,
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
'Content-Length': data.toString().length
|
|
}
|
|
};
|
|
|
|
const req = https.request(options, (res) => {
|
|
let body = '';
|
|
res.on('data', (chunk) => body += chunk);
|
|
res.on('end', () => {
|
|
if (res.statusCode === 201) {
|
|
console.log('\n✅ SMS sent successfully!');
|
|
const response = JSON.parse(body);
|
|
console.log(`Message SID: ${response.sid}`);
|
|
console.log(`Status: ${response.status}`);
|
|
} else {
|
|
console.error('\n❌ Failed to send SMS');
|
|
console.error(`Status: ${res.statusCode}`);
|
|
console.error(`Response: ${body}`);
|
|
}
|
|
});
|
|
});
|
|
|
|
req.on('error', (e) => {
|
|
console.error(`Problem with request: ${e.message}`);
|
|
});
|
|
|
|
req.write(data.toString());
|
|
req.end(); |