Skip to main content
Glama
mcp-scp.ps11.82 kB
# mcp-scp.ps1 - Write MCP config file to remote host via SCP (Windows PowerShell) # # Usage: Get-Content config.json | .\mcp-scp.ps1 <sessionId> <ssh-host> <remote-team-path> [sessionMcpPath] # # Reads MCP config JSON from stdin, writes to local temp file, SCPs to remote host, # outputs the remote file path to stdout, then cleans up local temp file. # # Requires: OpenSSH for Windows or pscp (PuTTY) # Destination: <remote-team-path>/<sessionMcpPath>/iris-mcp-<sessionId>.json # Default sessionMcpPath: .claude/iris/mcp # param( [Parameter(Mandatory=$true)] [string]$SessionId, [Parameter(Mandatory=$true)] [string]$SshHost, [Parameter(Mandatory=$true)] [string]$RemoteTeamPath, [Parameter(Mandatory=$false)] [string]$sessionMcpPath = ".claude/iris/mcp" ) $ErrorActionPreference = "Stop" # Build remote MCP directory path $RemoteMcpDir = "$RemoteTeamPath/$sessionMcpPath" # Create local temp file $LocalTemp = [System.IO.Path]::GetTempFileName() $LocalTempJson = "$LocalTemp.json" Move-Item $LocalTemp $LocalTempJson -Force try { # Read JSON from stdin and write to local temp file $input | Out-File -FilePath $LocalTempJson -Encoding UTF8 -NoNewline # Ensure remote MCP directory exists ssh $SshHost "mkdir -p '$RemoteMcpDir' && chmod 700 '$RemoteMcpDir'" # Build remote file path $RemoteFile = "$RemoteMcpDir/iris-mcp-$SessionId.json" # SCP file to remote host scp -q $LocalTempJson "${SshHost}:${RemoteFile}" # Set remote file permissions (readable only by owner) ssh $SshHost "chmod 600 '$RemoteFile'" # Output the remote file path to stdout (transport will read this) Write-Output $RemoteFile } finally { # Cleanup local temp file if (Test-Path $LocalTempJson) { Remove-Item $LocalTempJson -Force } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jenova-marie/iris-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server