AI-Powered
Generate News Article
Generating...
Generated Article
Your Articles
Generated News

Loading...

News Sources
Configure News Sources
Check sources to use for generation (or leave unchecked to use all enabled)

Loading sources...

AI-Powered
Generate News Digest

Fetches headlines from your configured RSS sources, then uses Gemini to create a broadcast-ready digest with audio.

Loading DJs...
Generating...
History
Past Digests

Loading digests...

Organization
My Businesses

Loading...

Identity
Account Info

Loading...

Business Membership
Current Business

Loading...

CLI Access
API Keys

Create a local CLI key for grn login <api-key>. New keys are shown once.

Loading keys...

Repo Admin
System Overview

Loading...

Repo Admin
Credit Configuration

Loading...

Repo Admin
System & User Prompts

Loading...

Repo Admin
User Directory

Loading...

Repo Admin
Business Directory

Loading...

News MCP Server
Secure tool server for remote news agents. Exposes article generation, digest creation, source management, and network tools via JSON-RPC. A remote agent connects and decides what to do.
Loading
Server Name
MCP server identity for logs and integrations.
Version
Current API version running on this instance.
Load the latest MCP server status and tool definitions.
AGENT CONNECTION
RPC Endpoint
Auth Header
Auth Role
Network Access
MCP RESPONSIBILITIES
Loading responsibilities...

System Overview

High-level architecture and how each layer connects

Galactic Radio News is a FastAPI service that generates AI-written articles and broadcast-ready news digests. It serves browser users, command-line automation, and remote agents through the same backend.

🌐
Web Browser
Firebase OAuth
CLI Tool
Token / API Key Auth
🤖
AI Agent
MCP JSON-RPC
FastAPI Application
REST /api/v1/*  •  MCP /news-mcp  •  Static Frontend
Sources
NewsData.io / RSS
LLM
Gemini
TTS
Digest audio
Storage
Google Cloud Storage
Firestore Database
Users • Businesses • Articles • Digests • Sources • Credits
FrameworkFastAPI + Uvicorn
Python3.11+
DatabaseCloud Firestore
DeployCloud Run
AuthFirebase + API Key
CLIgrn

Generation Pipeline

How news requests become articles and audio digests

1

Request Received

User submits an article topic or digest request. The API authenticates the caller and records a job.

POST /api/v1/news/generate
2

Fetch Inputs

Article generation uses user topic/context. Digest generation pulls enabled NewsData.io or RSS sources and selected DJ voice metadata.

RSSService / NewsDataService
3

LLM Writing

Gemini writes a structured article or broadcast digest using prompt templates and user-provided instructions.

LLMService.generate_*
4

Audio and Storage

Digest scripts can be converted to DJ audio and uploaded with a signed playback URL.

TTSService -> StorageService
5

Publish State

Articles and digests are stored in Firestore, exposed to user pages, business feeds, and optional network broadcast toggles.

ArticleRepository / DigestRepository
Failure Handling: failed jobs keep their error state visible for polling clients and the web UI.

Authentication

Auth methods for browser, CLI, API, and service clients

Web

Firebase OAuth

The frontend signs in with Google and sends a Firebase ID token as a Bearer token.
CLI / API

API Key

Google-authenticated web users create an API key from Account, then run grn login <api-key>. The CLI stores it in ~/.grn/config.json and sends X-API-Key.
Service

Service API Keys

Remote MCP callers use X-API-Key service credentials to access automation tools.

Credits

Business-level usage accounting for generated content

Businesses hold credits that can be assigned and adjusted by admins. Generation features use credit checks through the shared credit service and transaction records.

OwnerBusiness
LedgerFirestore
Admin UICredit Config
FeedsBusiness scoped

MCP Server

JSON-RPC tool server for remote news agents

The News MCP endpoint exposes article, digest, source, and network tools to authenticated remote agents.

Available Tool Areas

news.generate_article
Generate a full news article from a topic and editorial options.
articlellm
news.generate_digest
Build a broadcast digest from configured sources.
digestaudio
sources.*
List and manage NewsData.io or RSS sources.
feeds
network.*
Expose network-ready article state to Galactic Radio clients.
broadcast

Connection Config

{
  "mcpServers": {
    "galactic-radio-news": {
      "type": "http",
      "url": "https://YOUR_HOST/api/v1/news-mcp",
      "headers": { "X-API-Key": "${GRN_SERVICE_API_KEY}" }
    }
  }
}

Prompt Engineering

How the AI writes articles and digest scripts

Registry
Prompt JSON lives in prompts/news_writer.json and is managed through the prompt registry service.
Article Inputs
Topic, category, length, style, tone, context, and custom instructions are combined into a generation request.
Digest Inputs
Fetched headlines, source metadata, DJ voice information, and max headline limits are injected into digest prompts.
Admin Editing
Admin users can view and update system and user prompt templates in the Admin tab.

API Reference

Primary REST endpoints exposed by the News API

MethodEndpointDescriptionAuth
GET/api/v1/healthHealth checkNone
POST/api/v1/news/generateGenerate an articleRequired
GET/api/v1/news/jobs/{id}Poll article job statusRequired
GET/api/v1/news/articles/mineList user articlesRequired
POST/api/v1/digests/generateGenerate a digestRequired
GET/api/v1/digests/List past digestsRequired
GET/api/v1/news-mcp/profileMCP profile and toolsRequired
POST/api/v1/news-mcpMCP JSON-RPC endpointService key

CLI Tool (grn)

Command-line interface for power users and automation

Install with pip install -e ".[cli]", then use grn from the terminal.

Setup

grn login grn_...

Save an API key created from the web Account tab.

grn whoami

Verify the saved key against the API.

News Generation

grn generate "AI radio policy changes"

Generate an article from a topic.

grn articles generate "Space economy" --style broadcast --length medium

Generate with editorial controls.

grn digest --dj <uuid>

Generate a digest with a DJ voice.

Management

grn articles mine

List your articles.

grn digests list

List past digests.

grn sources list

List configured news sources.

Utilities

grn status <job_id> --watch

Poll a generation job until complete.

grn djs

List available DJ personalities.

grn config

Show current token, API key, and base URL config.

Deployment

Cloud Build, Docker, and Cloud Run configuration

Push to main
Cloud Build trigger
Docker Build
Python service image
Push Image
Container registry
Cloud Run
Port 8080

Project Structure

galactic-radio-news/
  src/galactic_news/
    app.py                  # FastAPI application factory
    config.py               # Settings from environment
    api/v1/                 # REST + MCP endpoints
    services/               # LLM, TTS, storage, sources, digest
    repositories/           # Firestore access
    frontend/static/        # Browser app
  cli/
    main.py                 # Typer CLI entrypoint
    commands/               # articles, digests, sources, auth
  prompts/news_writer.json  # Default prompts
  cloudbuild.yaml           # Cloud Build -> Cloud Run
  pyproject.toml            # Project metadata + grn script

Tech Stack

Primary tools and services in the system

Backend

FastAPIHTTP API
PydanticModels
TyperCLI

AI

GeminiWriting
TTSDigest audio
PromptsJSON registry

Data

FirestoreRecords
Cloud StorageAudio
NewsData/RSSSources

Ops

Cloud RunRuntime
Cloud BuildDeploy
pytestTests