AC

agoda-com/api-agent

API development

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

298 stars 44 forks 品質 83 トレンド 33MIT

agoda-com/api-agentは、https://github.com/agoda-com/api-agent.からインポートされたMCPサーバー候補です。

概要

agoda-com/api-agentは、https://github.com/agoda-com/api-agent.からインポートされたMCPサーバー候補です。

概要(AI 翻訳)

どんなAPIでもMCPサーバーに変換してください。英語でクエリを出してください。APIができなくても結果を得られます。

任意のGraphQLやREST APIを指さしてください。自然言語で質問をしてください。エージェントはデータを取得し、DuckDBに保存し、SQLの後処理を実行します。ランキング、フィルター、返還されたデータへの結合は、たとえAPIがサポートしていなくても機能します。

何が違うのか

** 🎯 設定はゼロ。API ごとにカスタムMCPコードはありません。GraphQLエンドポイント、OpenAPI 3.x仕様、またはSwagger 2.0仕様を指してください。エージェントはスキーマを自動的に内省・読み込みます。

** ✨ SQLの後処理。** APIが1万行の未ソート行を返す?エージェントはトップ10にランクイン。グループ別は?エージェントの集約。戻ったテーブルを結合する必要がある?エージェントは結合します。APIはサポートする必要はなく、エージェントがサポートします。

** 🔒 デフォルトで安全。** 読み取り専用。突然変異は明示的に許可されていない限りブロックされます。

** 🧠 レシピ学習。** エージェントは成功したクエリを再利用可能なワークフローにサンプル化します。一度質問すれば、LLMの推論なしに実行されるキャッシュパイプラインを再利用します。学習済みのレシピはr_ というツールとして公開されます。

クイックスタート

1.走れ:

環境でOpenAIの秘密を設定する:

直接実行 uvx は API_AGENT_CONFIG を指し示さない限り、内蔵のデフォルトを使用します TOMLファイル。

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

API Agent

Turn any API into an MCP server. Query in English. Get results even when the API can’t.

Point at any GraphQL or REST API. Ask questions in natural language. The agent fetches data, stores it in DuckDB, and runs SQL post-processing. Rankings, filters, and joins over returned data work even if the API doesn’t support them.

What Makes It Different

🎯 Zero config. No custom MCP code per API. Point at a GraphQL endpoint, OpenAPI 3.x spec, or Swagger 2.0 spec. The agent introspects/loads schema automatically.

✨ SQL post-processing. API returns 10,000 unsorted rows? Agent ranks top 10. No GROUP BY? Agent aggregates. Need to join returned tables? Agent combines. The API doesn’t need to support it—the agent does.

🔒 Safe by default. Read-only. Mutations blocked unless explicitly allowed.

SQL runs sandboxed: no file, network, or extension access. REST calls stay under the API base URL; GraphQL allows only query operations. Recipes are scoped per target and credentials. Report vulnerabilities via SECURITY.md.

🧠 Recipe learning. Agent samples successful queries into reusable workflows. Ask once, reuse cached pipelines that execute without LLM reasoning. Learned recipes are exposed as tools named r_.

Quick Start

1. Run:

# Direct run (no clone needed)
OPENAI_API_KEY=your_key uvx --from git+https://github.com/agoda-com/api-agent api-agent

# Or clone
git clone https://github.com/agoda-com/api-agent.git && cd api-agent
uv sync --group dev

Set the OpenAI secret in env:

export OPENAI_API_KEY=your_key

Direct uvx runs use built-in defaults unless API_AGENT_CONFIG points to a TOML file. A cloned checkout uses api-agent.toml from the repository root by default.

2. Start local clone:

uv run api-agent

# Or Docker
docker build -t api-agent .
docker run -p 3000:3000 -e OPENAI_API_KEY=your_key api-agent

3. Add to any MCP client:

{
  "mcpServers": {
    "rickandmorty": {
      "url": "http://localhost:3000/mcp",
      "headers": {
        "X-Target-URL": "https://rickandmortyapi.com/graphql",
        "X-API-Type": "graphql"
      }
    }
  }
}

4. Ask questions:

  • “Show characters from Earth, only alive ones, group by species”
  • “Top 10 characters by episode count”
  • “Compare alive vs dead by species, only species with 10+ characters”

That’s it. Agent introspects schema, generates calls, runs SQL post-processing.

More Examples

REST API (Petstore):

{
  "mcpServers": {
    "petstore": {
      "url": "http://localhost:3000/mcp",
      "headers": {
        "X-Target-URL": "https://petstore3.swagger.io/api/v3/openapi.json",
        "X-API-Type": "rest"
      }
    }
  }
}

Your own API with auth:

{
  "mcpServers": {
    "myapi": {
      "url": "http://localhost:3000/mcp",
      "headers": {
        "X-Target-URL": "https://api.example.com/graphql",
        "X-API-Type": "graphql",
GitHub で README 全文を見る

インストール

docker run -p 3000:3000 -e OPENAI_API_KEY=your_key api-agent
MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "rickandmorty": { "url": "http://localhost:3000/mcp", "headers": { "X-Target-URL": "https://rickandmortyapi.com/graphql", "X-API-Type": "graphql" } } } }