Skip to content
Ahmed Hamza

Flagship independent systems project

WebSession MCP Bridge

An authenticated MCP bridge and optional web adapter that give AI clients deliberate access to a Linux or WSL development machine through explicit trust profiles.

MCPOAuthCloudflare Tunnel1MCPBashsystemdtmux

Repository snapshot

WebSession MCP Bridge

Authenticated AI-to-WSL access with explicit trust boundaries.

Commits
192
Trust domains
3
Access
OAuth + MCP

Work done

Dev / Code / Terminal separationDurable PTYsPublic + private trust profiles

WebSession MCP Bridge

Giving an AI agent a shell is easy. Knowing exactly what authority you gave it is the real system.

What it does

WebSession MCP Bridge connects AI clients to a Linux or WSL development machine. Native MCP clients use the main 1MCP gateway; an optional WebSession adapter gives constrained non-MCP clients a narrower HTTPS facade without bypassing that gateway’s authority.

WebSession MCP Bridge authority map AI clients cross a Cloudflare HTTPS boundary into 1MCP, which routes to separate Dev, Code, Terminal, and Local Browser capabilities; an optional WebSession adapter authenticates back through the same gateway. WebSession MCP Bridge / authority map CONNECTIVITY IS NOT THE SAME THING AS AUTHORITY PERSONAL CAPABILITIES MCP OPTIONAL AI clients MCP · HTTPS PUBLIC EDGE Cloudflare HTTPS routing 1MCP OAuth · policy WebSession adapter durable HTTPS → 1MCP Dev files · Bash · waits · sleep Code repository-rooted intelligence Terminal durable PTYs · human handoff Local → Browser Windows · WSLg Chrome TRUST PROFILES restricted → workspace-bounded · trusted-dev → native Bash · personal → Dev + Code + Terminal + Local
Connectivity crosses one authenticated gateway; authority remains separated by capability domain and trust profile.

The point is not remote shell access by itself. The point is being able to answer: what can this session do, and where does that authority stop?

The trust model is the product

The bridge has three useful operating levels:

Those are not cosmetic modes. They are different authority contracts. A public installation should not silently inherit the permissions of my private development machine.

Durable terminals solved a different problem

Short MCP calls and long-running development processes have different lifetimes. A build, server, or interactive terminal should not disappear just because an MCP provider restarts or one HTTP request ends.

The bridge therefore keeps terminal PTYs under tmux and treats terminal ownership as a separate boundary. That lets a model start a real process, observe it later, and hand the same PTY to a human when input is required instead of inventing another shell path.

Browser control stays behind a stable broker

The personal profile does not publish a large browser catalog directly beside files and Bash. It exposes three Local broker actions—discovery, schema lookup, and invocation—while a private inner 1MCP and Browser facade choose the authorized native Windows or WSLg Chrome target.

That keeps browser routing resource-local and lets the outer model-facing schema stay stable when the downstream browser catalog changes.

The optional adapter reuses the same authority

Some AI clients can make HTTPS requests but do not provide native MCP. The separately started WebSession adapter supports those clients through readable GET and bearer-authenticated JSON POST facades backed by durable SQLite operations.

It authenticates back to 1MCP, mirrors live tool metadata, and invokes the exact upstream tools. It has its own manual lifecycle and capability revocation, but it does not become a second tool-permission system.

A smaller surface was easier to reason about

The private harness keeps three direct domains plus one Local broker domain instead of exposing every implementation primitive as an unrelated tool. Dev owns file and command work. Code owns repository intelligence. Terminal owns persistent interactive processes. Local owns stable routing to resource-specific capabilities such as Browser.

That separation became more important as the bridge grew. The useful question was no longer “can the model execute this?” but “which boundary already owns this action?”

Public and private are intentionally different

The repository keeps a publication boundary between general-purpose profiles and private personal-harness implementation/evidence. Public users can start from a bounded profile instead of copying the authority of my own machine by accident.

That is also why bootstrap and persistent startup are explicit. Preparing a runtime and enabling a service to come back automatically are different decisions and should look different in the interface.

Current state

The released Phase-2 harness remains the baseline, while the current repository adds the Local/Browser boundary, selectable terminal presentation, explicit Windows host sleep, and the optional WebSession adapter. The project remains a self-hosted development bridge, not a hosted multi-tenant service.

Note: WebSession MCP Bridge is an independent educational experiment exploring controlled AI-to-development-environment access. It is not designed or intended to bypass OpenAI safeguards or violate OpenAI’s Terms of Use or platform policies.

What I learned

The most valuable part of agent infrastructure is often not another capability. It is a clean answer to ownership, lifetime, and authority.

A tool surface becomes easier to trust when access is explicit, long-running state has one owner, and a private convenience does not quietly become a public default.