Data Intelligence MCP Server
by Meet1012
README.md
# Data Intelligence
This project builds a BigQuery-powered data assistant that combines an MCP server with a Streamlit chat interface. The backend exposes BigQuery operations through MCP tools, while the frontend lets users ask questions in natural language and receive answers with the help of an agent.
## What this project does
- Exposes BigQuery tools from the MCP server in [main.py](main.py)
- Lists tables and fetches table schemas
- Generates and executes BigQuery queries
- Provides a chat-based UI in [app.py](app.py) for interacting with your data
## Project structure
- [main.py](main.py): Defines the FastMCP server and BigQuery tool wrappers
- [app.py](app.py): Streamlit UI that connects to the MCP server and runs the agent
- [pyproject.toml](pyproject.toml): Project dependencies and Python metadata
## Prerequisites
Before running the project, make sure you have:
- Python 3.13 or newer
- A Google Cloud project with BigQuery access
- A valid Google Cloud credential configuration for BigQuery
- An Anthropic API key for the chat model used in the app
## Setup
1. Create and activate a virtual environment.
2. Install the dependencies:
- `pip install -r requirements.txt`
- or `uv sync`
3. Create a `.env` file in the project root with the required environment variables:
```env
ANTHROPIC_API_KEY=your_anthropic_api_key
GOOGLE_APPLICATION_CREDENTIALS=path/to/your/credentials.json
```
4. Update the placeholder values in [main.py](main.py) for your BigQuery project and dataset.
## Running the app
Start the MCP server first:
```bash
python main.py
```
In a second terminal, start the Streamlit app:
```bash
streamlit run app.py
```
The app expects the MCP server to be available at:
```text
http://localhost:8000/mcp
```
## Notes
- The current implementation in [main.py](main.py) uses placeholder values such as `project_id` and `dataset_name`. Replace these with your actual BigQuery project and dataset before running the app.
- The UI is designed for natural language interaction with BigQuery data, but the underlying SQL execution depends on your configured BigQuery access and credentials.