Skip to main content
Glama
run_server_with_token.sh696 B
#!/usr/bin/env bash set -euo pipefail # Prefer an existing env var; otherwise read from .env; otherwise generate ephemeral for this process if [[ -z "${HTTP_BEARER_TOKEN:-}" ]]; then if [[ -f .env ]]; then # shellcheck disable=SC2046 HTTP_BEARER_TOKEN=$(grep -E '^HTTP_BEARER_TOKEN=' .env | sed -E 's/^HTTP_BEARER_TOKEN=//') || true fi fi if [[ -z "${HTTP_BEARER_TOKEN:-}" ]]; then if command -v uv >/dev/null 2>&1; then HTTP_BEARER_TOKEN=$(uv run python - <<'PY' import secrets; print(secrets.token_hex(32)) PY ) else HTTP_BEARER_TOKEN="$(date +%s)_$(hostname)" # very weak fallback fi fi export HTTP_BEARER_TOKEN uv run python -m mcp_agent_mail.cli serve-http "$@"

Latest Blog Posts

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/Dicklesworthstone/mcp_agent_mail'

If you have feedback or need assistance with the MCP directory API, please join our Discord server