Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .cursor/rules/default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# BigQuery MCP Development Standards

## Code Quality
- Write clean, efficient, minimal code
- No unnecessary complexity or over-engineering
- Follow existing patterns and conventions
- Use descriptive variable names, avoid abbreviations

## Version Control
- Update version numbers consistently across all files when making releases
- Use semantic versioning (MAJOR.MINOR.PATCH)
- Keep commits focused and atomic
- Write clear, concise commit messages

## Code Standards
- Run `ruff format` before committing
- Run `ruff check --fix` to resolve linting issues
- Add type hints for function parameters and returns
- Include docstrings for public functions and classes

## Testing
- Add tests for new functionality
- Run `pytest` before committing
- Ensure all tests pass in CI

## Documentation
- Keep documentation minimal and focused
- Update relevant docs when changing functionality
- Use clear, direct language - no fluff or emojis
- Focus on what users need to know, not implementation details

## Changelog Formatting
- Use clean, elegant formatting without bold text
- Write concise, descriptive entries
- No unnecessary formatting or emphasis
- Keep entries focused on what actually changed

## Architecture
- Prefer command-line arguments over config files
- Keep dependencies minimal
- Follow MCP protocol standards
- Maintain backwards compatibility when possible

## Error Handling
- Use custom exception classes for specific error types
- Provide actionable error messages
- Log errors appropriately for debugging

## User Preferences
- Avoid over-engineering and unnecessary complexity
- Don't overthink security implementations unless specifically requested
- Focus on what's needed, not what could be possible
- Maintain high repository standards suitable for GitHub
- Keep configuration clean with proper .example files and gitignored personal configs
29 changes: 11 additions & 18 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
# BigQuery MCP Server Environment Variables
# These variables override config file settings

# Response formatting (optional)
# Set to 'true' for compact responses optimized for LLMs
COMPACT_FORMAT=false

# Override billing project (optional)
# If not set, uses the value from config.yaml
# BIGQUERY_BILLING_PROJECT=your-project-id
# BigQuery configuration
BIGQUERY_BILLING_PROJECT=your-project-id
BIGQUERY_LOCATION=EU

# Service account credentials (optional)
# If not set, uses Application Default Credentials
# GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account-key.json
# Google Cloud credentials
GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account-key.json

# Logging level
# Options: DEBUG, INFO, WARNING, ERROR
LOG_LEVEL=INFO

# Maximum query execution time in seconds (optional)
# MAX_QUERY_TIMEOUT=60
# Response formatting
COMPACT_FORMAT=false

# Maximum rows to return in query results (optional)
# MAX_LIMIT=10000
# Logging configuration
LOG_QUERIES=true
LOG_RESULTS=false
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ coverage.xml
.env.local
.env.*.local

# Configuration
# Configuration files (contain personal project IDs)
config/config.yaml
config/config.dev.yaml

# Docker Compose (contains personal project IDs)
# Docker Compose files (contain personal project IDs)
docker-compose.yml
docker-compose.dev.yml

Expand All @@ -69,6 +69,7 @@ development-notes/
# Tasks file
TASKS.md
TESTING.md
SETUP-GUIDE.md

# OS files
.DS_Store
Expand Down
71 changes: 32 additions & 39 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,56 +5,49 @@ All notable changes to the BigQuery MCP Server project will be documented in thi
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.1] - 2025-07-17

### Added
- 20-second default timeout (reduced from 60 seconds) with configurable `--timeout` CLI argument
- Clean configuration structure with proper .example files and gitignored personal configs
- Comprehensive CLI arguments for all configuration options with proper precedence (CLI > Config > Env > Defaults)
- Enterprise pattern system supporting multiple projects with dataset patterns
- AI-friendly error messages with source classification and actionable suggestions

### Fixed
- Runtime crashes from missing `log_results` attribute in Config class
- Error handling bugs in QueryExecutionError constructor
- Configuration inconsistencies between config files and examples
- Version management removed from config files (now code-only)
- Configuration file structure inconsistencies
- Docker setup confusion - simplified to single service architecture
- Broken documentation links and outdated examples

### Changed
- Simplified Docker setup to single `bigquery-mcp` service
- Moved setup guide from root to docs/setup.md
- Updated README to be more concise and to-the-point
- Cleaned up repository structure - removed redundant files

## [1.1.0] - 2025-07-16

### Added
- Command-line argument support for project configuration
- Direct CLI specification of project:dataset patterns
- Preferred over config file approach for easier deployment
- Example: `python src/server.py project1:dataset_* project2:table_*`
- Query progress indication and complexity estimation
- Query complexity estimation (simple, moderate, complex, very_complex)
- Execution time tracking and logging for performance monitoring
- Progress feedback for long-running queries
- Comprehensive parameter documentation in tools.md
- All tool parameters documented with types and examples
- Automatic type conversion explanation for MCP protocol compatibility
- Error response format documentation
- CLI argument support for project configuration with `project:dataset` patterns
- Query complexity estimation and execution time tracking
- Comprehensive parameter documentation

### Fixed
- Critical parameter type validation errors ("max_rows must be integer")
- Automatic string-to-integer conversion for max_rows, timeout, sample_size parameters
- Enhanced parameter validation in execute_query() and analyze_columns()
- Fixed MCP protocol compatibility where agents pass strings instead of integers
- analyze_columns intermittent failures ("No result received from client-side tool execution")
- Added SAFE.* functions to prevent calculation errors in BigQuery
- Implemented 60-second query timeouts with proper error handling
- Enhanced sampling queries with better NULL handling
- Improved fallback analysis for failed queries
- Enhanced error handling with more specific and actionable error messages
- Complex data type display issues (JSON/Array serialization)
- Enhanced _serialize_value() function with proper NULL filtering
- Fixed "Array cannot have a null element" errors in BigQuery results
- Parameter type validation errors for MCP protocol compatibility
- analyze_columns intermittent failures with enhanced NULL handling
- Complex data type serialization issues
- Parameter naming inconsistencies across configuration files
- Standardized to use `default_limit` and `max_limit` consistently
- Updated all config files, tests, and environment examples

### Changed
- Consolidated validation logic - removed redundant query validation
- Eliminated duplicate validation between _validate_query_safety() and SQLValidator
- All SQL validation now consolidated into SQLValidator class
- Improved tool registration with enhanced debugging and reliability
- Configuration file approach marked as deprecated in favor of CLI arguments
- Consolidated validation logic into SQLValidator class
- Improved tool registration with enhanced debugging

### Removed
- Duplicate and redundant tools for cleaner architecture
- Removed `list_allowed_projects()` - redundant with `list_projects()`
- Removed `list_accessible_projects()` - redundant functionality
- Removed `get_current_context()` - identified as unnecessary complexity
- Deleted entire `context.py` file containing overkill context management
- Cleaned up temporary test files from repository root
- Deleted test_banned_keywords.py, test_execution_check.py, test_fix.py, test_union_validation.py
- All functionality preserved in proper unit test suite

## [1.0.0] - 2025-07-10

Expand Down
30 changes: 0 additions & 30 deletions README-Docker.md

This file was deleted.

Loading