Pbx_estimation

finance MCP Server

PBX Market Estimation & VoIP Trend Forecasting

Verified
financefinance
5 views4 stars0 forks

Why This Matters

Discovered via github-topic:mcp-server and last synced 3mo ago.

Verified
Source
github-topic:mcp-server
Stars
4
Last synced
3mo ago
Install
Check source

Install

Install instructions not detected yet

Check the source repository for the latest setup steps.

View source instructions
23
Tools
0
Resources
0
Prompts
Standard I/O
Transport

Available Tools (23)

Parameter

Meaning

CLOUDFLARE_API_TOKEN

Cloudflare R2 Account API Token,例如你的 `pbx_application_token`。這是給 Wrangler remote upload 用,不是 R2 S3 Access Key ID。

NOTEBOOKLM_API_TOKEN

Optional token required by your unofficial NotebookLM bridge, if any. Leave empty if the bridge does not require bearer auth.

CLOUDFLARE_ACCOUNT_ID

Cloudflare 帳號頁面取得,或登入後執行 `npx wrangler whoami`。

Source

Data

Region

Countries

Reports

### Project Structure ``` pbx_estimation/ ├── data/ │ ├── raw/ # API downloads cache │ └── processed/ # Cleaned panel data ├── notebooks/ │ ├── 01_fetch_data.ipynb # Data collection │ ├── 02_eda_visualization.ipynb # Exploratory analysis │ ├── 03_logistic_growth.ipynb # S-Curve fitting │ └── 04_survival_analysis.ipynb # CoxPH model ├── src/ │ ├── data/fetcher.py │ ├── data/preprocessor.py │ ├── models/logistic_growth.py │ └── models/survival.py ├── tests/ ├── .github/workflows/report.yml # Auto-generate reports ├── config.yaml ├── requirements.txt └── pyproject.toml ``` ### Getting Started ```bash # Clone & install git clone https://github.com/dennis-lee/pbx_estimation.git cd pbx_estimation python -m venv venv && source venv/bin/activate pip install -r requirements.txt # Run notebooks jupyter notebook notebooks/ ``` ### Report Generation via GitHub Actions Reports are automatically generated and published via a scheduled GitHub Actions workflow: - **Schedule**: Runs every hour at minute 0 UTC - **Trigger**: Also supports manual dispatch via GitHub UI - **Steps**: 1. Fetch latest data from World Bank / ITU / BEREC APIs 2. Execute all Jupyter notebooks in order 3. Render notebooks to HTML and PDF 4. Archive reports as build artifacts (downloadable from Actions tab) 5. Optionally deploy to GitHub Pages for a live dashboard > 💡 **Manual trigger**: Go to `Actions` → `Report Generation` → `Run workflow` → `Run now` ### Cloud RAG Endpoint and Asset Sync The technology alternatives page uses browser-side keyword filtering for quick narrowing, then calls the Cloudflare Worker in `rag_engine/` for cloud RAG prioritization. CI builds a RAG asset manifest from `reports/`, `data/processed/`, and `frontend/data/`, uploads those assets to Cloudflare R2 when configured, and the Worker retrieves report/data evidence from that bucket. Set these repository secrets for Cloudflare RAG: - `CLOUD_RAG_ENDPOINT` - `CLOUDFLARE_API_TOKEN` - `CLOUDFLARE_ACCOUNT_ID` - `CLOUDFLARE_R2_BUCKET` (current Worker binding expects `auto-rag`) - Optional S3 API upload secrets: `CLOUDFLARE_R2_S3_ENDPOINT`, `CLOUDFLARE_R2_S3_ACCESS_KEY_ID`, `CLOUDFLARE_R2_S3_SECRET_ACCESS_KEY` Alternatively, the same self-developed RAG engine can run on Hugging Face Spaces as a Docker Space using the files in `rag_engine/`. Set `HF_TOKEN` and `HF_SPACE_ID` to let CI upload the Docker Space. Hugging Face's default CPU Basic Space is currently free and provides 2 vCPU, 16 GB RAM, and 50 GB non-persistent disk. The Space endpoint can also be used as `CLOUD_RAG_ENDPOINT`. The endpoint returns: ```json { "recommendation": "short explanation", "alternatives": [{ "name": "MQTT (MQTT-SN)", "rank": 1, "reason": "why it fits" }], "solutions": [{ "name": "Twilio Programmable Voice", "rank": 1, "reason": "why it fits" }], "documents": [{ "name": "reports/global_research_report_zh.md", "rank": 1, "excerpt": "retrieved report/data evidence" }] } ``` ### NotebookLM Google NotebookLM does not have an official public file-upload API. CI therefore creates a NotebookLM-ready bundle at `rag_engine/dist/notebooklm_sources/` and includes it in the workflow artifact for manual upload. If you run an unofficial bridge such as `notebooklm-rest-api` or `notebooklm-py`, set `NOTEBOOKLM_UPLOAD_URL` and optionally `NOTEBOOKLM_API_TOKEN`; CI will post the selected sources to that endpoint. ### How to Fill `.env.example` Copy `.env.example` to `.env` for local work, and add the same names as GitHub repository secrets when CI needs them.

