apifable

apifable
仕様を読み解き、APIを理解し、自信を持って統合する。
English | 繁體中文
概要
apifableは、AIがTypeScriptフロントエンドプロジェクトにAPIをよりスムーズに統合できるように支援するMCPサーバーです。API構造の探索、エンドポイントの検索、TypeScript型の生成を容易にし、AIエージェントが正確な統合コードを書くために必要なコンテキストを提供します。
Related MCP server: openapi-mcp-proxy
✨ 特徴
📦 AI対応のAPIコンテキスト — APIを理解し、操作するために必要な構造をAIに提供します
📘 OpenAPI 3.0 / 3.1サポート — 信頼できる情報源として標準仕様で動作します
🤖 AIエージェント用MCPサーバー — Claude、Cursor、Windsurfにプラグイン可能です
🔍 API探索ツール — エンドポイントの閲覧、キーワード検索、リクエスト/レスポンス詳細の検査が可能です
🏷️ TypeScript型生成 — フロントエンドコードですぐに使用できるTypeScript型定義を生成します
はじめに
インストール
apifable initを実行してプロジェクト設定をセットアップします:
npx apifable@latest initこれにより、プロジェクトルートにapifable.config.jsonが作成されます。仕様パスをチームと共有するため、設定ファイルはバージョン管理にコミットしてください。
コマンド開始後、**Manual file(手動ファイル)とRemote URL(リモートURL)**のいずれかを選択できます。
1. Manual file
OpenAPI仕様がすでにプロジェクト内に存在する場合、または仕様の更新を自分で管理したい場合に使用します。
initは、openapi.yamlのようなローカルファイルパスを尋ねます。
その後、そのパスにOpenAPI仕様を手動で配置する必要があります。バックエンドAPIが変更された場合も、そのファイルを自分で更新する必要があります。
2. Remote URL
OpenAPI仕様が、バックエンドAPIドキュメントによって提供されるOpenAPI仕様エンドポイントなど、安定したリモートURLから利用可能な場合に使用します。
initはまずhttps://api.example.com/openapi.yamlのようなリモートURLを尋ね、次に./openapi.yamlのようなローカル出力パスを尋ねます。
[!NOTE] このモードでは、
initはダウンロードされたローカル仕様パスを自動的に.gitignoreに追加します。これは、ファイルがリモートソースからリフレッシュされることを意図しているためです。
その後、以下のコマンドを実行して、リモートURLからローカルパスへOpenAPI仕様をダウンロードできます(spec.url → spec.path)。仕様が変更されるたびに、再度実行してリフレッシュしてください:
npx apifable@latest fetchヘッダー
チームと共有可能な非機密ヘッダーについては、apifable.config.jsonにspec.headersを追加してください:
{
"spec": {
"path": "openapi.yaml",
"url": "https://example.com/openapi.yaml",
"headers": {
"X-Api-Version": "2"
}
}
}認証ヘッダー(シークレットトークン)
リモートのOpenAPI仕様のダウンロードに認証(プライベートAPI)が必要な場合は、シークレットヘッダーを.apifable/auth.jsonに保存してください。このファイルはバージョン管理にコミットしてはいけません:
{
"headers": {
"Authorization": "Bearer YOUR_SECRET_TOKEN"
}
}apifable.config.jsonと.apifable/auth.jsonの両方で、ヘッダー値内の${ENV_VAR}構文がサポートされています。
{
"headers": {
"Authorization": "Bearer ${MY_API_KEY}"
}
}ヘッダーの優先順位(高い順)
.apifable/auth.jsonのヘッダー(同名のキーを上書き)apifable.config.jsonのspec.headers
Claude Code
.mcp.jsonに以下を追加してください:
{
"mcpServers": {
"apifable": {
"command": "npx",
"args": ["-y", "apifable@latest", "mcp"]
}
}
}CursorやWindsurfなどの他のAIエージェントの場合も、同様の手順でapifableをMCPサーバーとして設定できます。
使用方法
APIを探索し、機能を構築するために使用できるプロンプトの例をいくつか紹介します。
APIの探索
List all APIsShow me APIs related to postsList APIs under the Post tagShow me the API details for post commentsShow me the API details for GET /posts/{id}/commentsShow me the API details for postComments機能の構築
Implement the post comments feature
Post page: src/pages/posts/[id].tsx
Related APIs:
- GET /posts/{id}/comments (list post comments)
- POST /posts/{id}/comments (create a post comment)[!TIP] 機能を構築するためのプロンプトを書く際は、関連するコンテキスト(ページパス、コンポーネントの場所、関連するAPI、従うべきパターンや例)を含めてください。
AIエージェントへのガイダンス
AIエージェントがapifableをより効果的に使用できるように、プロジェクトのAGENTS.mdに以下を追加してください:
## API Integration (apifable)
- Always use `get_endpoint` to verify the exact path, method, and parameters before writing integration code. Never assume.
- When presenting endpoint list data from apifable tools, display exactly these columns in order: `Method` (Uppercase), `Path`, `Summary`. Keep all values verbatim, including summary prefixes like `[ 32 - 001 ]`. Do not omit, rename, paraphrase, or add extra columns.
- When saving generated types, store them under `src/types/` and name files by domain (e.g., `src/types/auth.ts`, `src/types/user.ts`), not by OpenAPI tag names.上記は推奨される開始点です。エンドポイントリストの列や型フォルダーのパスは、プロジェクトに合わせて自由に調整してください。
MCPツールリファレンス
get_spec_info
APIのタイトル、バージョン、説明、サーバー、およびすべてのタグとエンドポイント数を返します。馴染みのない仕様の全体像を把握するために、ここから始めてください。
list_endpoints_by_tag
入力:
tag(string): フィルタリングするタグ名limit(number, optional): 返すエンドポイントの最大数offset(number, optional): スキップするエンドポイントの数(デフォルト: 0)
指定されたタグに属するすべてのエンドポイントを返します。レスポンスには、ページネーション用のtotal、offset、hasMoreフィールドが含まれます。結果が30件を超え、limitが指定されていない場合は警告が含まれます。
search_endpoints
入力:
query(string): 検索するキーワードtag(string, optional): 検索を特定のタグに制限するlimit(number, optional): 返す結果の最大数(デフォルト: 10)
operationId、パス、概要、説明に対するキーワード検索を行います。結果は関連度順にランク付けされます。完全一致が見つからない場合は、自動的にあいまい検索にフォールバックします。レスポンスにはmatchTypeフィールド("exact"または"fuzzy")が含まれます。あいまい検索の結果には、結果ごとにscoreフィールドも含まれます。
get_endpoint
入力(いずれかを選択):
method(string) +path(string): HTTPメソッドとエンドポイントパス(例:get+/users/{id})operationId(string): 操作ID(例:listUsers)
パラメーター、requestBody、レスポンスを含むエンドポイントオブジェクト全体を返します。サポートされている内部コンポーネントの$refはインラインで解決されます。
search_schemas
入力:
query(string): 検索するキーワードlimit(number, optional): 返す結果の最大数(デフォルト: 10)
スキーマ名と説明に対するキーワード検索を行います。結果は関連度順にランク付けされます。完全一致が見つからない場合は、自動的にあいまい検索にフォールバックします。レスポンスにはmatchTypeフィールド("exact"または"fuzzy")が含まれます。あいまい検索の結果には、結果ごとにscoreフィールドも含まれます。結果が空の場合、次のステップへのガイダンスを含むmessageフィールドが含まれることがあります。
get_schema
入力:
name(string):components/schemas内のスキーマ名
サポートされている内部コンポーネントの$refが解決されたスキーマ全体を返します。
get_types
入力(いずれかのモードを選択):
schemas(string[]):components/schemas内のスキーマ名の配列method(string) +path(string): HTTPメソッドとエンドポイントパスoperationId(string): 操作ID(例:listUsers)
自己完結型のTypeScript宣言をコードテキストとして生成します。エンドポイントモードでは、スキーマの依存関係を収集する前に、サポートされている内部コンポーネントの$refを追跡します。推移的な依存関係を自動的に含め、import文は含めません。
モードのルール:
1回の呼び出しにつき、必ず1つのモードを使用してください:
schemas、method+path、またはoperationId同じ呼び出し内でモードを混在させないでください
制限事項
外部の
$ref(他のファイルやURLへの参照など)はサポートされていません。OpenAPI 2.0 (Swagger) はサポートされていません。OpenAPI 3.0および3.1仕様のみがサポートされています。
スポンサー
このパッケージが役に立ったと感じた場合は、私の活動を支援するためにスポンサーになることを検討してください〜。あなたのアイコンが私の主要プロジェクトに表示されます。
クレジット
@reapi/mcp-openapi — インスピレーションの源
ライセンス
Star History
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityDmaintenanceA Model Context Protocol server that loads multiple OpenAPI specifications and exposes them to LLM-powered IDE integrations, enabling AI to understand and work with your APIs directly in development tools like Cursor.72090MIT
- AlicenseAqualityDmaintenanceAn MCP server that provides tools for exploring large OpenAPI schemas without loading entire schemas into LLM context. Perfect for discovering and analyzing endpoints, data models, and API structure efficiently.914MIT
- AlicenseBqualityCmaintenanceMCP server that enables AI assistants to explore and generate code for type-safe OpenAPI clients from various cloud APIs like DigitalOcean, Hetzner Cloud, and Ory.7818MIT
- AlicenseAqualityDmaintenanceA TypeScript-based MCP server that integrates with Swagger/OpenAPI specifications to expose API endpoints as tools for Large Language Models (LLMs), enabling natural language interaction with any OpenAPI-compliant API.49MIT
Related MCP Connectors
MCP server for AI access to Swagger by SmartBear.
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ycs77/apifable'
If you have feedback or need assistance with the MCP directory API, please join our Discord server