{"library":"mcp-bigquery-server","title":"BigQuery Model Context Protocol (MCP) Server","description":"The `mcp-bigquery-server` package provides a server implementation for the Model Context Protocol (MCP), specifically designed to enable Large Language Models (LLMs) to interact securely and efficiently with Google BigQuery datasets. Introduced in November 2024, the MCP is an open standard that facilitates standardized communication between AI systems and external data sources or tools. This server acts as an intelligent intermediary, allowing LLMs (e.g., through interfaces like Augment Code or Cursor IDE) to perform natural-language queries, inspect database schemas, list tables, and execute SQL queries against BigQuery, without direct database access. The current stable version is 1.0.5. As a relatively new and evolving standard, the project is active, with potential for feature enhancements and protocol refinements, though a strict release cadence isn't published. A key differentiator is its focus on providing secure, read-only access to BigQuery data for AI agents, streamlining data analysis workflows within development environments.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install mcp-bigquery-server"],"cli":null},"imports":["import { startMcpBigQueryServer } from 'mcp-bigquery-server';","import type { BigQueryMcpServerConfig } from 'mcp-bigquery-server';","import { createBigQueryClient } from 'mcp-bigquery-server/utils';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { startMcpBigQueryServer } from 'mcp-bigquery-server';\nimport { writeFileSync } from 'fs';\nimport path from 'path';\n\n// Ensure GOOGLE_APPLICATION_CREDENTIALS is set for local development or CI/CD\n// For production, use Workload Identity or similar GCP-native authentication\nif (!process.env.GOOGLE_APPLICATION_CREDENTIALS) {\n  console.warn('WARNING: GOOGLE_APPLICATION_CREDENTIALS not set. Using default credentials or requiring manual login.');\n  // Example: Point to a dummy key file if running locally without actual credentials\n  // In a real scenario, this should be a valid path to your service account key.json\n}\n\n// Create a minimal configuration file for the server\nconst config = {\n  projectId: process.env.GCP_PROJECT_ID ?? 'your-gcp-project-id',\n  allowedDatasets: [\n    `${process.env.GCP_PROJECT_ID ?? 'your-gcp-project-id'}.your_dataset_name`,\n    'another_project.another_dataset'\n  ],\n  port: parseInt(process.env.PORT ?? '8080'),\n  auth: {\n    mode: 'none' // Or 'bearer' with tokens: ['YOUR_API_TOKEN']\n  }\n};\n\nconst configPath = path.join(process.cwd(), 'mcp-server-config.json');\nwriteFileSync(configPath, JSON.stringify(config, null, 2));\n\nconsole.log(`MCP BigQuery Server configuration written to ${configPath}`);\n\nasync function main() {\n  try {\n    // Start the server programmatically, passing the config directly or via file path\n    // Alternatively, use `npx mcp-bigquery-server --config-file ./mcp-server-config.json`\n    console.log('Starting MCP BigQuery Server...');\n    const server = await startMcpBigQueryServer({\n      config: config,\n      logLevel: 'info' // Example: Set logging level\n    });\n    console.log(`MCP BigQuery Server running on port ${server.port} for project ${server.projectId}`);\n    console.log('Use this server with your LLM-integrated IDE (e.g., Augment Code, Cursor).');\n    \n    // Keep the process alive\n    // process.on('SIGINT', () => {\n    //   server.stop();\n    //   process.exit(0);\n    // });\n  } catch (error) {\n    console.error('Failed to start MCP BigQuery Server:', error);\n    process.exit(1);\n  }\n}\n\nmain();","lang":"typescript","description":"This quickstart demonstrates how to programmatically start the MCP BigQuery server using a generated configuration file. It includes essential BigQuery project and dataset settings, along with a placeholder for authentication, and ensures the necessary environment variables are noted.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}