mcpField
T
TrendsAGI

TrendsAGI

リモート
trendsagi.comビジネス・マーケティング11 日前に更新
リポジトリ公式サイト

TrendsAGI について

TrendsAGIは、ソーシャルメディアの最新トレンド、測定指標、AIインサイト、提案、危機イベント、ウォッチリストを読み取り専用で提供します。トレンドデータを使ったオーディエンス調査やキャンペーン計画を行うチームやエージェント向けです。

主な機能

  1. 01指標別にトレンドを検索
  2. 02AIインサイトと提案を確認
  3. 03危機イベントとウォッチリストを管理
  4. 04読み取り専用SQLでトレンドを検索
  5. 05最新トレンドをストリーミング

活用シーン

  1. 01キャンペーン向けの上昇トピック探し
  2. 02トレンドのオーディエンスや感情の把握
  3. 03ウォッチ対象と危機イベントの監視
  4. 04SQLによるトレンドデータ分析

MCP 対応

ホスト型MCP サーバー https://api.trendsagi.com/mcp とローカルの `trendsagi mcp` が、TrendsAGIのツールをMCPクライアントに提供します。ホスト型ツールは読み取り専用で、ローカルでは明示的に書き込みを有効化できます。

設定

リモートサーバーはインストール不要です。クライアントを選んで設定をコピーするか、ワンクリックで導入できます。

エンドポイントhttps://api.trendsagi.com/mcp
インストールコマンドをコピー
Claude CodeTerminal
Cursor.cursor/mcp.json
VS Code.vscode/mcp.json
Claude Desktopclaude_desktop_config.json
Windsurf~/.codeium/windsurf/mcp_config.json

コマンドはターミナルで実行し、JSON は各クライアントの MCP 設定に貼り付けて再起動します。認可が必要なサーバーは初回接続時にログインを求めます。

ツール

詳細

TrendsAGI

PyPI Version npm Version Python Versions License: MIT

コードやAIエージェントのためのリアルタイムトレンドインテリジェンスです。ソーシャルプラットフォームで今何がトレンドになっているかを、測定されたボリューム、勢い、成長率とともに把握できます。各トピックが注目を集めている理由についてのAIインサイト、根拠に基づく推奨事項、危機アラート、ウォッチリストも提供します。有料メディアや成長施策のチームは、上昇中のトピックをターゲットにし、トレンド曲線に合わせて予算を投じるタイミングを調整し、測定された需要に基づいてクリエイティブの概要を作成するために利用しています。

Python クライアント型付き REST クライアントの TrendsAGIClient
コマンドラインAPI アクションごとに1つのコマンドを提供する trendsagi。ターミナルではテーブル形式、パイプでは JSON を出力します
エージェントツールOpenAI、Claude、LangChain、WebMCP 向けの TrendsAGITools
ホスト型 MCP サーバーClaude、ChatGPT、Grok、Cursor、Gemini CLI 向けの https://api.trendsagi.com/mcp
ブラウザーエージェント(WebMCP)app.trendsagi.com にサインインすると、ブラウザーのエージェントで同じツールを利用できます(webmcp/)
ローカル MCP サーバー同じツールを stdio 経由で提供する trendsagi mcp
プラグインClaude、Grok、Cursor 向けプラグインは plugins/trendsagi、Gemini CLI 拡張機能はリポジトリのルートにあります
広告の実行独自のインフラから Google、Meta、TikTok、LinkedIn の広告変更をプレビューしてから適用するエグゼキューター

インストール

pip install trendsagi            # client, agent tools and the trendsagi command
pip install "trendsagi[mcp]"     # adds the local MCP server (Python 3.10+)
pipx install trendsagi           # just the command line, in its own environment
npx trendsagi --help             # or the same command line from npm (Node.js 18+)

app.trendsagi.com の Profile > API Keys で API キーを作成し、環境変数に設定します。

export TRENDSAGI_API_KEY="your_api_key"

クイックスタート

import os
from trendsagi import TrendsAGIClient

client = TrendsAGIClient(api_key=os.environ["TRENDSAGI_API_KEY"])

# Fastest-moving Technology topics right now
trends = client.get_trends(category="Technology", sort_by="velocity", limit=5)
for trend in trends.trends:
    print(trend.id, trend.name, trend.volume)

# Why is the top one moving?
insight = client.get_ai_insights(trends.trends[0].id)
if insight:
    print(insight.sentiment_summary, insight.key_themes)

コマンドライン

trendsagi login                  # paste an API key; saved to ~/.config/trendsagi/config.json
trendsagi trends list --category Technology --sort velocity --limit 10
trendsagi insights get 123       # audience, sentiment and marketing angles
trendsagi sql "SELECT category, count(*) FROM trends GROUP BY 1 ORDER BY 2 DESC"
trendsagi recommendations list --priority high
trendsagi watchlist add "oat milk" --threshold 50000 --email
trendsagi api /api/integrations/delivery/health -q lookback_hours=24   # any endpoint
コマンド機能
login、logout、whoamiAPI キーの保存、削除、確認
trends list get analytics categories autocomplete測定されたボリューム、勢い、成長率を含むトレンドトピック
insights get generate [--wait] status searchトレンドごとのAIインサイト
recommendations list action feedback根拠に基づく推奨事項とそのワークフローのステータス
crisis list action危機イベント:確認、アーカイブ、再開
watchlist list add removeアラート付きの追跡キーワードとカテゴリー
sql、schemaデータに対する読み取り専用の PostgreSQL SELECT クエリと、読み取り可能なテーブル
tools list call、findエージェントツール、および TrendsAGI がタスクを実行できるかどうか
webhooks、exportsWebhook とデータエクスポートの作成、変更、テスト、実行
ads providers resources preview apply report report-export接続済み広告プラットフォーム:トレンドに基づく変更とレポート
integrations availability status health valueインテグレーションのステータスと配信状況
streamJSON 行形式によるリアルタイムのトレンド更新
usage、status、apiAPI 使用状況、サービスステータス、および専用コマンドのないエンドポイント

すべてのコマンドで --help を利用できます。ターミナルではリストがテーブルとして出力され、パイプ経由または --json を指定した場合は JSON が出力されるため、trendsagi trends list | jq のように実行できます。キーは --api-key、TRENDSAGI_API_KEY、保存済みのログイン情報の順に使用されます。何かを削除したり、配信中の広告を変更したりするコマンドでは、最初に確認を求めます。スクリプトでは --yes を指定してください。終了コード:0 は成功、1 は API エラー、2 は無効な使用方法、4 はキーの未設定または拒否を表します。

コマンドの定義元は src/trendsagi/cli_spec.json の1か所だけです。同じ CLI の依存関係を必要としない Node.js ビルドは npm/ にあり、npm では trendsagi として公開されています。ガイド:trendsagi.com/api-docs/integrations/cli。

クライアントからは、任意のエンドポイントも呼び出せます:client.request("GET", "/api/integrations/delivery/health", params={"lookback_hours": 24})。

AI アシスタントで TrendsAGI を使う(インストール不要)

ホスト型 MCP サーバーを追加し、TrendsAGI にサインインして接続を承認してください。

アシスタント設定
ClaudeClaude ディレクトリで TrendsAGI を開く、または設定 > コネクター > 以下の URL を使ってカスタムコネクターを追加
Claude Codeclaude mcp add --transport http trendsagi https://api.trendsagi.com/mcp、または /plugin marketplace add TrendsAGI/TrendsAGI の後に /plugin install trendsagi@trendsagi
ChatGPT以下の URL を使ってカスタムコネクターを追加
GrokTrendsAGI プラグインをインストールするか、URL をリモート MCP サーバーとして追加
Cursor{ "mcpServers": { "trendsagi": { "url": "https://api.trendsagi.com/mcp" } } }
Gemini CLIgemini extensions install https://github.com/TrendsAGI/TrendsAGI
https://api.trendsagi.com/mcp

続いて、*「今週、Technology で最も急速に勢いを増しているものは何ですか。それを誰に向けて発信すべきですか?」*と尋ねてください。ホスト型ツールは読み取り専用で、各呼び出しは API リクエスト 1 回としてカウントされます。接続ごとに専用のキーが発行され、プロフィール > API Keys の「AI connector: 」に表示されます。接続を解除するには、このキーを削除してください。OAuth に対応していないクライアントでは、Authorization: Bearer <key> として API キーを送信できます。ガイド:trendsagi.com/mcp。

