Set up Qt Creator MCP server

Qt Creator supports the model context protocol (MCP) to let AI assistants control it for debugging, building, and managing projects.

The server exposes tools for:

  • Building, running, and debugging projects
  • Navigating C++ code: listing the symbols or diagnostics of a file, searching for symbols across the project, finding references, going to declarations and definitions, showing type and call hierarchies, finding the overrides of a virtual function, and getting code completions or quick-fixes at a position
  • Renaming a C++ symbol across the project
  • Inspecting Git repositories: status, log, diff, and blame
  • Reading, writing, and searching files, also on remote devices

The MCP client shows the tools that are currently available, along with a description of each.

To start the MCP server and use an MCP client, install a client and activate the MCP server extension.

View MCP server status

Qt Creator starts the MCP server when you activate the Qt Creator MCP server extension. The server runs on the computer and accepts connections on an automatically set port.

To view the MCP server status and to change the IP address and port number, go to Preferences > AI > Qt Creator MCP Server.

Qt Creator MCP Server in the AI Preferences

The following table summarizes the preferences.

SettingValue
Enable MCP ServerTurns the MCP server on and off.
Listen onSets the server address for the MCP server to listen on.
PortSets the port for the MCP server to listen on. Automatic automatically selects a free port, but you can also set a fixed port number.
Enable cross-origin accessTurns on cross-origin resource sharing (CORS), which you need to connect to the server from a web application.

Use MCP clients

When you enable the ACP Client extension and use an ACP client in Qt Creator, it uses the MCP server automatically.

To use the MCP server for other products, such as Claude Code, you must configure it. For more information, see the documentation of the product.

Inspect client communication

To inspect the communication between MCP clients and the Qt Creator MCP server, go to Tools > Debug Qt Creator > Inspect MCP Servers.

MCP Server Inspector dialog

In Session, select a session between an MPC client and server, or Global to show general messages.

In Client Message, select a message to view more information in Server Message.

To remove old entries, select Clear.

To save messages as a file, select Save.

See also Activate extensions and How to: Use AI.