s-gw MCP server
The s-gw MCP server lets agents discover local secret handles and request approved, sanitized credential-backed actions without exposing raw secrets.
Scan local files for secrets, returning tokenized text plus handles
Scan supplied text for secrets, with optional handle persistence
List known secret handles and their non-secret metadata
Describe non-secret metadata for a specific handle
Request execution of a command with one secret injected as an environment variable
Request an s-gw-owned SSH session for a target using a handle
Execute a previously approved request and receive sanitized output
Integrates with 1Password as a credential store, enabling secure resolution of typed handles to secrets stored in 1Password without exposing raw credentials.
Provides agent-specific configuration for GitHub Copilot, allowing it to interact with s-gw for credential handling via typed handles and scoped action requests.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@s-gw MCP server show me available credential handles"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.

Stop handing raw credentials to coding agents. s-gw gives agents typed handles, asks you to approve bounded local actions, resolves the credential inside a constrained process on your machine, and returns sanitized output instead of secret values.
s-gw is an early preview. Storage formats and interfaces may change, Windows and Linux desktop support is still experimental, and the project has not completed an independent security audit. Do not treat it as a replacement for endpoint security or a hardened enterprise secrets platform yet.
The TypeScript broker, clients, and documentation in this repository are Apache-2.0 licensed. Distributed packages also contain a proprietary compiled Rust execution core whose source is maintained separately.
The Short Version
Agent sees:
s-gw:credential:prod-readonlyYou approve: agent, command, handle, environment binding, working directory, and target
s-gw runs: the command locally with the credential injected only into that child process
Agent receives: sanitized output, audit evidence, and no raw secret
If s-gw helps your agent workflow, star the project. It makes the preview easier for other developers to find.
Related MCP server: AI Knowledge Center MCP
See It In Action
The local console shows the approval queue, credential inventory, policy state, usage flow, and activity history without exposing secret values.