ブラウザーのエージェントから TrendsAGI を使う(WebMCP)

WebMCP を使うと、Web ページからブラウザーに組み込まれた AI エージェント(オリジントライアル中の Chrome と Edge、ChatGPT デスクトップ、Brave Leo)にツールを渡せます。app.trendsagi.com にサインインしている間、アプリは document.modelContext を使って TrendsAGI の読み取り専用ツールを登録するため、エージェントはあなたのセッションでツールを使用できます。コネクターも API キーも不要で、呼び出しは API 利用ではなくアプリの利用としてカウントされます。trendsagi.com では、公開ツール(ドキュメント検索、トレンドレポート、プラン、無料の計算ツール)をすべての訪問者に提供しています。

独自のサイトに TrendsAGI ツールを設置するには、ページにツールを登録してサーバー上で実行します。これにより API キーが保持されます。

tools = TrendsAGITools(TrendsAGIClient(api_key=os.environ["TRENDSAGI_API_KEY"]))

tools.webmcp()                     # serve to your page: name, description, inputSchema, annotations
tools.call("list_trends", args)    # run the call your page forwards

webmcp/ には、ブラウザーモジュールと FastAPI サーバーがあります。ガイド:trendsagi.com/webmcp。

エージェントツール

1 つのレジストリで、あらゆる形式に対応します。ツールはデフォルトで読み取り専用です。add_to_watchlist と update_recommendation は、allow_writes=True(または trendsagi mcp --allow-writes)を指定した場合にのみ表示されます。

ツールエージェントが取得する情報
list_trendsカテゴリーまたはフレーズ別のトレンドトピック。勢い、成長率、またはボリューム順に並べ替えられます
list_trend_categories有効なカテゴリー名
search_trend_insightsテーマに一致するトレンドとインサイト
get_trend / get_trend_analytics1 つのトレンドとそのボリュームの時系列データ
get_trend_ai_insights概要、主要テーマ、センチメント、オーディエンス、マーケティングの切り口
list_recommendations根拠に基づくアクションと意思決定の概要
list_crisis_events監視対象トピックの評判および危機イベント
list_watchlist / get_api_usage監視中のトピックと、残りの 1 日あたりのクォータ
read_data_schema / execute_sqlフィルター、結合、集計が必要な質問に対応する読み取り専用 SQL
find_capabilityTrendsAGI でタスクを実行できるかどうかと、そのタスクに対応するツールまたはアプリページ
OpenAI
import json, os
from openai import OpenAI
from trendsagi import TrendsAGIClient, TrendsAGITools

tools = TrendsAGITools(TrendsAGIClient(api_key=os.environ["TRENDSAGI_API_KEY"]))
openai = OpenAI()
messages = [{"role": "user", "content": "Find a fast-rising Technology trend and suggest a campaign angle."}]

while True:
    reply = openai.chat.completions.create(model="gpt-5-mini", messages=messages, tools=tools.openai())
    message = reply.choices[0].message
    messages.append(message)
    if not message.tool_calls:
        print(message.content)
        break
    for call in message.tool_calls:
        result = tools.call(call.function.name, call.function.arguments)
        messages.append({"role": "tool", "tool_call_id": call.id, "content": json.dumps(result)})
Claude、LangChain など
tools.anthropic()         # Anthropic Messages API tools=
tools.openai_responses()  # OpenAI Responses API tools=
tools.langchain()         # LangChain StructuredTools (pip install "trendsagi[langchain]")
tools.webmcp()            # WebMCP descriptors for document.modelContext.registerTool

Claude では、tools=tools.anthropic() を渡し、各 tool_use ブロックに対して {"type": "tool_result", "tool_use_id": block.id, "content": json.dumps(tools.call(block.name, block.input))} を返してください。tools.call は例外を発生させません。エラーは {"error": ...} として返されるため、モデルはレート制限や不正な引数を読み取り、対処できます。

ローカル MCP サーバー
pip install "trendsagi[mcp]"
claude mcp add trendsagi --env TRENDSAGI_API_KEY=your_api_key -- trendsagi mcp

