Vps-mcp
Manages Git repositories, worktrees, branches, and diffs, providing isolated workspaces for portal chats.
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., "@Vps-mcpBind to my portal chat and review the uncommitted changes in the agent branch"
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.
Vps-mcp Agent Portal
A self-hosted Codex-style coding control plane for a VPS. It combines a clean browser portal with an MCP gateway so an individual ChatGPT Web conversation can bind to an individual project chat, work in an isolated Git worktree, stream observable activity, ask structured questions, receive files/images, and mirror its final answer back into the portal.
What is implemented
Workspaces mapped to Git repositories on the VPS.
Independent chats with Plan / Build / Review modes.
One-time
bind_...codes that bind one MCP session to one portal chat.One active agent lease per chat; different chats can run in parallel.
Build-mode Git worktree +
agent/<chat-id>branch isolation.Full canonical chat history with context-pressure compaction only when needed.
Search/retrieval of older raw messages after compaction.
Structured portal questions: text, confirm, single-choice, multi-choice.
Live durable SSE activity: status, commands, stdout/stderr, file changes, questions, completion.
Image/file attachments, content-addressed storage, MIME sniffing, dedupe and MCP delivery.
Changes/diff and rolling run-summary surfaces in the web UI.
OAuth authorization-code + PKCE for MCP; access tokens are stored hashed in Postgres.
Browser auth with Argon2, HttpOnly/Secure/SameSite cookies, CSRF and rate limiting.
Legacy unrestricted
terminalremains available when the MCP session is not portal-bound. Once bound, it is disabled and the agent must usechat_terminal, so chat mode policy is applied.Unit, integration, official MCP-client, public smoke, restart and Playwright browser tests.
Related MCP server: WebGPT Codex Bridge
Important ChatGPT Web limitation
MCP does not provide a mechanism for a server to create a new ChatGPT Web model turn. A message submitted in the portal is durably queued and returned by chat_sync, but it cannot wake an idle ChatGPT tab by itself.
For truly unattended portal-initiated runs, the planned V2 AgentDriver/OpenAI Responses API worker is the right path. The existing architecture deliberately keeps that future driver separate from the chat/workspace/event model.
Context behavior
The portal stores the complete canonical thread permanently.
While the thread fits the configured budget,
chat_connecthydrates the entire chat verbatim. A saved rolling summary is ignored.Near context pressure, an older checkpoint summary replaces only the messages it covers; every message after that checkpoint stays verbatim.
chat_historyandchat_history_searchcan retrieve compacted-out raw history at any time.chat_syncis cursor-based and returns only new messages/events/answers after connection.
This matches the coding-agent pattern discussed for Codex/OpenCode: full detail first, compaction only when the context window requires it.
MCP tools
terminal— broad VPS terminal when the MCP session is not bound to a portal chat.chat_connect(binding_code)chat_sync()chat_activity(stage, message)chat_ask(...)chat_terminal(command, cwd?, timeout?)chat_history(...)chat_history_search(query, limit?)chat_compact(...)chat_attachment(attachment_id)chat_complete(answer, summary, structured?, compacted_through_seq?)chat_disconnect()
Repository layout
apps/
api/ Fastify control API + auth + SSE + portal static hosting
mcp/ Streamable HTTP MCP/OAuth gateway + chat agent service
portal/ React/Vite Codex-style UI
packages/
core/ IDs, modes, context policy, redaction
db/ PostgreSQL migration/repository layer
workspace/ Git repository/worktree/diff lifecycle
attachments/content-addressed upload storage
tests/
e2e/ Playwright browser happy path
smoke/ public HTTPS portal → OAuth → MCP end-to-end smoke
docs/
ARCHITECTURE.md
deploy/
systemd/
traefik/
TODO.md canonical implementation trackerDevelopment
Requirements: Node 22+, Docker, Git.
npm install
docker compose up -d postgresOn a fresh Docker volume, create/use a test database and set TEST_DATABASE_URL, then run:
TEST_DATABASE_URL=postgresql://... npm test
npm run typecheck
npm run build
npm audit --omit=dev --audit-level=highBrowser E2E:
E2E_BASE_URL=https://your-host \
E2E_ADMIN_PASSWORD='...' \
npm run e2ePublic smoke:
SMOKE_BASE_URL=https://your-host \
SMOKE_ADMIN_PASSWORD='...' \
SMOKE_OAUTH_PASSWORD='...' \
npm run smokeThe smoke runner creates a temporary Git repository, exercises Plan/Q&A/attachments/Build/worktree/completion, then deletes its chat/workspace/worktree.
Deployment
The production deployment on the test VPS uses separate systemd services and the existing Coolify Traefik instance. Templates are under deploy/.
The original /opt/terminal-mcp is intentionally kept as a rollback/control MCP until the new connector is added in ChatGPT and explicitly cut over.
Security notes
Browser responses never include DB credentials, MCP OAuth password, executor credentials, or attachment storage paths.
MCP access/session/binding tokens are stored hashed where persistence is required.
Observable activity is secret-redacted; private model chain-of-thought is never sent to the portal.
Plan/Review shell commands use a conservative inspection allowlist and reject redirections/subshells/mutating command families.
Uploaded files are not auto-executed.
The current disposable-VPS deployment runs the control API as root so it can validate arbitrary host repositories and clean Git worktrees; it exposes no generic shell route. For a multi-tenant/non-disposable server, split repository lifecycle into a narrow privileged helper and run the browser-facing API unprivileged.
This server cannot be deployed
Maintenance
Related MCP Connectors
Share one project context across ChatGPT, Claude, Telegram and any MCP client.
Project memory, tasks and Telegram notifications for your coding agent. Chip account required.
Real-time chat for AI agents. Claude Code, Cursor, Cline and Codex join channels over MCP.
Remote MCP server for supportsheep: run AI interviews and manage support content for your blog.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables ChatGPT web to interact with local Windows/WSL shell and code workspaces via an MCP server, providing file access, shell execution, and snapshot-based workspace management with per-command authorization.18MIT
- AlicenseNot gradedqualityBmaintenanceEnables continuing a local coding task from your own web ChatGPT account by exposing project-scoped read and apply tools over MCP, with no inference API dependency.MIT
- AlicenseNot gradedqualityBmaintenanceTurns ChatGPT web into a local coding agent, enabling file edits, shell commands, Git operations, patches, and process management through 40+ MCP tools.MIT
- FlicenseNot gradedqualityCmaintenanceEnables ordinary ChatGPT web Chat to work directly on a local machine over a private MCP tunnel — reading and editing project files, running shell commands and tests, loading local skills, manipulating images, and driving Chrome — without spinning up a separate coding agent or additional model-generation API calls. It also supports multi-step task plans with persisted execution receipts and acceptance checks so results from real runs are returned to the conversation.-