API Agent
Universal MCP server for GraphQL/REST APIs
What is API Agent?
API Agent is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to universal mcp server for graphql/rest apis
Universal MCP server for GraphQL/REST APIs
This server falls under the APIs category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Universal MCP server for GraphQL/REST APIs
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx api-agentConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use API Agent
API Agent is a universal MCP server for GraphQL and REST APIs, developed by Agoda, that lets AI agents query any API using natural language. It performs automatic schema introspection, translates natural language questions into the appropriate GraphQL queries or REST calls, and executes post-processing operations like filtering, ranking, and cross-endpoint JOINs using embedded DuckDB SQL. Teams use it to give AI assistants live access to internal or external APIs without needing to write custom tool definitions for each endpoint.
Prerequisites
- Python 3.10+ and uv package manager installed
- An OpenAI API key (required for the LLM that translates natural language to API queries)
- Network access to the GraphQL or REST API endpoints you want to expose
- Git for cloning the repository (or use uvx for a no-clone install)
- An MCP-compatible client such as Claude Desktop or Cursor
Run API Agent directly with uvx (no clone needed)
The quickest way to start API Agent is to run it directly from GitHub using uvx, passing your OpenAI API key as an environment variable.
OPENAI_API_KEY=your_key uvx --from git+https://github.com/agoda-com/api-agent api-agent(Alternative) Clone and install
Clone the repository and install dependencies using uv sync for a local development setup.
git clone https://github.com/agoda-com/api-agent.git
cd api-agent
uv sync(Alternative) Run with Docker
Build and run API Agent as a Docker container, exposing port 3000.
git clone https://github.com/agoda-com/api-agent
docker build -t api-agent .
docker run -p 3000:3000 -e OPENAI_API_KEY=your_key api-agentConfigure environment variables
Set required and optional environment variables to control model selection, server port, and recipe caching behavior.
export OPENAI_API_KEY=your_key
export API_AGENT_MODEL_NAME=gpt-4o # optional, defaults to gpt-5.2
export API_AGENT_PORT=3000 # optional, default 3000
export API_AGENT_ENABLE_RECIPES=true # optional, enables query caching
export API_AGENT_RECIPE_CACHE_SIZE=64 # optional, max cached recipesAdd to your MCP client configuration
Add API Agent to your MCP client config so AI assistants can access it as a tool. Each connected API gets a {prefix}_query and {prefix}_execute tool automatically.
{
"mcpServers": {
"api-agent": {
"command": "uvx",
"args": ["--from", "git+https://github.com/agoda-com/api-agent", "api-agent"],
"env": {
"OPENAI_API_KEY": "your_key",
"API_AGENT_MODEL_NAME": "gpt-4o",
"API_AGENT_PORT": "3000"
}
}
}
}API Agent Examples
Client configuration
Complete MCP client configuration for API Agent using uvx, with OpenAI key and optional model override.
{
"mcpServers": {
"api-agent": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/agoda-com/api-agent",
"api-agent"
],
"env": {
"OPENAI_API_KEY": "sk-your-openai-key",
"API_AGENT_MODEL_NAME": "gpt-4o",
"API_AGENT_ENABLE_RECIPES": "true"
}
}
}
}Prompts to try
Once connected, point API Agent at an API endpoint and ask questions in plain English.
- "Query the GitHub GraphQL API: what are the top 10 most starred JavaScript repos?"
- "Call the REST endpoint /api/v1/products and find the top 5 by revenue"
- "Join data from /users and /orders endpoints to show total spending per user"
- "What tools are available from the API agent and which API endpoints do they cover?"
- "Re-run the last successful query using the cached recipe for faster results"Troubleshooting API Agent
API introspection fails or returns empty tool list
Ensure the target GraphQL API exposes an introspection endpoint (some APIs disable this in production). For REST APIs, verify the OpenAPI/Swagger schema URL is accessible. Check that OPENAI_API_KEY is valid and has sufficient quota.
Natural language queries return incorrect or partial results
Enable recipe caching (API_AGENT_ENABLE_RECIPES=true) so successful queries are reused. Use the {prefix}_execute tool for direct control over the exact query or HTTP method when the natural language translation is imprecise.
DuckDB JOIN operations fail across endpoints
Cross-endpoint JOINs require both endpoints to return data in a tabular format that DuckDB can process. Ensure both API responses return arrays of objects with consistent field names that can be used as JOIN keys.
Frequently Asked Questions about API Agent
What is API Agent?
API Agent is a Model Context Protocol (MCP) server that universal mcp server for graphql/rest apis It connects AI assistants to external tools and data sources through a standardized interface.
How do I install API Agent?
Follow the installation instructions on the API Agent GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with API Agent?
API Agent works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is API Agent free to use?
Yes, API Agent is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
API Agent Alternatives โ Similar APIs Servers
Looking for alternatives to API Agent? Here are other popular apis servers you can use with Claude, Cursor, and VS Code.
Kong
โ 43.4k๐ฆ The API and AI Gateway
API Mega List
โ 5.4kThis GitHub repo is a powerhouse collection of APIs you can start using immediately to build everything from simple automations to full-scale applications. One of the most valuable API lists on GitHubโperiod. ๐ช
Fetch
โ 5.4kFetch web content and convert to markdown for AI consumption
Fusio
โ 2.1kSelf-Hosted API Management for Builders
Korean Law
โ 1.8k๊ตญ๊ฐ๋ฒ๋ น์ ๋ณดMCP v4.0 | ๋ฒ์ ์ฒ 41๊ฐ API โ 17๊ฐ MCP ๋๊ตฌ. ๋ฒ๋ นยทํ๋กยท์กฐ๋ก ๊ฒ์ + LLM ํ๊ฐ ๋ฐฉ์ง ์ธ์ฉ๊ฒ์ฆ + ์กฐ๋ฌธ ์ํฅ ๊ทธ๋ํ(impact_map) + ์์ ๋น๊ต ์๋ diff(time_travel) + ์๋ฏผ 5๋จ๊ณ ์คํ ๊ฐ์ด๋(action_plan) | 41 Korean legal APIs โ 17 MCP tools
RuleGo
โ 1.5kโ๏ธRuleGo is a lightweight, high-performance, embedded, next-generation component orchestration rule engine framework for Go.
Browse More APIs MCP Servers
Explore all apis servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up API Agent in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use API Agent?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.