At this stage, the code is known to work and has been thoroughly tested
This commit is contained in:
Executable
+28
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
HOST="${MCP_HOST:-0.0.0.0}"
|
||||
PORT="${MCP_PORT:-8787}"
|
||||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
|
||||
if [[ "${MCP_ALLOW_UNAUTHENTICATED:-}" != "1" && -z "${MCP_AUTH_TOKEN:-}" ]]; then
|
||||
MCP_AUTH_TOKEN="$(php -r 'echo bin2hex(random_bytes(24));')"
|
||||
export MCP_AUTH_TOKEN
|
||||
echo "Generated MCP_AUTH_TOKEN for this session:"
|
||||
echo "${MCP_AUTH_TOKEN}"
|
||||
echo
|
||||
fi
|
||||
|
||||
if [[ -z "${VOIPMS_API_USERNAME:-}" || -z "${VOIPMS_API_PASSWORD:-}" ]]; then
|
||||
echo "Warning: VOIPMS_API_USERNAME or VOIPMS_API_PASSWORD is not set."
|
||||
echo "Read-only protocol methods will work, but VoIP.ms tools will fail until credentials are present."
|
||||
echo
|
||||
fi
|
||||
|
||||
echo "Starting VoIP.ms test MCP server"
|
||||
echo "URL: http://${HOST}:${PORT}/mcp"
|
||||
echo "Health: http://${HOST}:${PORT}/health"
|
||||
echo "Auth: Authorization: Bearer ${MCP_AUTH_TOKEN:-<disabled>}"
|
||||
echo
|
||||
|
||||
exec php -S "${HOST}:${PORT}" -t "${ROOT}/mcp" "${ROOT}/mcp/http-server.php"
|
||||
Reference in New Issue
Block a user