Skip to main content
Glama

USQL MCP Server

by jvm
setup.shβ€’2.48 kB
#!/bin/bash # Setup script for usql-mcp development environment set -e echo "πŸš€ Setting up usql-mcp..." echo "" # Check prerequisites echo "πŸ“‹ Checking prerequisites..." if ! command -v node &> /dev/null; then echo "❌ Node.js is not installed. Please install Node.js 16+ from https://nodejs.org/" exit 1 fi if ! command -v npm &> /dev/null; then echo "❌ npm is not installed. Please install npm." exit 1 fi if ! command -v usql &> /dev/null; then echo "⚠️ usql CLI not found. Install it for full functionality:" echo " macOS: brew install usql" echo " Linux: https://github.com/xo/usql#installation" read -p "Continue without usql? (y/n) " -n 1 -r echo if [[ ! $REPLY =~ ^[Yy]$ ]]; then exit 1 fi fi NODE_VERSION=$(node -v | cut -d'v' -f2 | cut -d'.' -f1) if [ "$NODE_VERSION" -lt 16 ]; then echo "❌ Node.js version must be 16 or higher. Current: $(node -v)" exit 1 fi echo "βœ… Node.js $(node -v)" echo "βœ… npm $(npm -v)" command -v usql &> /dev/null && echo "βœ… usql $(usql --version 2>&1 | head -1)" || echo "⚠️ usql not in PATH" echo "" # Install dependencies echo "πŸ“¦ Installing dependencies..." npm install echo "" # Build echo "πŸ”¨ Building TypeScript..." npm run build echo "" # Setup test database (if sqlite3 is available) if command -v sqlite3 &> /dev/null; then echo "πŸ—„οΈ Setting up test database..." mkdir -p tests/fixtures sqlite3 tests/fixtures/test.db < tests/fixtures/schema.sql echo "βœ… Test database created at tests/fixtures/test.db" else echo "⚠️ sqlite3 not found. Skipping test database setup." echo " Install it to run integration tests:" echo " macOS: brew install sqlite" echo " Linux: sudo apt-get install sqlite3" fi echo "" # Run unit tests echo "πŸ§ͺ Running unit tests..." npm run test:unit echo "" echo "✨ Setup complete!" echo "" echo "Next steps:" echo "1. Configure your databases:" echo " cp config.example.json config.json" echo " # Edit config.json with your database connections" echo "" echo "2. Or set environment variables:" echo " export USQL_POSTGRES='postgres://user:pass@localhost/db'" echo "" echo "3. Run the server:" echo " npm start" echo "" echo "4. For development:" echo " npm run dev # Watch mode" echo " npm test # Run all tests" echo " DEBUG=usql-mcp:* npm start # With logging" echo "" echo "πŸ“– See QUICKSTART.md for more details."

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/jvm/usql-mcp'

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