Content
# SecOps MCP Bridge
This project provides a workaround for MCP (Model Context Protocol) communication with GCP endpoints (SecOps, Cloud Logging, and Cloud Monitoring) without requiring a full local browser-based OAuth workflow.
It translates local client communication via **Stdio** into authenticated GCP **HTTP** JSON-RPC 2.0 requests.
Both **Node.js** and **Python** implementations are supported and maintained side-by-side in the repository root.
---
## Prerequisites & Auth
For either bridge implementation, ensure you have:
1. Google Cloud SDK installed and authenticated locally via:
```bash
gcloud auth application-default login
```
2. Your active project and customer ID configured. The bridges check the following environment variables:
* **Project ID**: `GCP_PROJECT` or `PROJECT_ID` (Defaults to `"your-gcp-secops-project"`)
* **Customer ID**: `GCP_CUSTOMER_ID` or `CUSTOMER_ID` (Defaults to `"f47ac10b-58cc-4372-a567-0e02b2c3d479"`)
* **Region**: `GCP_REGION` or `REGION` (Defaults to `"us"`)
---
## 1. Node.js Implementation
### Installation
Install Node dependencies in the root directory:
```bash
npm install
```
### Stdio Client Configuration
Add the bridge to your client's MCP configuration file (e.g., `~/.gemini/jetski/mcp_config.json` or `~/Library/Application Support/Claude/claude_desktop_config.json`):
```json
{
"mcpServers": {
"goog-secops": {
"command": "node",
"args": ["/path/to/mcp-bridge/index.js", "secops"]
}
}
}
```
---
## 2. Python Implementation
### Installation
Create a virtual environment and install the Python dependencies:
```bash
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
```
### Stdio Client Configuration
Configure your MCP client to invoke the Python script:
```json
{
"mcpServers": {
"goog-secops": {
"command": "/path/to/mcp-bridge/.venv/bin/python",
"args": ["/path/to/mcp-bridge/bridge.py", "secops"]
}
}
}
```
---
## Bridge Arguments (Target Services)
Both implementations accept a target service argument (default is `secops`):
* **`secops`**: Proxies requests to Google Cloud SecOps (`https://us-chronicle.googleapis.com/mcp`)
* **`logging`**: Proxies requests to Cloud Logging (`https://logging.googleapis.com/mcp`)
* **`monitoring`**: Proxies requests to Cloud Monitoring (`https://monitoring.googleapis.com/mcp`)
*Example for Logging*:
```json
"args": ["/path/to/mcp-bridge/bridge.py", "logging"]
```
---
## Logging & Debugging
The bridges log their execution and GCP API response payloads to `bridge.log` in the root directory. You can customize the log path using the `MCP_BRIDGE_LOG_FILE` environment variable:
```bash
export MCP_BRIDGE_LOG_FILE="/path/to/custom.log"
```