MeshLib C++ Docs
Loading...
Searching...
No Matches
MR::McpSettings Namespace Reference

Those functions act on the default MCP settings in the config file. More...

Classes

struct  CmdLineOverrides

Functions

CmdLineOverrides parseCmdLineOverrides (const std::vector< std::string > &commandArgs)
int getPort ()
void setPort (int port)
bool getEnableByDefault ()
 Returns whether the MCP server should start on program startup, according to the config file.
void setEnableByDefault (bool enable)
 Sets whether the MCP server should start on program startup, in the config file.
void applyToServer ()
bool isPortLockedFromCmdLine ()

Detailed Description

Those functions act on the default MCP settings in the config file.

Function Documentation

◆ applyToServer()

void MR::McpSettings::applyToServer ( )

Sends those settings to the MCP server. This restarts it if necessary, e.g. to update the port. This ignores getEnableByDefault().

◆ getEnableByDefault()

bool MR::McpSettings::getEnableByDefault ( )
nodiscard

Returns whether the MCP server should start on program startup, according to the config file.

◆ getPort()

int MR::McpSettings::getPort ( )
nodiscard

Returns the MCP port from the config file, or the default value. Note that this acts on the config file and not on the actual MCP server that might be running.

◆ isPortLockedFromCmdLine()

bool MR::McpSettings::isPortLockedFromCmdLine ( )
nodiscard

True iff -mcpPort N was passed on the command line. The config-backed port is then ignored for this session, and the GUI shows the port read-only.

◆ parseCmdLineOverrides()

CmdLineOverrides MR::McpSettings::parseCmdLineOverrides ( const std::vector< std::string > & commandArgs)
nodiscard

Pure parse: scans commandArgs for MCP-related flags and returns the resolved overrides. Last occurrence of each flag wins (matches shell convention). -mcpPort N forces the server port to N (overriding the config). -mcpDumpFile <path> requests writing the tool cache to that path; the caller (typically ViewerSetup::setupMcp) is expected to skip starting the live server in that case so a prime spawn does not collide with a real backend on the port.

◆ setEnableByDefault()

void MR::McpSettings::setEnableByDefault ( bool enable)

Sets whether the MCP server should start on program startup, in the config file.

◆ setPort()

void MR::McpSettings::setPort ( int port)

Sets the MCP port in the config. Note that this acts on the config file and not on the actual MCP server that might be running.