または、任意の MCP クライアントの JSON 設定(Claude Desktop、Cursor、VS Code)で使用できます。

{ "mcpServers": { "trendsagi": { "command": "trendsagi-mcp", "env": { "TRENDSAGI_API_KEY": "your_api_key" } } } }

SQL でクエリを実行する

カテゴリー別の成長率やウォッチリストに一致するトレンドなど、単一のエンドポイントでは回答を取得できない場合は、次のようにします。

schema = client.get_data_schema()   # tables, columns, rules, examples
result = client.execute_sql(
    """
    SELECT category, count(*) AS trends, round(avg(growth_pct)::numeric, 1) AS avg_growth_pct
    FROM trends
    WHERE last_seen_at > now() - interval '7 days' AND growth_pct IS NOT NULL
    GROUP BY category ORDER BY avg_growth_pct DESC
    """,
    max_rows=20,
)
print(result["columns"], result["rows"])

テーブル:trends、trend_snapshots(90 日分の測定値)、trend_categories、trend_insights、watchlist、recommendations、crisis_events。最後の 3 つには、ご自身のアカウントの行のみが含まれます。クエリは検証済みの SELECT 1 件で、読み取り専用で最大 5 秒間実行され、API リクエスト 1 回としてカウントされます。クエリが拒否されると、code(unknown_table や timeout など)に加え、判明している場合は hint と position を含む exceptions.QueryError が発生します。

意思決定ブリーフ付きのレコメンデーション

recommendations = client.get_recommendations(match_user_interests=True, priority="high", sort="priority", limit=10)
for rec in recommendations.recommendations:
    brief = rec.decision_brief
    if brief and brief.actionable:
        print(rec.title, brief.why_now, brief.next_steps[:1])

各ブリーフでは、今行動すべき理由、その根拠となる測定シグナル、具体的な次のステップを説明します。信頼度スコアは成功の可能性ではなく、エビデンスの完全性を示します。シグナルが古い、または不完全な場合は、actionable と data_quality を確認して慎重に判断してください。

独自のインフラでの広告配信

GoogleAdsExecutor、MetaAdsExecutor、TikTokAdsExecutor、LinkedInAdsExecutor は実行時に認証情報を受け取り、決定的な冪等性キーを使用します。また、ドライランプレビューと厳格な検証に対応しています。

from trendsagi.integrations import GoogleAdsExecutor

insight = client.get_ai_insights(trend_id)  # the trend you decided to act on
google = GoogleAdsExecutor({
    "access_token": os.environ["GOOGLE_ADS_ACCESS_TOKEN"],
    "developer_token": os.environ["GOOGLE_ADS_DEVELOPER_TOKEN"],
})
preview = google.apply_targeting(insight, customer_id="1234567890", campaign_id="9876543210", dry_run=True, strict_mode=True)
print(preview.response)  # inspect before any real change

各エグゼキューターについては、INTEGRATIONS_BYOC.md をご覧ください。

エラー

from trendsagi import exceptions

try:
    client.get_trends(limit=5)
except exceptions.RateLimitError:
    ...  # back off and retry
except exceptions.AuthenticationError:
    ...  # invalid or revoked key

その他のコマンド

trendsagi mcp [--allow-writes]                              # MCP server over stdio
trendsagi scaffold --type docker --output-dir ./runner      # executor runner template
trendsagi scaffold --type terraform --output-dir ./infra    # infrastructure template

プランと制限

無料の Developer プランには、API キー 1 つと 1 日あたり 100 回の API 呼び出しが含まれます。Advantage、Scale、Enterprise では 1 日あたりの上限が引き上げられ、キーやチーム向け機能が追加されます。1 日あたりの上限を超えた呼び出しには超過料金が発生します。料金をご覧ください。

リンク

ライセンス

MIT。LICENSEをご覧ください。

コメント

MCP は初めてですか?

プロトコルの概要から最初のサーバーの導入まで、よくある疑問にまとめて答えます。

AI アプリケーションが外部のツールやデータソースに統一的な方法で接続するためのオープンなプロトコルです。クライアントはモデルとの対話を担い、MCP サーバーはツール・リソース・プロンプトテンプレートを提供します。標準メッセージでやり取りするため、1 つのサーバーを複数のクライアントで再利用できます。