Skip to main content
Glama

BigQuery MCP Server

by takuya0206
MIT License
24
3
  • Apple
  • Linux
args-parser.ts1.66 kB
import type { Args } from "../types.js"; import { ArgsSchema } from "../types.js"; /** * Parse command line arguments * @returns Parsed arguments */ export function parseArgs(): Args { const args: Record<string, string> = {}; for (let i = 0; i < process.argv.length; i++) { const arg = process.argv[i]; if (arg.startsWith("--")) { // Handle --key=value format if (arg.includes("=")) { const [key, value] = arg.substring(2).split("=", 2); args[key] = value; } // Handle --key value format else { const key = arg.substring(2); const value = process.argv[i + 1]; if (value && !value.startsWith("--")) { args[key] = value; i++; // Skip the value in the next iteration } else { args[key] = "true"; // Flag without value } } } } try { return ArgsSchema.parse(args); } catch (error) { if (error instanceof Error) { console.error("Error parsing arguments:", error.message); } console.error("\nUsage:"); console.error(" bun run index.ts --project-id=<project-id> [options]"); console.error("\nOptions:"); console.error(" --project-id Google Cloud project ID (required)"); console.error(" --location BigQuery location (default: asia-northeast1)"); console.error(" --key-file Path to service account key file (optional)"); console.error(" --max-results Maximum rows to return (default: 1000)"); console.error(" --max-bytes-billed Maximum bytes to process (default: 500000000000, 500GB)"); process.exit(1); } }

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/takuya0206/bigquery-mcp-server'

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