Build with AI

MCP Integration

Connect AI assistants like Claude to the Direct Travel API via MCP.

The Direct Travel API speaks the Model Context Protocol (MCP) — an open standard that lets AI assistants (like Claude, Cursor, or Windsurf) call the API as a "tool." Instead of writing code, you describe what you want in plain English and the assistant translates that into an API call.

With the MCP server, you can ask:

"Find me hotels near the Eiffel Tower under $200 per night"

...and the assistant calls the Direct Travel API, gets live results, and presents them — no code required.

Learn more about MCP at modelcontextprotocol.io.

Prerequisites

  1. An API key from hub.stay22.com (see Authentication)
  2. An MCP-compatible client (see setup below)

Setup

To connect an AI assistant to the Direct Travel API, provide it with the URL to the MCP server. Most MCP clients use a JSON configuration file where you define your connected servers.

The server URL is:

https://api.stay22.com/mcp/v2?key=<API_KEY>

Replace <API_KEY> with your actual key (see Authentication). See Server versions for the difference between /mcp/v2 and the deprecated /mcp.

Configuration Example

Add the server to your MCP client's configuration (often named claude_desktop_config.json, .mcp.json, or configured through the UI in clients like Cursor or Windsurf):

{
  "mcpServers": {
    "stay22": {
      "url": "https://api.stay22.com/mcp/v2?key=<API_KEY>",
      "transport": "http"
    }
  }
}

Note: Depending on your client, the transport type might need to be set to "sse" or "http" (the server uses an HTTP streamable transport). Refer to your client's documentation for exact configuration details.

Server versions

  • /mcp/v2 (current) — backed by the unified search; one search_accommodations call returns all suppliers per stay. Use this for new integrations.
  • /mcp (deprecated) — the legacy single-provider MCP server. Kept for backward compatibility; prefer /mcp/v2.

Available Tool

search_accommodations

Searches accommodations across the supported providers (booking, expedia, vrbo, and hotelscom).

This tool uses the exact same parameters and functionality as the standard REST endpoints. For a full list of available inputs (like location, dates, guests, and filters), see the API Reference.

Example Prompts

Once connected, you can simply interact with your AI assistant in natural language. Here are a few examples of what you can ask:

  • "Find hotels in Paris"
  • "Find VRBO rentals in NYC for a family, under $300 per night, with an 8+ rating"
  • "Show me hotels within 2km of the Eiffel Tower"
  • "Compare prices for a 4-star hotel in Tokyo across Booking and Expedia"

Rate Limits

MCP calls use the same API key as REST calls, so standard rate limits apply (5 req/min demo, 100 req/min with API key).

Tips

  • Be specific with location — "hotels near the Louvre in central Paris" works better than just "hotels"
  • Points of interest work — "Eiffel Tower", "Berliner Dom", "Times Square" are all valid locations
  • Include dates when relevant — omit them for a static (no-price) search
  • Try different providers — each provider has different inventory and pricing
  • Ask for comparisons — the AI can call the tool multiple times and compare results

Troubleshooting

The AI doesn't see the tool

  • Double-check your config JSON syntax (missing commas, wrong quotes)
  • Verify your API key is valid — test it with a cURL request first
  • Restart your AI client after changing the config

"Rate limit exceeded" errors

  • You've exceeded 100 requests/minute (or 5/minute in demo mode)
  • Wait 60 seconds and try again
  • Get an API key if you're in demo mode

No results returned

  • Try a broader location (city name instead of specific address)
  • Remove strict filters (high minguestrating, low max price)
  • Try a different provider — not all providers have inventory everywhere

"Invalid API key" error

  • Check that your key is correctly pasted in the config URL
  • Make sure there are no extra spaces or line breaks in the key
  • Generate a new key by following the Authentication guide

On this page