Public demo: s-gw.com.
What It Does
Govern | Approve | Execute | Audit |
Turn secrets into typed local handles that agents can reference safely. | Review the requesting agent, handle, command, environment binding, working directory, and target before access is granted. | Inject the credential only into the approved child process on the same machine. | Record request, approval, execution, policy, and destination evidence without storing returned raw secrets. |
Why Teams Use It
Local custody: raw values stay in macOS Keychain, Linux Secret Service, Windows Credential Manager, 1Password, or the encrypted local ledger.
Action-scoped access: grants bind to the agent, handle, command, environment variable, working directory, target, approval mode, and optional time window.
Useful handles: agents can request real work with stable handle names instead of seeing keys, passwords, tokens, or SSH material.
Output sanitization: command output is scanned before it returns to the agent, replacing detected credential values with handles.
Agent-aware setup: Codex, Claude Code, Cursor, OpenCode, Gemini CLI, GitHub Copilot, VS Code, and other MCP clients get profile-specific configuration.
Local operator UI: native desktop apps, tray or menu helpers, the CLI, and the web console show approvals, credential inventory, policies, usage flow, activity, and audit history.
How It Works
flowchart LR
A["Coding agent"] -->|"Handle + action request"| G["s-gw local gateway"]
G --> U["Local approval"]
U --> R["Constrained runner"]
K[("Keychain / Credential Manager / encrypted store")] --> R
R -->|"Sanitized output"| G
G --> AThe agent never needs the unlock passphrase or raw credential. Approval is scoped to the requested operation rather than granting general access to the store.
Core Surfaces
Surface | Purpose |
| Setup, credential enrollment, approvals, policies, agent snippets, guard mode, and diagnostics. |
| Stdio MCP server for agent-facing handle discovery and request creation. |
Native macOS app | Approval queue, credential inventory, policy rules, usage flow, activity, and audit review. |
Windows and Linux desktop apps | Installed preview apps with a native window, tray controls, and a bundled local runtime. |
Menu-bar helper | Fast visibility into pending approvals and local daemon status. |
Local web console | Browser backup bound to |
Guard mode | Launch agents with credential-looking environment values replaced by s-gw handles. |
Quick Start
The public npm package is the recommended installation path on macOS, Windows 10/11, and Linux. Install Node.js 20 or newer, then run:
npm install -g @s-gw/s-gw
s-gw setup
s-gw statusOn Windows, run the same commands in PowerShell. Windows support is preview software: the npm package uses the TypeScript execution path and includes the PowerShell client, tray helper, and local web console.
On Linux, install secret-tool first (sudo apt install libsecret-tools on Ubuntu/Debian). An unlocked desktop Secret Service is the normal persistent unlock provider; s-gw setup also installs and starts an owner-level systemd --user console service for the graphical session. A headless host without Secret Service can use an explicitly supplied SGW_MASTER_PASSPHRASE with s-gw setup --no-service --no-open-app, but s-gw never copies that value into a unit file or background-service environment.
Windows x64 and Linux x64 also have installable desktop-app builds. The Rust app draws its management interface directly in a native window; it does not embed a browser, WebView, or localhost page. It packages its own pinned Node runtime and s-gw CLI, so the installed app does not require host Node.js or npm. When the native executable is installed, s-gw app open uses it. Use s-gw app open --browser to start and open the separate loopback browser backup explicitly.
These Windows NSIS and Linux Debian packages are currently unsigned CI previews, not supported public release downloads. Windows does not require WebView2. Linux requires a graphical session and an unlocked Secret Service keyring; the Debian package declares its GTK 3, AppIndicator, libxdo, and libsecret-tools runtime dependencies. See deployment and packaging for build and install details.
For an Apple Silicon Mac desktop bundle, GitHub Releases also provides a self-contained s-gw.dmg. Drag s-gw.app to Applications, then open it and complete setup. The app includes its own Node runtime, CLI, MCP server, native helpers, and menu-bar helper; it does not require Node.js or npm on the host. Setup is intentionally blocked until the app is in /Applications or ~/Applications.
An unsigned DMG requires a Gatekeeper override. Use the npm installation above instead if you do not want to use that override.
The public source builds the TypeScript compatibility path and the native-rendered Windows/Linux Rust desktop app. Building the native macOS surfaces also requires a Swift toolchain. Windows and Linux desktop builds require Rust and their ordinary native graphics and tray development libraries. Maintainer release builds additionally require access to the private Rust core checkout.
The Apple Silicon Mac DMG is a self-contained desktop alternative. Published macOS DMGs are either Developer ID signed and notarized or explicitly documented as unsigned; unsigned builds require a Gatekeeper override but retain the standard release tag and update path. Local npm run build:installers output is ad-hoc signed for local verification. The npm package is the primary install and includes the native app, menu helper, Keychain helper, metadata-only Keychain inspector, and Rust core for Apple Silicon Macs. Linux and Windows use the TypeScript execution path when a matching native core is not packaged. Intel Macs must build the native Keychain and desktop surfaces from source for now; packaged arm64-only helpers are rejected before launch.
git clone https://github.com/sgateway/s-gw.git
cd s-gw
npm ci
npm run build
npm link
s-gw setup
s-gw statuss-gw setup generates local unlock material, stores it in the operating system credential store, initializes the encrypted ledger, starts the local UI surfaces available on the current platform, and safely connects detected supported agents. The self-contained macOS app and the Windows/Linux desktop previews run their bundled runtimes in place; npm installs copy the thin macOS app into /Applications, falling back to ~/Applications when needed. Setup backs up existing agent config, preserves unrelated settings, installs the packaged s-gw skill where supported, and reports per-agent conflicts. Use --no-agents to skip agent registration.
Add a credential from your terminal without placing the value in chat or a process argument:
printf '%s' "$MY_API_TOKEN" | s-gw secret add-keychain \
--name demo-token \
--type api-token \
--value-stdin \
--inject-env API_TOKEN \
--allow-command "$(command -v printenv)"Then inspect the non-secret handle metadata:
s-gw secret listThe end-to-end trust loop walks through a disposable request, local approval, execution, and output sanitization without touching a real credential.
Try The Trust Loop
Use a disposable local token to see the full flow:
printf '%s' 'demo-secret-value' | s-gw secret add-keychain \
--name demo-printenv-token \
--type api-token \
--value-stdin \
--inject-env DEMO_TOKEN \
--allow-command "$(command -v printenv)"
s-gw request env-command <returned-handle> \
--command "$(command -v printenv)" \
--inject-env DEMO_TOKEN
s-gw approve <request-id>
s-gw execute <request-id>The execution output should show a handle token instead of demo-secret-value.
Agent Integration
List the known agent profiles and render the configuration for one client:
s-gw agent list
s-gw agent mcp-snippet codex
s-gw agent mcp-snippet claude-code
s-gw agent mcp-snippet opencodeReview or manage detected connections:
s-gw agent status
s-gw agent install codex --dry-run
s-gw agent install codex
s-gw agent uninstall codexManual profiles and config formats without a safe merge path continue to use the generated snippet. npm installation itself never edits agent configuration.
s-gw setup can safely manage detected Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot CLI, OpenCode, and default-profile VS Code installations on macOS, Windows, and Linux. On Windows, it launches the packaged MCP server through node.exe, not an npm .cmd shim.
For CLI agents, guard mode can replace credential-looking launch environment values with s-gw handles before the agent starts:
s-gw run codex --dry-run -- -v
s-gw run codex -- --ask-for-approval neverMCP registration does not intercept every prompt, file read, shell, or environment variable. See agent integration and the agent profile matrix for the supported paths and current limitations.
Example Request Flow
An agent sees
s-gw:credential:prod-readonlyand asks to runaws sts get-caller-identity.s-gw creates a pending request with the agent name, command, handle, environment binding, working directory, target, and policy result.
You approve once, for a time window, for the login session, or deny it.
s-gw starts the approved local process with the credential injected into the requested environment variable.
s-gw scans the process output before it returns to the agent.
The model can complete the task without receiving the raw access key.
Platform Status
Platform | Status | Credential store | User interface |
macOS 14+ on Apple Silicon | Primary development platform | Keychain | Native app, menu helper, local web console |
macOS 14+ on Intel | Build-from-source candidate; not QA-tested | Source-built Keychain helper | Source-built native surfaces or local web console |
Windows 10/11 x64 | Unsigned desktop preview | Credential Manager | Native desktop app and tray; PowerShell client and browser backup |
Linux x64 desktop | Unsigned desktop preview | Secret Service; explicit environment fallback | Native desktop app and tray; systemd user service and browser backup |
Linux arm64 | npm preview | Secret Service; explicit environment fallback | systemd user service and browser backup |
Published Apple Silicon macOS DMGs are self-contained. Releases are Developer ID signed and notarized when credentials are available; otherwise the release notes and DMG README state that a Gatekeeper override is required. Windows NSIS and Linux Debian desktop packages are currently unsigned CI artifacts and are not uploaded as supported release downloads. Build either one on its target operating system with npm run build:desktop-app; build the existing release artifacts with npm run build:installers.
Security Model
s-gw is designed to reduce accidental credential exposure to coding agents. It does not protect against a compromised operating system account, a malicious approved executable, screen capture, kernel-level access, or every transformed derivative of a secret.
Read the threat model before relying on s-gw for sensitive workflows. Report suspected vulnerabilities through GitHub private vulnerability reporting, not a public issue.
Project Status
The public broker and client source distribution is preview quality; the compiled Rust execution core is proprietary.
macOS is the primary development and test platform.
Windows Credential Manager support and the Windows x64 desktop app are present but still need broader native QA and code signing.
Linux uses Secret Service for persistent unlock material and a hardened systemd user service. The Linux x64 desktop app is an unsigned preview; environment unlock is a non-persistent headless fallback only.
Windows and Linux desktop installers are CI previews until they are signed and validated on supported target systems. macOS releases without Developer ID signing are marked unsigned in their release notes and require a Gatekeeper override.
The repository is prepared for open-source collaboration, but security-sensitive changes should come with focused tests and threat-model updates when behavior changes.
Documentation
Contributing
Issues and focused pull requests are welcome. Start with CONTRIBUTING.md, browse good first issue, and use SECURITY.md for anything that may expose credentials or bypass approval.
Planning a launch, write-up, or community post? The maintainer notes in docs/community-launch.md keep the public wording consistent and honest.
License
Source in this repository is Apache-2.0. See LICENSE and NOTICE. The separately maintained Rust core and its compiled binaries are proprietary and are not licensed under Apache-2.0. Third-party names and artwork remain the property of their respective owners and are documented in TRADEMARKS.md and the third-party notices.
Available Tools
7 toolssgw_describe_handleDescribe HandleB
Show non-secret metadata for one local secret handle.
Inputs: handle (required).
sgw_execute_requestExecute Approved RequestC
Execute a previously approved local request and return sanitized output.
Inputs: requestId (required).
sgw_list_handlesList HandlesA
List known local secret handles and non-secret metadata.
Inputs: no named parameters.
sgw_request_executionRequest Secret-Backed ExecutionC
Create a pending local manifest for a command that needs one secret injected as an environment variable.
Inputs: handle (required), command (required), injectEnv (required), env, +4 more.
sgw_request_ssh_sessionRequest s-gw-Owned SSH SessionC
Create a local approval request for an SSH command that s-gw will run over its own persistent ControlMaster session.
Inputs: handle (required), target (required), args, port, +4 more.
sgw_scan_fileScan Local FileA
Scan a local file for secrets and return tokenized text plus local handles. Raw values are not returned.
Inputs: path (required), persist.
sgw_scan_textScan TextB
Scan supplied text and return tokenized text. Persist=false previews handles without enrolling secrets.
Inputs: text (required), source, persist.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Tools have distinct purposes, but there is potential confusion between sgw_request_execution and sgw_execute_request (create vs. execute), and the names are similar. However, descriptions clarify the difference, and other tools are clearly distinct.
All tool names follow a consistent 'sgw_verb_noun' pattern using snake_case. Each name clearly indicates the action and target, with no deviations.
With 7 tools covering scanning, handle management, execution requests, and SSH sessions, the count is well-scoped for a security-focused server. Each tool has a clear role.
The set covers core workflows (scan, request, execute, list handles) but lacks tools for managing pending requests (e.g., list, approve, cancel) or SSH sessions after creation (e.g., list, end), leaving notable gaps.
Maintenance
Related MCP Connectors
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
MCP server for mandates, delegation, policy-gated execution, credential grants, and audit.
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceA self-hosted MCP server that enables AI coding agents to read, edit, search, and run code in local projects with human review loops and policy controls.MIT
- AlicenseNot gradedqualityCmaintenanceLocal-first MCP server that provides project context, verification gates, and structured tools for coding agents to discover knowledge, run diagnostics, and execute allowlisted commands within a repository.40 npmMIT
- AlicenseAqualityBmaintenanceMCP server that enables a coordinator AI agent to spawn, control, and supervise local coding agents with interactive gating for high-risk operations.13835 npmMIT
- AlicenseNot gradedqualityBmaintenanceA local-first MCP server that enables AI-assisted coding through workspace-scoped tools for file reading/editing, command execution, jobs, Git, LSP, media, browser, and desktop workflows. It enforces OAuth, workspace ACL, trust policies, and file/secret guards so owners can safely grant inspect, edit, or trusted capabilities.346 npmMIT