keepcalculator

06 Numbers and Powers

Fix Hotel Search MCP Setup in Claude, Cursor, or Cline

Card No. 06·20636 · Updated · Standard formula, shown below

If your hotel search MCP server isn’t connecting in Claude, Cursor, or Cline, the fix is almost always a configuration mismatch in the MCP client settings or a missing environment variable. This article walks you through the exact steps to diagnose and fix the setup in all three tools, plus common pitfalls and how to avoid them.

What Is an MCP Server and Why Hotel Search Fails

MCP (Model Context Protocol) is an open standard that lets AI assistants like Claude, Cursor, and Cline connect to external tools—here, a hotel search API. The MCP server acts as a bridge: your AI sends a request in a structured format, the server translates it to the hotel API (like Booking.com or Expedia), and returns results. When setup fails, it’s usually because the client can’t find the server executable, the server can’t authenticate with the hotel API, or the API key is missing or invalid.

Prerequisites: What You Need Before Starting

  • Node.js (v18 or later) or Python 3.9+ installed, depending on your MCP server package.
  • The MCP server package installed globally or locally (e.g., @some/hotel-mcp on npm).
  • An API key from the hotel data provider (e.g., SerpApi, Amadeus, or a custom endpoint).
  • Access to the configuration file for your AI tool (JSON or TOML format).

Step-by-Step Fix for Claude Desktop

  1. Open Claude Desktop and go to Settings → Developer → Edit Config.
  2. Locate the claude_desktop_config.json file. If it doesn’t exist, create it in the proper directory (e.g., %APPDATA%\Claude\ on Windows, ~/Library/Application Support/Claude/ on macOS).
  3. Add your MCP server under the mcpServers key. Example:
    {
      "mcpServers": {
        "hotel-search": {
          "command": "npx",
          "args": ["-y", "@some/hotel-mcp"],
          "env": {
            "HOTEL_API_KEY": "your_api_key_here"
          }
        }
      }
    }
  4. Save the file and restart Claude Desktop completely (not just the window).
  5. Test by asking: “Search for hotels in Paris for next week.” If it fails, check the logs in View → Developer → Console for error messages.

Step-by-Step Fix for Cursor

Cursor uses a different configuration format. Instead of a JSON file, you use a .cursor/mcp.json file in your project root.

  1. Create a folder named .cursor in your project directory if it doesn’t exist.
  2. Inside it, create a file named mcp.json.
  3. Add the server configuration. Cursor supports both command and url types. For a local Node server:
    {
      "mcpServers": {
        "hotel-search": {
          "command": "npx",
          "args": ["-y", "@some/hotel-mcp"],
          "env": {
            "HOTEL_API_KEY": "your_api_key_here"
          }
        }
      }
    }
  4. In Cursor, open the command palette (Ctrl+Shift+P) and run MCP: Reload Project.
  5. Check the MCP panel (usually at the bottom right) to see if the server shows as connected. If not, verify the path to npx is correct by running which npx in your terminal.

Step-by-Step Fix for Cline (VS Code Extension)

Cline is a VS Code extension that also uses MCP. Its configuration is stored in a global settings file.

  1. Open VS Code and go to Settings (Ctrl+,).
  2. Search for Cline: MCP Servers and click Edit in settings.json.
  3. Add the server configuration under the cline.mcpServers key. Example:
    {
      "cline.mcpServers": {
        "hotel-search": {
          "command": "npx",
        "args": ["-y", "@some/hotel-mcp"],
          "env": {
            "HOTEL_API_KEY": "your_api_key_here"
          }
        }
      }
    }
  4. Save the file and reload the VS Code window (Ctrl+Shift+P → Developer: Reload Window).
  5. Open the Cline panel, and you should see the hotel-search server listed. Click the refresh icon if it doesn’t appear.

Common Configuration Mistakes and How to Avoid Them

  • Wrong command path: If you’re using npx, ensure it’s in your PATH. On Windows, you might need to use cmd /c npx as the command.
  • Missing environment variables: The hotel API key must be passed via the env field. Some servers require additional vars like HOTEL_API_BASE_URL.
  • Using a URL instead of a local command: If your MCP server is remote, you need to use "type": "http" and a url field, not command.
  • Not restarting the client: Changes to config files often require a full restart of the app, not just a reload.
  • Version mismatch: The MCP server package may require a newer version of Node.js. Check the package’s documentation for requirements.

Testing Your Setup and Verifying It Works

After configuring, test with a simple prompt like: “List hotels in London for tomorrow.” If the AI responds with a list, you’re good. If it says it can’t reach the server, check the client’s logs. In Claude, press Ctrl+Shift+I to open the developer console and look for errors. In Cursor, use the MCP panel’s debug output. In Cline, the panel shows the server’s status and any error messages.

Alternatives and Fallback Approaches

If the MCP server still fails, consider these alternatives:

  • Use a different MCP server package: There are multiple hotel search MCP servers on npm and PyPI. Try another one that might be more stable.
  • Run the server manually: Start the MCP server in a terminal with npx @some/hotel-mcp and see if it prints any errors. This isolates the issue to the server itself.
  • Use a custom script: If you have programming skills, write a simple MCP server that calls the hotel API directly. This gives you full control.
  • Fallback to a non-MCP approach: In Cursor or Cline, you can use a regular API call via a custom tool or a plugin that doesn’t rely on MCP.

Frequently Asked Questions

Why does my MCP server show as “not connected” in Cursor?

This usually means the server process failed to start. Check the path to the command, ensure the package is installed, and verify the environment variables are set. Also, make sure you’ve run MCP: Reload Project after editing the config.

Do I need a separate API key for each AI tool?

No, the same API key works across all tools as long as you pass it in the env field of each configuration. Just copy the key into each tool’s config file.

Can I use a remote MCP server instead of a local one?

Yes, if your hotel search MCP server is hosted remotely, you can specify a URL in the config. For example, in Cursor, use "type": "http", "url": "https://example.com/mcp". However, this requires the server to support CORS and authentication.

What if the MCP server works in Claude but not in Cline?

This is often due to differences in how each tool handles environment variables or the working directory. In Cline, try setting the cwd property to the directory where your project files are, or use absolute paths for the command and args.

How do I update the MCP server to a newer version?

For npm-based servers, run npm update -g @some/hotel-mcp to update globally. Then restart your AI tool. If you’re using npx -y, it will automatically fetch the latest version each time, but you may need to clear the npx cache with npm cache clean --force.

Is there a way to debug MCP without using the AI tool?

Yes, you can use the MCP Inspector tool (if available) or run the server in a terminal with verbose logging. Many MCP servers support a --debug flag. This lets you see the raw JSON-RPC messages and identify where the failure occurs.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →