Skip to main content
Glama
startreedata

StarTree MCP Server for Apache Pinot

Official
by startreedata
query_simple.shβ€’3.15 kB
#!/bin/bash echo "πŸ” Simple MCP Pinot Server Query Script" echo "======================================" BASE_URL="http://127.0.0.1:8080" # Check if server is running echo "πŸ”Œ Checking if server is running..." if curl -s "$BASE_URL/api/tools/list" > /dev/null 2>&1; then echo "βœ… Server is running!" else echo "❌ Server is not running at $BASE_URL" echo " Please start it with: uv run python examples/http_server_demo.py both" exit 1 fi echo # List all tables echo "πŸ“‹ Listing all Pinot tables..." TABLES_JSON=$(curl -s -X POST "$BASE_URL/api/tools/call" \ -H "Content-Type: application/json" \ -d '{"name": "list-tables", "arguments": {}}') # Extract table names (simple parsing) TABLES=$(echo "$TABLES_JSON" | grep -o '"[^"]*"' | grep -v '"result"' | grep -v '"name"' | grep -v '"arguments"' | sed 's/"//g') echo "βœ… Found tables:" i=1 for table in $TABLES; do if [[ $table != "result" && $table != "name" && $table != "arguments" && $table != "list-tables" ]]; then echo " $i. $table" ((i++)) fi done echo # Count records in first few tables echo "πŸ”’ Counting records in sample tables..." for table in airlineStats githubEvents meetupRsvp; do echo -n " $table: " RESULT=$(curl -s -X POST "$BASE_URL/api/tools/call" \ -H "Content-Type: application/json" \ -d "{\"name\": \"read-query\", \"arguments\": {\"query\": \"SELECT COUNT(*) as count FROM $table\"}}") # Simple extraction of count (works for most cases) COUNT=$(echo "$RESULT" | grep -o '"count":[0-9]*' | grep -o '[0-9]*') if [[ -n "$COUNT" ]]; then echo "$COUNT records" else echo "Error querying" fi done echo # Sample data from githubEvents echo "πŸ“Š Sample data from githubEvents table..." SAMPLE_RESULT=$(curl -s -X POST "$BASE_URL/api/tools/call" \ -H "Content-Type: application/json" \ -d '{"name": "read-query", "arguments": {"query": "SELECT id, type FROM githubEvents LIMIT 3"}}') echo "βœ… Sample GitHub events:" echo "$SAMPLE_RESULT" | grep -o '"id":"[^"]*"' | head -3 | sed 's/"id":"//g' | sed 's/"//g' | nl -w2 -s'. ID: ' echo # Test connection echo "πŸ”— Testing Pinot connection..." CONNECTION_RESULT=$(curl -s -X POST "$BASE_URL/api/tools/call" \ -H "Content-Type: application/json" \ -d '{"name": "test-connection", "arguments": {}}') if echo "$CONNECTION_RESULT" | grep -q '"connection_test":true'; then echo "βœ… Connection test: PASSED" else echo "❌ Connection test: FAILED" fi echo echo "πŸŽ‰ Query testing completed!" echo "======================================" echo echo "πŸ’‘ Quick Reference:" echo "β€’ List tables: curl -X POST $BASE_URL/api/tools/call -H 'Content-Type: application/json' -d '{\"name\": \"list-tables\", \"arguments\": {}}'" echo "β€’ Run query: curl -X POST $BASE_URL/api/tools/call -H 'Content-Type: application/json' -d '{\"name\": \"read-query\", \"arguments\": {\"query\": \"SELECT * FROM tablename LIMIT 5\"}}'" echo "β€’ Test connection: curl -X POST $BASE_URL/api/tools/call -H 'Content-Type: application/json' -d '{\"name\": \"test-connection\", \"arguments\": {}}'"

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/startreedata/mcp-pinot'

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