AIエージェントとMCP
AIエージェントで本物のアストロロジカル計算を行わせたい?AstroWayはClaude (Anthropic)、ChatGPT-4 (OpenAI)、Llama 3.3 (Groq)、DeepSeek、Google Gemini、Mistralと接続できます。MCP、llms.txt、または直接HTTPリクエストで統合可能。3つの方法からエージェントのタイプに合わせて選択しよう:
llms.txt— エージェントがドキュメントを読み取るためのdiscoveryファイル(Cursor IDE、Windsurf、ブラウザ版Claude、LangChain/LlamaIndexを使用したカスタムRAGパイプライン向け)。- MCPサーバー — Claude Desktop、Cursor IDE、Windsurf、VS Code (llm CLI)、およびOpenAI Realtime API経由のGPTを含む、あらゆるMCP対応クライアント向けのゼロコードソリューション。
- HTTP API — 自身のエージェントやフレームワーク(LangChain、LlamaIndex、AutoGen、CrewAI)から直接呼び出し。
llms.txt — AIエージェント向けdiscovery
Section titled “llms.txt — AIエージェント向けdiscovery”AstroWayは、llms.txt形式の2つの機械可読ファイルを公開しています:
/llms.txt— APIリファレンス、ユースケース、例、製品などのセクションに分類されたすべてのドキュメントのインデックス。小さなサイズで、あらゆるcontext windowに収まります。/llms-full.txt— ドキュメント全体を1つのプレーンテキストファイルにまとめたもの。ベクトルDBへのオフラインインデックス作成や、一度のcontext投入に最適です。
使用シナリオ
Section titled “使用シナリオ”| シナリオ | ファイル |
|---|---|
| Cursor/Windsurfで「astrowayのドキュメントを読んで統合を手伝って」 | /llms.txt(エージェントが必要なセクションを自動で取得) |
| FAQボット用の独自RAGパイプライン/ベクトルDB | /llms-full.txt(1回のfetchで全文書を取得) |
| ブラウザ版Claude/ChatGPTで「こちらがAPIです。クライアントを構築して」 | /llms-full.txtをプロンプトに貼り付け |
| 本番環境の実行エージェント | MCPサーバーまたはHTTP API(後述) |
例:独自エージェントへの取り込み
Section titled “例:独自エージェントへの取り込み”const docs = await fetch('https://api.astroway.info/llms-full.txt').then(r => r.text());
const systemPrompt = `You are an integration assistant for AstroWay API.Documentation:${docs}
When the user asks how to do X, return a working code snippet using their API key.`;MCPサーバー(Claude Desktop向けに推奨)
Section titled “MCPサーバー(Claude Desktop向けに推奨)”Model Context Protocol(MCP)は、AIモデルとツールを接続するためのオープンスタンダードです。AstroWayのMCPサーバーは、計算と解釈のための25のツールを提供します。
Claude Desktopの設定
Section titled “Claude Desktopの設定”claude_desktop_config.jsonに以下を追加:
{ "mcpServers": { "astroway": { "command": "npx", "args": ["@astroway/mcp"], "env": { "ASTROWAY_API_KEY": "aw_live_your_key_here" } } }}Claude Desktopを再起動すると、25のアストロロジカルツールが利用可能になります。
MCPサーバーでできること
Section titled “MCPサーバーでできること”| ツール | 機能 |
|---|---|
natal_chart | 出生図の計算 |
synastry | 2人のシナストリー |
daily_horoscope | 1日のホロスコープ |
interpret_natal | 出生図のAI解釈 |
human_design | Human Design完全図 |
transits | 現在のトランジット |
完全なリストは25のツールで、主要な計算とAI解釈をカバーしています。
Claudeとの対話例
Section titled “Claudeとの対話例”ユーザー: 1990年7月14日14:30にキエフで生まれた人の出生図を作成して。10ハウスにある蟹座の太陽は何を意味する?
Claude:
natal_chartで計算し、interpret_placementで解釈します。実データに基づく惑星の位置と、わかりやすい解釈を返します。
HTTP API
Section titled “HTTP API”MCPに対応していないAIエージェント向けに、HTTP APIを直接使用できます。
コンテンツ生成用
Section titled “コンテンツ生成用”// AIエージェントが/interpret/natalを呼び出して解釈const r = await fetch('https://api.astroway.info/v1/interpret/natal', { method: 'POST', headers: { 'X-Api-Key': process.env.ASTROWAY_API_KEY!, 'Content-Type': 'application/json', }, body: JSON.stringify({ date: '1990-07-14', time: '14:30:00', timezoneOffset: 3, latitude: 50.4501, longitude: 30.5234, }),});
const result = await r.json();// result.text — 完成したAI解釈// result.disclaimer — 表示用の免責事項import os, requests
r = requests.post( 'https://api.astroway.info/v1/interpret/natal', headers={'X-Api-Key': os.environ['ASTROWAY_API_KEY']}, json={ 'date': '1990-07-14', 'time': '14:30:00', 'timezoneOffset': 3, 'latitude': 50.4501, 'longitude': 30.5234, },)result = r.json()# result['text'] — 完成したAI解釈# result['disclaimer'] — 表示用の免責事項curl -X POST https://api.astroway.info/v1/interpret/natal \ -H "X-Api-Key: $ASTROWAY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "date": "1990-07-14", "time": "14:30:00", "timezoneOffset": 3, "latitude": 50.4501, "longitude": 30.5234 }'<?phpuse GuzzleHttp\Client;
$aw = new Client(['base_uri' => 'https://api.astroway.info/v1/']);$r = $aw->post('interpret/natal', [ 'headers' => ['X-Api-Key' => getenv('ASTROWAY_API_KEY')], 'json' => [ 'date' => '1990-07-14', 'time' => '14:30:00', 'timezoneOffset' => 3, 'latitude' => 50.4501, 'longitude' => 30.5234, ],]);
$result = json_decode($r->getBody(), true);// $result['text'] — 完成したAI解釈// $result['disclaimer'] — 表示用の免責事項計算 + 独自LLM用
Section titled “計算 + 独自LLM用”// 1. /chartで生データを取得(安価:20クレジット)const chart = await fetch('https://api.astroway.info/v1/chart', { ... });const data = await chart.json();
// 2. データを独自LLMに渡すconst prompt = `Interpret this natal chart: ${JSON.stringify(data.planets)}`;const llmResponse = await myLLM.generate(prompt);ユースケース
Section titled “ユースケース”個人向けアストロロジーアシスタント
Section titled “個人向けアストロロジーアシスタント”MCPサーバー + Claude/ChatGPT。ユーザーが質問すると、エージェントが計算と解釈を行います。予算:個人利用向けの無料プラン。
SNS向けコンテンツボット
Section titled “SNS向けコンテンツボット”12星座のデイリーホロスコープを/horoscope/dailyで毎日生成。1日12回のリクエストで240クレジット。無料プランで十分な余裕あり。
AIコーチングプラットフォーム
Section titled “AIコーチングプラットフォーム”各クライアントに対し/interpret/natal + /interpret/transitsを使用。1日100人のクライアントで10,000クレジット/日。Proプランが必要。