### Example OAuth Server Configurations (Go)
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/docs/oauthserver_testing.md
Provides example Go commands for starting the OAuth test server with specific configurations. These examples cover minimal setups, long-lived tokens, strict resource indicator enforcement, Runlayer compatibility, and error handling tests.
```bash
# Minimal OAuth Server
go run ./tests/oauthserver/cmd/server -port 9000 \
-no-dcr \
-no-device-code \
-no-client-credentials
# Long-Lived Tokens for Development
go run ./tests/oauthserver/cmd/server -port 9000 \
-access-token-ttl=24h \
-refresh-token-ttl=168h
# Strict RFC 8707 Resource Indicator
go run ./tests/oauthserver/cmd/server -port 9000 \
-require-resource=true
# Runlayer Compatibility Mode (Issue #271)
go run ./tests/oauthserver/cmd/server -port 9000 -runlayer-mode
# Test Error Handling
# Test invalid_grant error on token exchange
go run ./tests/oauthserver/cmd/server -port 9000 \
-token-error=invalid_grant
```
--------------------------------
### Setup and Build Documentation Environment
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/docs/contributing.md
Commands to clone the repository, install necessary dependencies, and start the local development server for documentation. These commands ensure the environment is ready for previewing changes with hot reload.
```bash
git clone https://github.com/smart-mcp-proxy/mcpproxy-go.git
cd mcpproxy-go
make docs-setup
make docs-dev
```
```bash
make docs-build
```
--------------------------------
### Install Inno Setup and Build Installer
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/specs/002-windows-installer/research.md
Installs Inno Setup using Chocolatey and then compiles an installer script. The version is passed as a preprocessor definition to the Inno Setup compiler.
```yaml
- name: Install Inno Setup
run: choco install innosetup -y
- name: Build Installer
run: |
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" \
/DVersion=${{ github.ref_name }} \
scripts\installer.iss
```
--------------------------------
### Build Inno Setup Installer for MCPProxy
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/specs/002-windows-installer/quickstart.md
Compiles the MCPProxy Windows installer using Inno Setup. Requires Inno Setup 6+ and pre-built binaries. Outputs an executable installer file.
```powershell
# Build for amd64
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" `
/DVersion=1.0.0-dev `
/DArch=amd64 `
/DBinPath=dist\windows-amd64 `
scripts\installer.iss
# Output: dist\mcpproxy-setup-1.0.0-dev-amd64.exe
Write-Host "✅ Installer created: dist\mcpproxy-setup-1.0.0-dev-amd64.exe"
```
--------------------------------
### Start mcpproxy Core Server with Custom Port
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/docs/configuration/environment-variables.md
This example demonstrates how to start the mcpproxy core server and specify a custom listening port using the MCPPROXY_LISTEN environment variable.
```bash
MCPPROXY_LISTEN=":9000" mcpproxy serve
```
--------------------------------
### Parallel Installer Script Creation (Bash)
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/specs/002-windows-installer/tasks.md
Demonstrates tasks that can be executed in parallel for creating installer scripts for Inno Setup and WiX, followed by sequential tasks for building and testing.
```bash
# These can be launched in parallel (different files):
Task T004: "Create Inno Setup installer script at scripts/installer.iss"
Task T005: "Create WiX installer definition at wix/Package.wxs"
Task T006: "Create WiX installer definition at wix/Package-arm64.wxs"
Task T012: "Add system PATH modification to Inno Setup script"
Task T013: "Add system PATH modification to WiX Package.wxs"
# Once installer scripts exist, build script can be created:
Task T007: "Create PowerShell build script at scripts/build-windows-installer.ps1"
# After build script exists, testing can proceed:
Task T011: "Test installer locally on Windows 10 VM"
Task T016: "Test PATH configuration on Windows 10 VM"
```
--------------------------------
### Development Environment Setup
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/README.md
Commands to initialize the development environment, including installing dependencies, pre-commit hooks, and build tools.
```bash
make dev-setup
brew install prek
prek install
prek install --hook-type pre-push
```
--------------------------------
### Configure Inno Setup Post-Install Launch
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/specs/002-windows-installer/tasks.md
Configures the Inno Setup script to launch the mcpproxy-tray application after installation. It includes a flag to control this behavior and ensures it's skipped during silent installations.
```Inno Setup
[Setup]
...
[Run]
Filename: "{app}\mcpproxy-tray.exe"; Description: "Launch MCPProxy Tray"; Flags: nowait postinstall skipifsilent
```
--------------------------------
### Enable MSI and Inno Setup Logging for Debugging
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/specs/002-windows-installer/quickstart.md
This section details how to enable verbose logging for both WiX MSI installers and Inno Setup installers to aid in debugging installation issues. It provides commands to generate log files and common patterns to search within them.
```powershell
# Install with verbose logging (WiX)
msiexec /i mcpproxy.msi /l*v install.log
# Common log entries to search for:
Select-String -Path install.log -Pattern "Return value 3" # Error
Select-String -Path install.log -Pattern "CustomAction" # Custom action execution
Select-String -Path install.log -Pattern "Error" # General errors
# Install with log file (Inno Setup)
installer.exe /LOG=install.log
# View log
Get-Content install.log | Select-String "Error"
Get-Content install.log | Select-String "Failed"
```
--------------------------------
### CLI - Start Server
Source: https://context7.com/smart-mcp-proxy/mcpproxy-go/llms.txt
Start the MCPProxy server with optional configuration overrides.
```APIDOC
## CLI - Start Server
### Description
Start the MCPProxy server with optional configuration overrides.
### Usage
```bash
mcpproxy serve [options]
```
### Options
- `--listen
`: Specify the listen address (e.g., `127.0.0.1:9090`).
- `--api-key `: Set the API key for authentication.
- `--log-level `: Set the logging level (e.g., `debug`, `info`, `warn`, `error`).
- `--read-only`: Enable read-only mode.
- `--config `: Specify a custom configuration file path.
### Examples
```bash
# Start with defaults
mcpproxy serve
# Start with custom port and API key
mcpproxy serve --listen 127.0.0.1:9090 --api-key my-secret-key
# Start with debug logging
mcpproxy serve --log-level debug
# Start in read-only mode
mcpproxy serve --read-only
# Start with custom config file
mcpproxy serve --config /path/to/mcp_config.json
```
```
--------------------------------
### Perform Fresh Installation of MCPProxy Installer
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/specs/002-windows-installer/quickstart.md
Installs MCPProxy using either the Inno Setup executable or WiX MSI package. Supports both interactive and silent installation modes, with logging for troubleshooting.
```powershell
# Option A: Interactive installation (double-click installer.exe or installer.msi)
Start-Process dist\mcpproxy-setup-1.0.0-dev-amd64.exe
# Option B: Silent installation
Start-Process dist\mcpproxy-setup-1.0.0-dev-amd64.exe `
-ArgumentList "/VERYSILENT", "/SUPPRESSMSGBOXES", "/LOG=install.log" `
-Wait
# For MSI:
Start-Process msiexec.exe `
-ArgumentList "/i", "dist\mcpproxy-1.0.0-dev-windows-amd64.msi", "/qn", "/l*v", "install.log" `
-Wait
```
--------------------------------
### Automated UI Testing Setup (Bash)
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/docs/tray-debug.md
Illustrates how to start the mcpproxy core and tray for automated UI testing scenarios like Playwright. The core is launched in headless mode with OAuth disabled and a specific URL. The tray is launched with `MCPPROXY_TRAY_SKIP_CORE=true` and `MCPPROXY_TRAY_INSPECT_ADDR` enabled, which exposes an HTTP inspector for querying tray state.
```bash
# Start the core in headless mode
MCPPROXY_DISABLE_OAUTH=true \
MCPPROXY_CORE_URL=http://localhost:18080 \
mcpproxy serve --listen :18080 --tray=false &
# Launch the tray with instrumentation enabled
MCPPROXY_TRAY_SKIP_CORE=true \
MCPPROXY_CORE_URL=http://localhost:18080 \
MCPPROXY_TRAY_INSPECT_ADDR=127.0.0.1:8765 \
go run -tags traydebug ./cmd/mcpproxy-tray
```
--------------------------------
### Build Windows Installers
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/CLAUDE.md
Commands to generate Windows installers for the mcpproxy-go project. Supports both Inno Setup for simplified packaging and WiX Toolset for more complex MSI deployments.
```powershell
.\scripts\build-windows-installer.ps1 -Version "v1.0.0" -Arch "amd64"
```
```bash
wix build -arch x64 -d Version=1.0.0.0 -d BinPath=dist\windows-amd64 wix\Package.wxs
```
--------------------------------
### Local Build Script for Windows Installer
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/specs/002-windows-installer/research.md
A PowerShell script to build Go binaries for Windows and then compile an installer using Inno Setup. It allows specifying the version and architecture for the build.
```powershell
# scripts/build-windows-installer.ps1
param(
[string]$Version = "1.0.0",
[string]$Arch = "amd64"
)
# Build Go binaries
$env:GOOS = "windows"
$env:GOARCH = $Arch
$env:CGO_ENABLED = "0"
go build -o "dist\windows-$Arch\mcpproxy.exe" ./cmd/mcpproxy
$env:CGO_ENABLED = "1"
go build -o "dist\windows-$Arch\mcpproxy-tray.exe" ./cmd/mcpproxy-tray
# Build installer (Inno Setup example)
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" `
/DVersion=$Version `
/DArch=$Arch `
scripts\installer.iss
Write-Host "Installer created: dist\mcpproxy-setup-$Version-$Arch.exe"
```
--------------------------------
### Start MCPProxy Server via Terminal
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/docs/getting-started/quick-start.md
Command to initialize the MCPProxy server for users who installed via Homebrew or manual binary.
```bash
mcpproxy serve
```
--------------------------------
### Install and Build with WiX Toolset 4.x
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/docs/github-actions-windows-wix-research.md
Installs the WiX Toolset as a .NET global tool and demonstrates building an MSI installer with optional versioning variables.
```yaml
- name: Install WiX Toolset
run: dotnet tool install --global wix
- name: Build MSI
run: wix build -o output/installer.msi Product.wxs
- name: Build MSI with version
run: wix build Product.wxs -o output/installer-${{ github.ref_name }}.msi -d BuildVersion=${{ github.ref_name }}
```
--------------------------------
### Test Prerelease Installer and Verify Version
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/specs/002-windows-installer/quickstart.md
Instructions for testing a prerelease installer downloaded from GitHub Actions. It covers unzipping the artifact, running the installer, and verifying the prerelease version of MCPProxy.
```powershell
# Unzip artifact
Expand-Archive windows-installer-amd64.zip -Destination .
# Install
Start-Process mcpproxy-setup-vX.Y.Z-next.abcdef-amd64.exe
# Verify prerelease version
mcpproxy --version
# Should output: MCPProxy version vX.Y.Z-next.abcdef
```
--------------------------------
### Build and Start mcpproxy Server
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/specs/026-pii-detection/MANUAL_TESTING_PLAN.md
These commands are prerequisites for running the tests. 'make build' compiles the Go application, and './mcpproxy serve' starts the server with a specified configuration file.
```bash
make build
./mcpproxy serve --config test/e2e-config.json
```
--------------------------------
### Install Inno Setup in GitHub Actions
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/specs/002-windows-installer/tasks.md
Installs Inno Setup using Chocolatey within a GitHub Actions workflow. This is a prerequisite for building Windows installers with Inno Setup.
```Bash
steps:
- name: Install Inno Setup
run: choco install innosetup -y
```
--------------------------------
### Configure Inno Setup Informational Screens
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/specs/002-windows-installer/tasks.md
Sets up Inno Setup to display custom welcome and conclusion screens using RTF files. The `InfoBeforeFile` and `InfoAfterFile` directives are used to specify the paths to these files.
```Inno Setup
[Setup]
...
InfoBeforeFile=scripts\installer-resources\windows\welcome.rtf
InfoAfterFile=scripts\installer-resources\windows\conclusion.rtf
```
--------------------------------
### Inno Setup Configuration for Windows Installer Release Notes
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/specs/010-release-notes-generator/research.md
Configuration for Inno Setup installer to include 'RELEASE_NOTES.md' in the installation directory. The file will be placed in the 'docs' subfolder of the application's installation path.
```iss
[Files]
Source: "{#SourceDir}\RELEASE_NOTES.md"; DestDir: "{app}\docs"; Flags: ignoreversion
```
--------------------------------
### Build and Run mcpproxy-tray Application
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/specs/013-structured-server-state/debugging-notes.md
This snippet demonstrates how to build the mcpproxy-tray binary using Go and then run it. It assumes the user has the Go toolchain installed and is in the project's root directory. The command `go build` compiles the Go source files into an executable, and `./mcpproxy-tray` executes the compiled program.
```bash
go build -o mcpproxy-tray ./cmd/mcpproxy-tray
# Kill existing tray and restart
./mcpproxy-tray
```
--------------------------------
### Inno Setup Silent Installation Commands
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/specs/002-windows-installer/research.md
Command-line flags for performing silent installations and uninstalls of the generated Inno Setup executable.
```bash
installer.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /DIR="C:\MCPProxy"
unins000.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART
```
--------------------------------
### Inno Setup Multi-Architecture Deployment
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/specs/002-windows-installer/research.md
Configures Inno Setup to support both x64 and ARM64 architectures in a single installer. It uses Pascal script functions to check the processor architecture during file installation.
```pascal
[Setup]
ArchitecturesAllowed=x64compatible arm64compatible
ArchitecturesInstallIn64BitMode=x64compatible arm64compatible
[Files]
Source: "dist\windows-amd64\mcpproxy.exe"; DestDir: "{app}"; Flags: ignoreversion; Check: IsX64
Source: "dist\windows-amd64\mcpproxy-tray.exe"; DestDir: "{app}"; Flags: ignoreversion; Check: IsX64
Source: "dist\windows-arm64\mcpproxy.exe"; DestDir: "{app}"; Flags: ignoreversion; Check: IsARM64
Source: "dist\windows-arm64\mcpproxy-tray.exe"; DestDir: "{app}"; Flags: ignoreversion; Check: IsARM64
[Code]
function IsX64: Boolean;
begin
Result := ProcessorArchitecture = paX64;
end;
function IsARM64: Boolean;
begin
Result := ProcessorArchitecture = paARM64;
end;
```
--------------------------------
### CLI Search Command Examples (Bash)
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/docs/repository-detection.md
Demonstrates how to use the MCP Proxy CLI to search for servers, with examples showing basic search, limiting results, and enabling repository detection.
```bash
# Basic search with repository detection (uses batch processing)
mcpproxy search-servers --registry pulse --search weather
# Limit results for faster response (batch processing applied to limited set)
mcpproxy search-servers --registry smithery --search database --limit 5
# Search without limit specification (uses default 10, processed in batch)
mcpproxy search-servers --registry mcprun --search api
```
--------------------------------
### Install Build Tools for Windows Installers
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/specs/002-windows-installer/quickstart.md
Installs necessary build tools for creating Windows installers. It provides options for Inno Setup via Chocolatey and WiX Toolset via .NET global tools.
```powershell
# Install via Chocolatey
choco install innosetup -y
# Verify installation
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /?
```
```powershell
# Install .NET SDK (if not already installed)
winget install Microsoft.DotNet.SDK.8
# Install WiX as global tool
dotnet tool install --global wix
# Verify installation
wix --version
```
--------------------------------
### MCPProxy CLI Quick Examples for Activity Management
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/docs/features/activity-log.md
A collection of common command-line interface (CLI) commands for interacting with MCPProxy activity logs. These examples cover listing, watching, summarizing, showing details, and exporting activity records.
```bash
# List recent activity
mcpproxy activity list
# List last 10 tool call errors
mcpproxy activity list --type tool_call --status error --limit 10
# Watch activity in real-time
mcpproxy activity watch
# Show activity statistics
mcpproxy activity summary --period 24h
# View specific activity details
mcpproxy activity show 01JFXYZ123ABC
# Export for compliance
mcpproxy activity export --output audit.jsonl
```
--------------------------------
### Configure Inno Setup for Code Signing
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/specs/002-windows-installer/research.md
This configuration snippet for Inno Setup specifies the parameters for code signing the installer. It uses the signtool command with certificate details and a timestamp server, similar to the WiX implementation, to ensure the installer is trusted by Windows.
```pascal
[Setup]
SignTool=signtool /f cert.pfx /p ${{ secrets.CERT_PASSWORD }} /tr http://timestamp.digicert.com /td sha256 /fd sha256 $f
SignedUninstaller=yes
```
--------------------------------
### JavaScript Tool Chaining Example
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/docs/features/code-execution.md
Example of chaining multiple tool calls in JavaScript, first getting user info and then creating an issue.
```javascript
// Get user info then create an issue
var user = call_tool('github', 'get_user', { username: input.username });
var issue = call_tool('github', 'create_issue', {
repo: input.repo,
title: 'Issue from ' + user.name,
body: 'Created by code execution'
});
({ user: user, issue: issue })
```
--------------------------------
### Usage Examples for MCPProxy Server
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/docs/socket-communication.md
Provides command-line examples for running the MCPProxy server with different socket communication configurations, including default behavior, disabling sockets, and specifying custom socket paths or named pipes.
```bash
# Default: Socket auto-created in data directory
./mcpproxy serve
# Disable socket, use TCP only
./mcpproxy serve --enable-socket=false
# Custom socket path
./mcpproxy serve --tray-endpoint=unix:///tmp/custom.sock
# Windows named pipe
mcpproxy.exe serve --tray-endpoint=npipe:////./pipe/mycustompipe
# Verify socket creation
ls -la ~/.mcpproxy/mcpproxy.sock
# Should show: srw------- (socket, user-only permissions)
# Tray automatically connects via socket (no API key needed)
./mcpproxy-tray
```
--------------------------------
### Install Windows Service with WiX
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/docs/github-actions-windows-wix-research.md
Defines a Windows service component, including installation parameters and service control instructions for starting, stopping, and removing the service.
```xml
```
--------------------------------
### Development Setup and Status Check
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/specs/028-agent-tokens/quickstart.md
Instructions for setting up the development environment, building the proxy, and checking its status.
```APIDOC
## Development Setup
### Description
Setup the development environment by checking out the feature branch, building the proxy, and running it with debug logging.
### Commands
```bash
# Switch to feature branch
git checkout 028-agent-tokens
# Build
make build
# Run with debug logging
./mcpproxy serve --log-level=debug
# Verify it's running
curl -H "X-API-Key: $(jq -r .api_key ~/.mcpproxy/mcp_config.json)" \
http://localhost:8080/api/v1/status
```
```
--------------------------------
### Parallel Task Execution (Go)
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/specs/001-update-version-display/tasks.md
Demonstrates parallel execution of tasks within the Setup phase using Go. Tasks T002 and T003 can run concurrently as they are in different files and have no dependencies.
```Go
T002 (types.go) || T003 (github.go)
```
--------------------------------
### Install and Run Frontend Development Server
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/frontend/README.md
Installs project dependencies using npm and starts the Vite development server for hot-reloading. The server typically runs on http://localhost:3000.
```bash
npm install
npm run dev
```
--------------------------------
### Basic Auth Code + PKCE Test Setup (Go)
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/specs/007-oauth-e2e-testing/contracts/oauthserver-go-api.md
Demonstrates setting up the smart-mcp-proxy to use a test OAuth server for basic authorization code and PKCE flow testing. It configures the proxy with test server details and initiates the test server.
```go
func TestAuthCodePKCE(t *testing.T) {
server := oauthserver.Start(t, oauthserver.Options{})
defer server.Shutdown()
// Configure mcpproxy to use test server
cfg := &config.Config{
MCPServers: []config.MCPServerConfig{{
Name: "test-server",
URL: "http://example.com/mcp",
OAuth: &config.OAuthConfig{
ClientID: server.PublicClientID,
IssuerURL: server.IssuerURL,
},
}},
}
// ... test OAuth flow
}
```
--------------------------------
### Build and Start MCPProxy Server
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/test/UI_TESTING.md
Commands to compile the MCPProxy binary and launch the server with a specific configuration file for testing purposes.
```bash
go build -o mcpproxy ./cmd/mcpproxy
./mcpproxy serve --config=./test/e2e-config.json --tray=false
```
--------------------------------
### Example Commit Message - feat: add Windows installer with NSIS/WiX tooling
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/specs/002-windows-installer/spec.md
A comprehensive example of a feature commit message for adding a Windows installer. It follows conventional commit guidelines, includes a clear subject line, references an issue, provides a detailed body explaining the implementation and changes, and outlines testing procedures.
```text
feat: add Windows installer with NSIS/WiX tooling
Related #[issue-number]
Implement Windows installer generation using [NSIS/WiX] to bundle
mcpproxy.exe and mcpproxy-tray.exe for distribution. Installer handles
PATH configuration, Start Menu shortcuts, and post-install launch option.
## Changes
- Add installer build scripts for Windows (.nsi or .wxs definition)
- Integrate installer generation into release and prerelease workflows
- Adapt macOS informational screens (RTF) to Windows conventions
- Add local build instructions for testing installers
## Testing
- Tested on Windows 10 amd64 and Windows 11 arm64 VMs
- Verified PATH configuration and CLI access
- Confirmed tray application launches and starts core server
- Validated uninstallation removes all components cleanly
```
--------------------------------
### Configure Socket and Mode Settings
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/docs/cli-client-mode.md
Examples for troubleshooting and configuration, including forcing standalone mode, setting custom socket paths, and verifying the current operational mode via debug logs.
```bash
# Force Standalone Mode
export MCPPROXY_TRAY_ENDPOINT=""
mcpproxy code exec --code="..." --input='{...}'
# Custom Socket Path
export MCPPROXY_TRAY_ENDPOINT="unix:///tmp/custom.sock"
mcpproxy code exec --code="..." --input='{...}'
# Verify Mode
mcpproxy code exec --code="..." --log-level=debug
```
--------------------------------
### MCPProxy Serve Command Usage
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/docs/cli/command-reference.md
Demonstrates the basic usage of the `mcpproxy serve` command to start the MCPProxy server. It includes common flags for configuration, such as listen address, API key, and enabling/disabling features.
```bash
mcpproxy serve [flags]
```
--------------------------------
### Verify MCPProxy Fresh Installation
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/specs/002-windows-installer/quickstart.md
Checks if the MCPProxy installation was successful by verifying file existence, PATH configuration, Start Menu shortcuts, and registry entries. Requires a new PowerShell session for PATH updates.
```powershell
# Check files exist
Test-Path "C:\Program Files\MCPProxy\mcpproxy.exe" # Should return True
Test-Path "C:\Program Files\MCPProxy\mcpproxy-tray.exe" # Should return True
# Check PATH configuration
$env:Path -split ';' | Select-String "MCPProxy"
# Should output: C:\Program Files\MCPProxy
# Test CLI (requires new PowerShell session or refreshenv)
# Open NEW PowerShell window:
mcpproxy --version
# Should output: MCPProxy version 1.0.0-dev
# Check Start Menu shortcut
Test-Path "$env:ProgramData\Microsoft\Windows\Start Menu\Programs\MCPProxy\MCPProxy.lnk"
# Check uninstall registry
Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*" | `
Where-Object DisplayName -like "MCPProxy*" | `
Select-Object DisplayName, DisplayVersion, InstallLocation
```
--------------------------------
### Start OAuth Test Server (Go)
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/docs/oauthserver_testing.md
Starts the OAuth test server using the Go command. Allows configuration of the listening port and token expiration times. Recommended for manual testing with longer token lifetimes.
```bash
go run ./tests/oauthserver/cmd/server -port 9000
go run ./tests/oauthserver/cmd/server -port 9000 -access-token-ttl=1h
```
--------------------------------
### Start OAuth Test Server
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/specs/008-oauth-token-refresh/quickstart.md
Starts a local OAuth test server on port 9000 with a short access token Time-To-Live (TTL) of 30 seconds. This is used to test token refresh functionality. Requires Go to be installed.
```bash
go run ./tests/oauthserver/cmd/server -port 9000 -access-token-ttl=30s
```
--------------------------------
### Build Go Application
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/docs/plans/2025-11-19-cli-management-commands.md
This command demonstrates how to build the Go application from the source code. It specifies the output executable name and the path to the main package.
```Bash
go build -o mcpproxy ./cmd/mcpproxy
```
--------------------------------
### Basic Configuration Patch Example
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/specs/023-smart-config-patch/contracts/merge-api.md
Demonstrates how to apply a patch to a base server configuration using the MergeServerConfig function.
```go
base := &config.ServerConfig{
Name: "github-server",
Enabled: false,
Isolation: &config.IsolationConfig{
Enabled: true,
Image: "python:3.11",
},
}
patch := &config.ServerConfig{
Enabled: true,
}
merged, diff, err := config.MergeServerConfig(base, patch, config.DefaultMergeOptions())
```
--------------------------------
### Inno Setup Path Modification
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/specs/002-windows-installer/research.md
Updates the system PATH environment variable during installation. It includes a registry check to prevent duplicate entries.
```pascal
[Setup]
ChangesEnvironment=yes
[Registry]
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; \
ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}"; \
Check: NeedsAddPath('{app}')
[Code]
function NeedsAddPath(Param: string): boolean;
var
OrigPath: string;
begin
if not RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment', 'Path', OrigPath) then begin
Result := True;
exit;
end;
Result := Pos(';' + Param + ';', ';' + OrigPath + ';') = 0;
end;
```
--------------------------------
### Install mcpproxy using Go (Development)
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/AUTOUPDATE.md
Command to install the mcpproxy binary using the Go toolchain, typically used for development or when managing dependencies directly.
```bash
go install github.com/smart-mcp-proxy/mcpproxy-go/cmd/mcpproxy@latest
```
--------------------------------
### Start Python Mock Server with uv
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/docs/oauthserver_testing.md
Provides instructions for starting the Python/FastAPI mock server using `uv`, a fast Python package installer and application runner. This server is used for lightweight testing of specific OAuth features like RFC 8707 resource parameters.
```bash
# Using uv (recommended)
PORT=9000 uv run --with fastapi --with uvicorn python test/integration/oauth_runlayer_mock.py
```
--------------------------------
### CLI Usage Example in Go
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/docs/architecture.md
Demonstrates how to use the management service client to perform a bulk restart operation on all upstream servers. It prints the total number of servers, successful operations, and failed operations.
```Go
package main
import (
"context"
"fmt"
"os"
"path/filepath"
"github.com/urfave/cli/v2"
"smart-mcp-proxy/mcpproxy-go/internal/client"
)
func main() {
// ... cli setup ...
app := &cli.App{
Name: "mcpproxy-cli",
Usage: "Manage MCPProxy servers",
Commands: []*cli.Command{
{
Name: "restart-all",
Aliases: []string{"ra"},
Usage: "Restart all upstream servers",
Action: func(c *cli.Context) error {
ctx := c.Context
// Assuming client.NewClient() initializes connection to management service
client, err := client.NewClient("unix:///var/run/mcpproxy.sock") // Example socket path
if err != nil {
return fmt.Errorf("failed to create client: %w", err)
}
result, err := client.RestartAll(ctx)
if err != nil {
return fmt.Errorf("failed to restart all servers: %w", err)
}
fmt.Printf(" Total servers: %d\n", result.Total)
fmt.Printf(" ✅ Successful: %d\n", result.Successful)
fmt.Printf(" ❌ Failed: %d\n", result.Failed)
// Optionally print detailed errors
for serverID, opErr := range result.Errors {
fmt.Printf(" - Server %s: %v\n", serverID, opErr)
}
return nil
},
},
// ... other commands ...
},
}
if err := app.Run(os.Args); err != nil {
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
os.Exit(1)
}
}
```
--------------------------------
### Simple WiX 4.x MSI Build (GitHub Actions)
Source: https://github.com/smart-mcp-proxy/mcpproxy-go/blob/main/docs/github-actions-windows-wix-research.md
A straightforward GitHub Actions workflow for building a WiX 4.x MSI installer for a Go application. It checks out code, sets up .NET and Go environments, installs the WiX Toolset via .NET global tools, builds the Go binary, compiles the MSI using WiX, and uploads the resulting MSI as an artifact.
```yaml
name: Build MSI Installer
on:
push:
branches: [main, next]
pull_request:
jobs:
build-msi:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.23'
cache: true
- name: Build Go binary
run: |
$VERSION = "${{ github.ref_name }}"
go build -o output/mcpproxy.exe ./cmd/mcpproxy
- name: Install WiX Toolset
run: dotnet tool install --global wix
- name: Build MSI
run: |
$VERSION = "${{ github.ref_name }}"
wix build installer/Product.wxs \
-o output/mcpproxy-$VERSION-amd64.msi \
-d BuildVersion=$VERSION
- name: Upload MSI artifact
uses: actions/upload-artifact@v4
with:
name: mcpproxy-installer-windows-amd64-${{ github.ref_name }}
path: output/*.msi
compression-level: 0 # MSI already compressed
retention-days: 30
```