Troubleshooting MCP connections

From SweepMe! Wiki
Jump to navigation Jump to search

This page helps if an AI application cannot connect to the SweepMe! MCP server or if its tools do not work as expected. The setup of the applications is described in AI applications.

Check that the MCP server is running

  • Open "Tools" → "Interfaces" and check that MCPserver is started. If the menu entry cannot be used, a SweepMe! Pro license is required for the interfaces.
  • Open the URL of the server, e.g. http://localhost:8082/mcp, in a web browser on the same computer. If the browser shows an empty page or reports the HTTP error 405 (Method Not Allowed), the server is running and reachable. AI applications use POST requests, which the browser does not send. If the browser cannot connect at all, the server is not running or uses another host or port.
  • If you want the server to be available whenever SweepMe! runs, set it to start automatically in the Interfaces dialog.

The port is already in use

When the server cannot be started, SweepMe! shows a message:

  • "Port 8082 is already used by another SweepMe! instance": another SweepMe! instance already serves this port, and AI applications talk to that instance. Close the other instance or choose another port. An assistant can check which instance it controls with the tool get_instance_info.
  • "Port 8082 is already used by the program ...": choose another port in the Interfaces dialog and change the URL in your AI application accordingly.

The AI application cannot reach the server

  • Cloud connectors: Custom connectors in Claude and apps in ChatGPT on the web connect from the cloud of the provider and cannot reach your computer. Use a desktop application, see Choosing an AI application.
  • Another computer: With the host localhost, only applications on the same computer can connect. To connect from another computer, select the network address of the computer as host and allow the port in the Windows firewall. Only do this in a trusted network, because the server has no authentication.
  • Docker: Inside a container, localhost means the container itself. Use http://host.docker.internal:8082/mcp, and make sure that the SweepMe! MCP server listens on an address that the container can reach. LibreChat additionally blocks local addresses unless they are listed under allowedAddresses, see LibreChat.
  • Error 403 "origin not allowed": The request came from a web page of another website. For security reasons, SweepMe! only accepts such requests from pages on localhost or on the host of the server. Use a desktop application or command line tool.

Claude Desktop does not show the server

  • Claude Desktop starts the bridge mcp-remote with npx, which requires Node.js. Install the LTS version and restart the computer if npx is not found.
  • Check that claude_desktop_config.json is valid JSON, e.g. no missing comma or bracket.
  • Quit Claude Desktop completely, also in the system tray, and start it again.
  • The log files are in %APPDATA%\Claude\logs (files starting with mcp).

The tools do not appear in the AI application

  • Restart the application or refresh its list of MCP servers after changing the configuration.
  • Some applications require that the server is switched on or trusted first, e.g. the toggle in Cursor or the trust prompt in VS Code.
  • Check that the transport is set to streamable HTTP. Some applications fall back to the older SSE transport if no type is given, which SweepMe! does not support.

The assistant does not use the tools well

  • The language model must support tool calling. Small local models often call tools less reliably than large models. Try a larger model or one that is advertised for tool use.
  • Tell the assistant which sequence to load, with the full file path, and what to measure.
  • Measurement parameters and commands depend on the loaded sequence. Load the sequence first, then ask the assistant to list the parameters.

A tool returns an error

  • load_sequence, set_driver_version, set_module_version or close_sweepme fail: these tools are only possible while no measurement is running. Stop or wait for the run first.
  • load_sequence cannot find the file: use the full file path of the .seq or .set file.
  • Errors during a run: ask the assistant to call get_debug_log, or open the Debug widget (F2). The file debug.log is in the public SweepMe! folder, see Folder system and Debugging.

See also