CLOUDFLARE_R2_S3_SECRET_ACCESS_KEY

Secret Access Key shown once when creating the R2 S3 API token. Store only as a local `.env` value or GitHub secret.

NEXT_PUBLIC_CLOUD_RAG_ENDPOINT

Public RAG endpoint used by the frontend build. Use either your Cloudflare Worker URL, for example `https://pbx-rag-engine.<account>.workers.dev/`, or your Hugging Face Space URL, for example `https://<user>-pbx-rag-engine.hf.space/`.

CLOUD_RAG_ENDPOINT

Same endpoint as above, stored as a GitHub secret so `.github/workflows/report.yml` can pass it into `NEXT_PUBLIC_CLOUD_RAG_ENDPOINT` during the Pages build.

RAG_ASSET_PREFIX

通常維持 `latest`。只有要分 staging/date namespace 時才需要修改。

NOTEBOOKLM_UPLOAD_URL

Optional. Only set this if you run an unofficial NotebookLM bridge such as `notebooklm-rest-api` or `notebooklm-py`. Use that bridge's upload endpoint URL. Leave empty for manual NotebookLM upload.

NOTEBOOKLM_TIMEOUT

NotebookLM bridge 上傳 timeout 秒數,預設 `60`。

CLOUDFLARE_R2_BUCKET

Cloudflare R2 建立 bucket;目前預設 `auto-rag`。

PORT

Runtime port for the Hugging Face Docker Space/local server. Hugging Face Docker Spaces should use `7860`.

CLOUDFLARE_R2_S3_ENDPOINT

選填的 S3 API 路徑。如果只使用 `pbx_application_token`,請讓所有 S3 欄位保持空白。若使用 S3 API 模式,你的 bucket 可填 `https://8dfc8c4994bd0925c72ab9e2eff79b48.r2.cloudflarestorage.com/auto-rag`。

HOST

Runtime host bind address. Use `0.0.0.0` for Docker/Hugging Face Spaces.

CLOUDFLARE_R2_S3_ACCESS_KEY_ID

Cloudflare Dashboard → R2 → Manage R2 API Tokens → create an R2 token with object read/write access for the `auto-rag` bucket. Use the 32-character Access Key ID. Do not use the Cloudflare API token or token id here.

ALLOWED_ORIGINS

RAG engine CORS 設定;測試可用 `*`,正式環境建議填 GitHub Pages origin。

HF_TOKEN

Hugging Face Settings → Access Tokens 建立具 Spaces 寫入權限的 token。

USE_WORKERS_AI

Cloudflare Worker 是否使用 Workers AI 產生摘要;Hugging Face Docker Space 使用 deterministic ranking。

HF_SPACE_ID

Hugging Face Space repo id,格式 `<username-or-org>/<space-name>`。

HF_RAG_ASSET_ROOT

Hugging Face Docker container 內的資產路徑,除非改 Dockerfile,維持 `/app/dist/hf_assets`。