← Back to Home

Usage Guide

This guide covers how to run and configure `mcpproxy` using command-line arguments and environment variables.

Command-Line Options

The `mcpproxy` executable supports several flags to customize its behavior. You can view all options by running with the --help flag.


./mcpproxy --help
      

Key Arguments:

  • --config, -c: Specifies the path to your configuration file.
  • --listen, -l: Sets the listen address for the proxy server (e.g., :8080).
  • --data-dir, -d: Defines the path to the data directory for storing configuration, logs, and the search index. The default is ~/.mcpproxy.
  • --tray: Enables or disables the system tray icon (true or false). Defaults to true.
  • --log-level: Sets the logging level. Options are debug, info, warn, or error.

Security Flags

These flags allow you to run the proxy in a more restrictive environment:

  • --read-only: Enables read-only mode. In this mode, `mcpproxy` will not allow any changes, such as adding or removing servers.
  • --disable-management: Disables the `upstream_servers` management tool entirely.
  • --allow-server-add: Explicitly allows or disallows adding new servers (default: true).
  • --allow-server-remove: Explicitly allows or disallows removing servers (default: true).

Environment Variables

You can also configure `mcpproxy` using environment variables. These will be overridden by command-line flags if both are provided.

  • MCPPROXY_LISTEN: Overrides the listen address.
  • MCPPROXY_TRAY: Overrides the tray setting.
  • MCPPROXY_DATA_DIR: Overrides the data directory path.

export MCPPROXY_LISTEN=:9000
export MCPPROXY_TRAY=false
./mcpproxy
      

Data and Logs

Data Directory

By default, `mcpproxy` stores all its data in the ~/.mcpproxy directory. This includes:

  • mcp_config.json: The main configuration file for your upstream servers.
  • data.bolt: A BoltDB database for storing tool statistics and metadata.
  • index.bleve/: The Bleve search index directory.
  • mcpproxy.log: The log file (if file logging is enabled).

Logging

Logging is configured within your configuration file. You can control the log level, output (console, file, or both), and log rotation policies.