AC

agoda-com/api-agent

API development

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

299 stars 44 forks 품질 83 트렌드 33MIT

agoda-com/api-agent는 [[T0]에서 가져온 MCP 서버 후보입니다.

개요

agoda-com/api-agent는 [[T0]에서 가져온 MCP 서버 후보입니다.

개요(AI 번역)

어떤 API든 MCP 서버로 전환하세요. 영어로 쿼리하세요. API가 할 수 없어도 결과를 얻을 수 있습니다.

GraphQL이나 REST API를 가리키세요. 자연어로 질문하세요. 에이전트는 데이터를 가져오고 DuckDB에 저장하며 SQL 후처리를 실행합니다. 순위 매김, 필터, 반환된 데이터를 통한 결합은 API가 지원하지 않아도 작동합니다.

무엇이 다른지

** 🎯 설정이 0.** API당 커스텀 MCP 코드는 없습니다. GraphQL 엔드포인트, OpenAPI 3.x 사양, 또는 Swagger 2.0 사양을 가리키세요. 에이전트가 자동으로 스키마를 점검/로드합니다.

** ✨ SQL 후처리. ** API가 10,000개의 정렬되지 않은 행을 반환하나요? 에이전트가 상위 10위 안에 들고, GROUP BY는 없나요? 에이전트 집계. 반환된 테이블을 조인해야 하나요? 에이전트가 결합합니다. 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" } } } }