MapInfo Pro

 View Only

MapInfo Monday: Controlling MapInfo Pro from Claude Desktop

  • 1.  MapInfo Monday: Controlling MapInfo Pro from Claude Desktop

    Employee
    Posted an hour ago
    Edited by Peter Møller an hour ago

    MapInfo AI lets you control actions in MapInfo Pro using plain language in a chat interface embedded within MapInfo Pro. You connect MapInfo AI to your favorite AI via an API.

    Behind the scenes, MapInfo AI uses an MCP interface. This interface also allows you to control MapInfo Pro from an external chat application, such as Claude Desktop.

    In this article, I will help you configure Claude Desktop to connect to and leverage MapInfo Pro. This opens up a new way of interacting with MapInfo Pro - combining desktop GIS with external AI-powered workflows.

    First, we will review the prerequisites. Then, we configure Claude Desktop to connect to MapInfo AI. Finally, we will send commands to MapInfo Pro from Claude Desktop.

    Happy #MapInfoMonday!

    Prerequisites

    You already have MapInfo Pro v2023 or newer, and the MapInfo AI add-in installed.

    We need to install Node.js on our computer.

    Node.js allows you to run JavaScript outside of your web browser. We use it here to connect Claude Desktop to MapInfo AI - specifically the MCP server behind it.

    You can download Node.js from this site: nodejs.org/en/download

    Run the installer after you download it.

    That's the first step.

    Configuring Claude Desktop

    Now we only need to configure a new MCP server connection in Claude Desktop, and we'll be ready to use the connection between Claude Desktop and MapInfo Pro.

    To configure an MCP server, we need to modify the file claude_desktop_config.json. You can find this file here: %localappdata%\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude.

    The path may vary on your machine, as it contains environment-specific characters.

    You can start by going to this path in File Explorer: %localappdata%\Packages, and then go to these subfolders: Claude<additional character>, LocalCache, Roaming, and Claude

    Now right-click on the file claude_desktop_config.json, and open it in your text editor.

    We need to add the following lines to this file:

      "mcpServers": {
        "mapinfo-pro": {
          "command": "C:\\Program Files\\nodejs\\npx.cmd",
          "args": [
            "mcp-remote",
            "http://localhost:3100/sse"
          ]
        }
      },
    
    image
    The path to npx.cmd must match where you installed Node.js.
    Save the config file, and shut down Claude Desktop. You also have to end the additional background processes that Claude is running. You can close them through the Task Manager.
    image
    In plain English, this setting tells Claude Desktop that when it needs to communicate with MapInfo Pro, it should launch a Node.js bridge that connects to a MapInfo Pro server already running on this machine at port 3100.
    This also means that MapInfo Pro must be running with the MapInfo AI add-in loaded. Claude Desktop will not start MapInfo Pro.

    Controlling MapInfo Pro from Claude Desktop

    Now we can leverage MapInfo Pro from Claude Desktop.
    Let's start with a simple command: what tables are currently open in MapInfo Pro
    image
    This makes sense as I have only launched MapInfo Pro and the MapInfo AI add-in. I hadn't opened any tables.
    I open a simple workspace and rerun the initial command. Now Claude can see the tables and list them with some details.
    image
    I now try to ask Claude to create a layout: Create a new layout with the existing map. Add some descriptive about the project text to the layout.
    You will get asked by Claude for permission to execute commands in MapInfo Pro.
    image
    In MapInfo Pro, the layout looks like this. I repositioned some elements because their positions aren't always ideal. This is something we need to improve.
    image
    Only one legend was added to the layout. I'll ask Claude to add the missing layers to the legend: Can you add the missing legends? I only see one legend without a description.
    image
    And the resulting layout in MapInfo Pro
    image
    I hope this provides guidance on using MapInfo AI outside MapInfo Pro. It's an alternative way to use MapInfo AI if you don't have direct API access to an AI.



    ------------------------------
    Peter Horsbøll Møller
    Principal Presales Consultant | Distinguished Engineer
    Precisely | Trust in Data
    ------------------------------