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)、あらゆるMCP互換クライアント(OpenAI Realtime API経由のMCP対応GPTを含む)向けのzero-code。
- HTTP API: 独自エージェントやフレームワーク(LangChain、LlamaIndex、AutoGen、CrewAI)からの直接アクセス。
llms.txt: AIエージェント向けdiscovery
Section titled “llms.txt: AIエージェント向けdiscovery”サイトは llms.txt 形式の機械可読ファイルを2つ公開している:
/llms.txt: セクション別にグループ化された全ドキュメントページのインデックス(API Reference、Use Cases、Examples、Products)。小さく、どんなcontext windowにも収まる。/llms-full.txt: ドキュメント全体を1つのplain-textファイルにまとめたもの。ベクトルDBへのオフラインインデックス化や、contextへの一括投入に適している。
| シナリオ | ファイル |
|---|---|
| Cursor/Windsurfで「astrowayのdocsを読んで統合を手伝って」 | /llms.txt(エージェントが必要なセクションを自分で取得) |
| FAQボット用の独自RAGパイプライン / ベクトルDB | /llms-full.txt(1回のfetchでコーパス全体) |
| ブラウザ上のClaude/ChatGPT:「これがうちのAPI、クライアントを作って」 | /llms-full.txt をプロンプトに貼り付け |
| 呼び出しを実行するproductionエージェント | MCPサーバーまたはHTTP API(下記参照) |
例: 独自エージェントへのpull
Section titled “例: 独自エージェントへのpull”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サーバーは、APIの各オペレーションに1つずつ、計783のツールを提供し、さらに12のプロンプトと14のリソースも備えている。
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は783のツールすべてを認識する。リストを絞りたい場合は ASTROWAY_TOOL_GROUPS を設定するか、ドメイン別サーバーに接続しよう。詳しくは MCPの設定 を参照。
MCPサーバーでできること
Section titled “MCPサーバーでできること”| ツール | 機能 |
|---|---|
astroway_western_chart | ネイタルチャートの計算 |
astroway_relational_synastry | 2人のシナストリー |
astroway_horoscope_daily | デイリーホロスコープ |
astroway_ai_interpret_natal | ネイタルチャートのAI解釈 |
astroway_hd_human_design | 完全なHDチャート |
astroway_prognostics_transits | 現在のトランジット |
完全なリスト: 783ツール、API全体、それぞれ型付きのレスポンスschema付き。
Claudeとの対話例
Section titled “Claudeとの対話例”ユーザー: 1990年7月14日14時30分、キーウ生まれの人のネイタルチャートを作って。10ハウスの蟹座の太陽はどういう意味?
Claude:
astroway_western_chartで計算し、次にastroway_ai_interpret_placementで解釈。実データに基づく惑星位置と、意味のある解釈を返す。
HTTP API
Section titled “HTTP API”MCP非対応のAIエージェントには、HTTP APIを直接使おう。
コンテンツ生成向け
Section titled “コンテンツ生成向け”// The AI agent calls /interpret/natal for an interpretationconst 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 { data: result } = await r.json();// result.interpretation - ready AI interpretation// result.disclaimer - disclaimer to displayimport 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()['data']# result['interpretation'] - ready AI interpretation# result['disclaimer'] - disclaimer to displaycurl -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)['data'];// $result['interpretation'] - ready AI interpretation// $result['disclaimer'] - disclaimer to display計算 + 独自LLM向け
Section titled “計算 + 独自LLM向け”// 1. Get raw data from /chart (cheaper - 20 credits)const chart = await fetch('https://api.astroway.info/v1/chart', { ... });const { data } = await chart.json();
// 2. Pass the data to your own LLMconst prompt = `Interpret this natal chart: ${JSON.stringify(data.planets)}`;const llmResponse = await myLLM.generate(prompt);ユースケース
Section titled “ユースケース”パーソナル占星術アシスタント
Section titled “パーソナル占星術アシスタント”MCPサーバー + Claude/ChatGPT。ユーザーが質問し、エージェントが計算して解釈する。予算: 個人利用ならFreeプラン。
SNS向けコンテンツボット
Section titled “SNS向けコンテンツボット”/horoscope/daily で12星座分のホロスコープを毎日生成。1日12リクエスト = 240クレジット。Freeプランで余裕あり。
AIコーチングプラットフォーム
Section titled “AIコーチングプラットフォーム”クライアントごとに /interpret/natal + /interpret/transits。1日100クライアント = 1日10,000クレジット。Proプラン。