Skip to main content
Glama

論文

個人投資家向けの、ティッカーごとに自己ホスト型のリサーチワークスペース。PWAの共有シートからどこでもコンテンツをキャプチャできます。ワークスペースはMCPサーバーを公開しており、自分のエージェント(Claude、ChatGPT、Codex CLI)が統合分析を行います。シングルユーザー向けMVP — データはCloudflareアカウント内に保持されます。

リサーチ支援であり、助言ではありません。エージェントが執筆し、あなたが決定します。

アーキテクチャ

┌─────────────────────────────────────────────────────────────┐
│  Browser / Mobile                                           │
│  ┌──────────────────────────────────────────────────────┐   │
│  │  PWA  (Vite + React + Tailwind)                      │   │
│  │  - Web Share Target  - Workspace tabs                │   │
│  │  - Tiptap rich text  - Component renderer            │   │
│  └────────────────────┬─────────────────────────────────┘   │
└───────────────────────┼─────────────────────────────────────┘
                        │  /api/*  /mcp
┌───────────────────────▼─────────────────────────────────────┐
│  Cloudflare Worker  (Hono)                                  │
│  ┌───────────────────────────────┐  ┌──────────────────┐    │
│  │  Workspace Durable Object     │  │  WorkspaceAgent  │    │
│  │  SQLite + embedding BLOB      │  │  DO (Slice 4)    │    │
│  │  30 MCP tools                 │  │  nightly cron    │    │
│  └───────────────────────────────┘  └──────────────────┘    │
│  ┌───────────────────────────────────────────────────────┐   │
│  │  Data providers                                       │   │
│  │  Yahoo  Stooq  EDGAR  Finnhub  FRED                  │   │
│  └───────────────────────────────────────────────────────┘   │
│  ┌──────────────┐  ┌────────────┐  ┌──────────────────────┐  │
│  │  R2 (docs)   │  │  KV cache  │  │  CF AI Gateway       │  │
│  └──────────────┘  └────────────┘  └──────────────────────┘  │
└─────────────────────────────────────────────────────────────┘

Future:
┌─────────────────────────┐
│  Auth app (Slice 5)     │
│  better-auth + Postgres  │
│  Docker → Fly.io        │
└─────────────────────────┘

Related MCP server: equity-desk

クイックスタート

git clone <repo> && cd invest
npm install
cp apps/worker/.dev.vars.example apps/worker/.dev.vars
# Edit apps/worker/.dev.vars — set THESIS_BEARER_TOKEN, optionally FINNHUB_API_KEY + FRED_API_KEY

# Terminal 1 — worker on :8787
npm run dev:worker

# Terminal 2 — PWA on :5173 (proxies /api and /mcp to :8787)
npm run dev:pwa

http://localhost:5173 を開きます。設定でベアラートークンを追加します(.dev.vars の値を使用)。

エージェントを接続する(BYOA)

GET /api/mcp-info はMCPエンドポイント、ツールリスト、認証手順を返します。設定ページには同じ情報がコピー可能なURL付きで表示されます。

  • Streamable HTTP(推奨): POST /mcp、GET /mcp

  • レガシーSSE: GET /mcp/sse、POST /mcp/messages

  • 認証: Authorization: Bearer <token> または ?token=<token>

環境変数

すべてのシークレットはローカル開発用に apps/worker/.dev.vars に置きます。apps/worker/.dev.vars.example を参照してください。

変数

必須

備考

THESIS_BEARER_TOKEN

はい

すべてのAPI + MCPリクエストの共有シークレット

FINNHUB_API_KEY

任意

finnhub.ioで無料 — ファンダメンタルズ、決算、ニュースを有効化

FRED_API_KEY

任意

fred.stlouisfed.orgで無料 — マクロタイルを有効化

STOOQ_API_KEY

任意

2025年のキャプチャゲート — スキップしてYahooフォールバックを使用

ANTHROPIC_API_KEY

スライス4

組み込みエージェントの夜間実行に必須

CF_AIG_TOKEN

スライス4

Cloudflare AI Gatewayトークン

CF_ACCOUNT_ID

スライス4

CloudflareアカウントID

AGENT_MONTHLY_TOKEN_CAP

任意

ワークスペースごとのデフォルト月間200,000トークン

提供済みスライス

完全な決定ログとスライス履歴: docs/roadmap/GRILL-ME.md

スライス

説明

ステータス

W0–W5

基盤、著者性、統合、レンズ、エビデンス、データ

✅

スライス0

安定化、Stooqドキュメント、EDGARリトライ、theme-color

✅

スライス1

構成プリミティブ — layout_json + set_layout MCP

✅

スライス1.5

完全なスロットマップ + 拡張コンポーネント語彙

🔄

スライス2

検索 — 埋め込み(BLOBコサイン)、retrieveツール、バックフィル

✅

スライス3

時間的 — catch_up、reactivate_check、Catch Up UI

✅

スライス4

組み込みエージェント — WorkspaceAgent DO、夜間cron、AI Gateway

✅

スライス5

認証 — better-auth、Docker化された認証アプリ

設計中

スライス6

チャットサーフェス

設計中

スライス7

クロスティッカーVectorize層

設計中

スモークテスト

カテゴリ別のスモークテストは smoke/ にあります。

# All Playwright specs (UI + E2E)
npm run smoke

# Individual shell scripts (worker API — no browser needed)
bash smoke/ingestion/capture.smoke.sh
bash smoke/claims/claims.smoke.sh
bash smoke/agent/agent.smoke.sh   # needs ANTHROPIC_API_KEY

デプロイ

Cloudflare Worker + PWA

# 1. Build PWA into apps/pwa/dist
npm run build:pwa

# 2. Set production secrets (one-time)
cd apps/worker
wrangler secret put THESIS_BEARER_TOKEN
wrangler secret put ANTHROPIC_API_KEY
wrangler secret put CF_AIG_TOKEN
wrangler secret put FINNHUB_API_KEY
wrangler secret put FRED_API_KEY

# 3. Deploy worker + PWA assets
wrangler deploy

Workerは同じオリジンからPWAを提供します。/share-target、/mcp、/api/* はすべてファーストパーティです。

認証アプリのDockerターゲット、DNS、デプロイ後のスモークチェックを含む完全なデプロイガイド: docs/deployment.md。

技術スタック

レイヤー

技術

Workerランタイム

Cloudflare Workers + Durable Objects (SQLite)

APIフレームワーク

Hono

MCP

手書きのJSON-RPC over HTTP + SSE (30ツール)

PWA

Vite 5 + React 18 + Tailwind 3

リッチテキスト

Tiptap

埋め込み

Workers AI bge-small-en-v1.5 (384次元、BLOBコサイン)

エージェント

プレーンなDurable Object (WorkspaceAgent) + CF AI Gateway

ドキュメント

R2 + document_captures 結合テーブル

共有型

packages/shared (Zod)

貢献

  1. docs/STATUS.md を読む — 現在の状態 + 今後の計画

  2. docs/architecture/v2-embedded-agent.md を読む — v2設計

  3. プッシュ前に npm run typecheck を実行

  4. smoke/ に新しいエンドポイントのスモークカバレッジを追加

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to perform grounded equity research by analyzing tickers from SEC filings and market data, producing citation-guarded memos with pre-computed fundamentals.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Financial data and research MCP for AI agents: filings with full-text and fact search, statements as reported, earnings, insider and institutional ownership, corporate events, executives, analyst data, company discovery and research signals for US, China and Japan equities. Every figure traced to its filing. Browser sign-in.
      10
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI assistants to access and analyze financial data such as stocks, ETFs, crypto, forex, commodities, company fundamentals, financial statements, and market insights through 250+ configurable tools.
      356 npm
      Apache 2.0