Add Flyte to your MCP client
Your assistant gets a search_flights tool, configured and tested with one real call.
Connect this project's MCP client to Flyte's flight search MCP server, so the assistant can search live flights as a tool call.
Facts about the Flyte API (all true today; do not assume anything beyond them):
- Base URL: https://api.flyteai.io. HTTPS only.
- Flyte is SEARCH ONLY. There is no booking, payment or ticketing endpoint or tool. Do not build or stub one. To book, the traveller goes to https://www.flyteai.io.
- API keys look like flyte_sk_... and are issued after approval at https://www.flyteai.io/request-access. The key is shown once. Read it from an environment variable named FLYTE_API_KEY. Never hard-code it, commit it, log it, or send it to a browser.
- A search is a live lookup and takes 30 to 120 seconds. Use a client timeout of at least 150 seconds.
- Adult passengers only. Fares move: never cache a result and show it later as a live price.
- Full reference: https://www.flyteai.io/api-docs
The MCP server:
- URL: https://api.flyteai.io/mcp (remote HTTP server, JSON-RPC 2.0 over POST, protocol revision 2025-06-18). It answers each POST with plain JSON, not an event stream, and issues no session id.
- Auth: header "Authorization: Bearer <FLYTE_API_KEY>". This header is required; x-api-key alone returns 401 here.
- Methods: initialize, tools/list, tools/call. Capabilities: tools only (no resources, no prompts).
- Exactly one tool, search_flights:
- query (string, required): the trip in plain language, e.g. "ORD to JFK on December 15th" or "cheapest flight to Miami next weekend". City names and relative dates work.
- conversation_id (string, optional): reuse the same id to refine a search ("make it business class"). If omitted, every call from the key shares one conversation, so pass a unique id per session, prefixed with something of your own.
- Result: { "content": [{ "type": "text", "text": "..." }], "isError": false }. The result is human-readable text, not structured fields.
- A failed search comes back as a normal result with "isError": true and an explanation in the text. Protocol mistakes come back inside HTTP 200 as JSON-RPC errors: -32700 bad JSON, -32600 jsonrpc is not "2.0", -32601 unknown method, -32602 unknown tool or missing query.
- HTTP 401 with {"detail": "..."} means the key is missing, invalid, revoked or expired. Do not retry a 401.
- /mcp is not rate limited today, but every call is a live search. Never call it in a loop or retry automatically more than once.
Do this:
1. Find the MCP config this project or client uses and add a remote HTTP server named "flyte" with the URL and the Authorization header above. The key must come from the FLYTE_API_KEY environment variable, not be pasted into a committed file. If the config format cannot read environment variables, put it in a local, gitignored config and say so.
2. Add one line to the assistant's instructions: "Flyte's search_flights only searches. Do not ask the user for passenger details, passport data or payment. To book, send them to https://www.flyteai.io."
3. Verify from a shell, with FLYTE_API_KEY exported:
curl -s -X POST https://api.flyteai.io/mcp \
-H "Authorization: Bearer $FLYTE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
It must list search_flights. Then run one tools/call:
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"search_flights","arguments":{"query":"ORD to JFK next Friday","conversation_id":"myapp-test-1"}}}'
Allow up to 150 seconds.
Done when: the client lists search_flights, one real search returns isError false with fares in the text, the key lives only in the environment or a gitignored file, and nothing in the change offers to book or pay. If you do not have a key yet, stop after step 2 and tell me to request one at https://www.flyteai.io/request-access.