#!/bin/bash
# Tailscale MCP Server Environment Setup Script
# This script helps you set up your environment for local development
echo "๐ง Tailscale MCP Server Environment Setup"
echo "=========================================="
echo
# Check if .env already exists
if [ -f ".env" ]; then
echo "โ ๏ธ .env file already exists!"
read -p "Do you want to overwrite it? (y/N): " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Setup cancelled."
exit 0
fi
fi
# Copy example file
echo "๐ Copying .env.example to .env..."
if [ ! -f ".env.example" ]; then
echo "โ Error: .env.example file not found!"
exit 1
fi
if ! cp .env.example .env; then
echo "โ Error: Failed to copy .env.example to .env"
exit 1
fi
# Create logs directory
echo "๐ Creating logs directory..."
if ! mkdir -p logs; then
echo "โ Error: Failed to create logs directory"
exit 1
fi
echo
echo "โ Environment setup complete!"
echo
echo "๐ Next steps:"
echo "1. Edit .env file with your Tailscale credentials:"
echo " - Get API key from: https://login.tailscale.com/admin/settings/keys"
echo " - Set TAILSCALE_API_KEY and TAILSCALE_TAILNET"
echo
echo "2. Build the project:"
echo " bun run build # Recommended"
echo " npm run build # Fallback"
echo
echo "3. Test the server:"
echo " bun scripts/test-mcp-server.js"
echo
echo "4. Or run with MCP Inspector:"
echo " bun run inspector # Recommended"
echo " npm run inspector # Fallback"
echo
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/HexSleeves/tailscale-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server