GCP MCP Server
An MCP server that provides tools for interacting with Google Cloud Platform Cloud Functions, specifically for retrieving logs.
Features
- Retrieve logs from GCP Cloud Functions
- Supports both stdio and SSE transport modes
- Easy integration with MCP clients
- Flexible authentication options:
- Service Account JSON key file
- Interactive authentication (Application Default Credentials)
Installation
pip install gcp-mcp-server
Prerequisites
- Google Cloud SDK installed and configured
- Appropriate GCP permissions to access Cloud Functions and Cloud Logging
- Python 3.10 or higher
- Authentication set up (see Authentication section below)
Authentication
The server supports two authentication methods:
1. Service Account JSON Key
You can provide a service account JSON key file in two ways:
# Option 1: Command line argument
gcp-mcp-server --service-account ~/path/to/service-account.json
# Option 2: Environment variable
export GCP_SERVICE_ACCOUNT_PATH=~/path/to/service-account.json
gcp-mcp-server
2. Application Default Credentials (Interactive)
If no service account is provided, the server will use Application Default Credentials:
- Run
gcloud auth application-default login - Follow the interactive authentication process
- Start the server normally:
gcp-mcp-server
Usage
Starting the server
Using stdio transport (default):
gcp-mcp-server
Using SSE transport:
gcp-mcp-server --transport sse --port 8000
Available Tools
get_function_logs
Retrieves logs for a specified Cloud Function.
Parameters:
project_id: The GCP project IDfunction_name: The name of the Cloud Functionminutes: Number of minutes of logs to retrieve (default: 10)filter: Optional additional filter for the logs
Development
- Clone the repository
- Install dependencies:
pip install -e .
Troubleshooting
Authentication Issues
-
If using a service account:
- Ensure the JSON key file exists and is readable
- Verify the service account has the necessary permissions (roles/logging.viewer at minimum)
- Check the file path is correct
-
If using application default credentials:
- Run
gcloud auth application-default loginagain - Verify you're logged into the correct account with
gcloud auth list - Ensure your account has the necessary permissions
- Run
License
MIT License
Metadata
Release files for gcp-mcp-server 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gcp_mcp_server-0.1.0.tar.gz | 4.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gcp_mcp_server-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.8 kB
Release files / gcp_mcp_server-0.1.0.tar.gz
| Download URL | gcp_mcp_server-0.1.0.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b8429c6ce670edcfb0b5a3eac426c951a3831d85dc2652dbbe9e8c86bc55fc61
|
|
BLAKE2b-256 checksum How to use checksums |
b1ff6e89b2958711cfb0b9f46e68331a8352b6b2fe24f2bcc811aeef1866287e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.3
|
Release files / gcp_mcp_server-0.1.0-py3-none-any.whl
| Download URL | gcp_mcp_server-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1eb36b5951d2fefb3a64aedeb41c5668f54e29df36be09834d8b48f45ab16b8a
|
|
BLAKE2b-256 checksum How to use checksums |
d7216f68fcd5018ae2a102a4560f6a4aefe5e45d02893f1f4b008374b5feba24
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.3
|