Skip to content
Back to search

geopolitical-news-agent-gcp

An agent deployed on GCP that connects to an MCP server deployed as an AWS Lambda function and writes a cited briefing.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/rajkiranvs--geopolitical-news-agent-gcp/badge.svg)](/listings/rajkiranvs--geopolitical-news-agent-gcp)

HTML

<a href="/listings/rajkiranvs--geopolitical-news-agent-gcp"><img src="/api/listings/rajkiranvs--geopolitical-news-agent-gcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 70 lines
  1. # geopolitical-news-agent-gcp
  2. An agent deployed on GCP that connects to an MCP server deployed as an AWS Lambda function and writes a cited briefing.
  3. The agent is built with Google's [Agent Development Kit (ADK)](https://google.github.io/adk-docs/) and runs Gemini on Vertex AI. It calls one tool, `get_feeds`, on the MCP server in [geo-news-mcp-server](https://github.com/RajkiranVS/geo-news-mcp-server). The server reads allowlisted RSS feeds (BBC World, The Hindu) and needs no changes to work with this agent.
  4. ```
  5. User → ADK agent (Gemini on Vertex AI) → MCP over Streamable HTTP + x-api-key → AWS Lambda (FastMCP) → RSS feeds
  6. ```
  7. ## Layout
  8. ```
  9. geo_news_agent/
  10. agent.py # McpToolset + system prompt + root_agent
  11. __init__.py
  12. .env.example # copy to .env and fill in
  13. requirements.txt # used by the Agent Engine deploy
  14. requirements.txt # points to the agent's requirements for local installs
  15. ```
  16. ## Run locally
  17. Prerequisites: Python 3.10+, the [gcloud CLI](https://cloud.google.com/sdk/docs/install), a GCP project with billing and the Vertex AI API enabled, and a deployed geo-news MCP server.
  18. ```powershell
  19. python -m venv .venv
  20. .\.venv\Scripts\Activate.ps1 # macOS/Linux: source .venv/bin/activate
  21. pip install -r requirements.txt
  22. gcloud auth application-default login
  23. copy geo_news_agent\.env.example geo_news_agent\.env # then fill in the values
  24. adk web .
  25. ```
  26. Open the dev UI, pick `geo_news_agent` and ask something like "What's new with the Russia–Ukraine war?". The events panel shows the `get_feeds` call and the tool response.
  27. ## Deploy to Vertex AI Agent Engine
  28. ```powershell
  29. pip install "google-adk[mcp,gcp]==2.15.0" # the gcp extra provides the Agent Platform SDK the deploy needs
  30. gcloud services enable aiplatform.googleapis.com cloudresourcemanager.googleapis.com
  31. adk deploy agent_engine --project=<your-gcp-project-id> --region=us-central1 --display_name=geo-news-agent --otel_to_cloud geo_news_agent
  32. ```
  33. The deploy reads `geo_news_agent/.env` and passes its values (including `MCP_API_KEY` and `MCP_URL`) to the deployed agent as environment variables. `--region` sets where Agent Engine runs (Agent Engine needs a regional location such as `us-central1`). `GOOGLE_CLOUD_LOCATION=global` from `.env` is passed as a runtime variable for the Gemini calls; if the deployed agent reports the model as unavailable, check that this variable reached the deployment. It also needs `geo_news_agent/requirements.txt`, so the `[mcp]` extra is installed in the container.
  34. The deployed agent is listed under Vertex AI → Agent Engine in the Cloud Console.
  35. ## Configuration (`geo_news_agent/.env`)
  36. | Variable | Value |
  37. | --- | --- |
  38. | `GOOGLE_GENAI_USE_VERTEXAI` | `TRUE` |
  39. | `GOOGLE_CLOUD_PROJECT` | Your GCP project ID |
  40. | `GOOGLE_CLOUD_LOCATION` | `global` |
  41. | `MCP_API_KEY` | The plain API key the MCP server expects |
  42. | `MCP_URL` | The Lambda Function URL, ending in `/mcp` |
  43. `.env` is gitignored. Keep the key and the URL out of the code.
  44. ## Gotchas
  45. - **`ImportError: cannot import name 'McpToolset'`:** in ADK 2.15, MCP support is an optional extra. Install `google-adk[mcp]` (quote it in PowerShell).
  46. - **Model not available in your region:** set `GOOGLE_CLOUD_LOCATION=global`.
  47. - **`adk` not recognised:** install into a virtual environment and activate it.
  48. - **401 from the MCP server:** `MCP_API_KEY` must be the plain key, not the JSON secret string.
  49. ## Related
  50. - MCP server: [RajkiranVS/geo-news-mcp-server](https://github.com/RajkiranVS/geo-news-mcp-server)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.