Get the FREE Ultimate OpenClaw Setup Guide →

api-agent

Universal MCP server for GraphQL/REST APIs

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio agoda-com-api-agent uvx --from git+https://github.com/agoda-com/api-agent api-agent \
  --env OPENAI_API_KEY="your_openai_api_key"

How to use

API Agent turns any GraphQL or REST API into an MCP server that can be queried in natural language. It introspects the API schema, then executes user questions by generating targeted queries, performing SQL-style post-processing (ranking, filtering, joins) on the retrieved data, and caching successful query pipelines for reuse. This enables capabilities like selecting top results, aggregations, and cross-endpoint joins even when the underlying API lacks native support. To use it, run the server through uvx (Python) or your chosen deployment method, point an MCP client at the server, and configure headers to specify the target API via X-Target-URL and X-API-Type. Tools exposed by the server include per-API core tools named after the API prefix (e.g., <prefix>_query and <prefix>_execute) as well as dynamic recipe tools once learned.

How to install

Prerequisites:

  • Python 3.11+ installed on your system
  • Access to the internet to fetch dependencies
  • An OpenAI API key or compatible LLM provider key
  1. Install Python dependencies (recommended in a virtual environment):
  • python -m venv venv
  • source venv/bin/activate # on macOS/Linux
  • .\venv\Scripts\activate # on Windows
  • pip install uvx openai
  1. Clone or obtain the API Agent package:
  1. Run directly via uvx (example with environment variable):
  1. Alternative: use Docker (build and run):
  1. For MCP clients, prepare an MCP configuration JSON referencing the server endpoint and required headers (see README for header examples).

Additional notes

Tips and caveats:

  • The API Agent operates in read-only mode by default; mutations are blocked unless explicitly allowed via configuration.
  • Ensure X-Target-URL points to the GraphQL endpoint or OpenAPI spec and X-API-Type is either graphql or rest.
  • If you need advanced query capabilities, you can rely on SQL post-processing to perform rankings, filters, and JOINs across multiple endpoints.
  • The system caches successful recipes and queries to accelerate future requests; monitor and manage cached pipelines as needed.
  • When using tokens or credentials, securely pass them via X-Target-Headers rather than embedding in headers directly.

Related MCP Servers

Sponsor this space

Reach thousands of developers