# gmshadowe/chatgpt-workspace architecture

> Architecture diagram of the GitHub repository gmshadowe/chatgpt-workspace, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gmshadowe/chatgpt-workspace
- Repository: https://github.com/gmshadowe/chatgpt-workspace

## Overview

The repository contains a mostly default Next.js landing page and a separate MCP server that exposes workspace file-management tools over HTTP. The main runtime workflow is an MCP client request, session transport, tool dispatch, and workspace filesystem operation. The excerpts show Supabase clients being created, but not how they are used, so that integration is omitted.

Main entry points: [`mcp-server/src/index.ts`](https://github.com/gmshadowe/chatgpt-workspace/blob/main/mcp-server/src/index.ts) (HTTP Routes), [`app/layout.tsx`](https://github.com/gmshadowe/chatgpt-workspace/blob/main/app/layout.tsx) (Root Layout), [`app/page.tsx`](https://github.com/gmshadowe/chatgpt-workspace/blob/main/app/page.tsx) (Home Page), [`app/globals.css`](https://github.com/gmshadowe/chatgpt-workspace/blob/main/app/globals.css) (Global Styles)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mcp["Workspace MCP"]
  node_http["HTTP Routes<br/>[index.ts]"]
  node_transport["Session Transport<br/>[index.ts]"]
  node_mcpserver["MCP Server<br/>[index.ts]"]
  node_toolhandler["Tool Handler<br/>[index.ts]"]
  node_filetools["File Tools<br/>[index.ts]"]
  node_workspace[("Workspace Files<br/>[index.ts]")]
end

subgraph group_web["Starter Web UI"]
  node_home["Home Page<br/>[page.tsx]"]
  node_rootlayout["Root Layout<br/>[layout.tsx]"]
  node_globalstyles["Global Styles<br/>[globals.css]"]
end

node_client(("MCP Client"))
node_browser(("Browser User"))

node_client -->|"sends MCP requests"| node_http
node_http -->|"creates or reuses"| node_transport
node_http -->|"connects server"| node_mcpserver
node_transport -->|"routes requests"| node_mcpserver
node_mcpserver -->|"dispatches tools"| node_toolhandler
node_toolhandler -->|"selects operation"| node_filetools
node_filetools -->|"reads and writes"| node_workspace
node_browser -.->|"opens page"| node_home
node_rootlayout -->|"wraps page"| node_home
node_rootlayout -->|"imports styles"| node_globalstyles

click node_http "https://github.com/gmshadowe/chatgpt-workspace/blob/main/mcp-server/src/index.ts"
click node_transport "https://github.com/gmshadowe/chatgpt-workspace/blob/main/mcp-server/src/index.ts"
click node_mcpserver "https://github.com/gmshadowe/chatgpt-workspace/blob/main/mcp-server/src/index.ts"
click node_toolhandler "https://github.com/gmshadowe/chatgpt-workspace/blob/main/mcp-server/src/index.ts"
click node_filetools "https://github.com/gmshadowe/chatgpt-workspace/blob/main/mcp-server/src/index.ts"
click node_workspace "https://github.com/gmshadowe/chatgpt-workspace/blob/main/mcp-server/src/index.ts"
click node_home "https://github.com/gmshadowe/chatgpt-workspace/blob/main/app/page.tsx"
click node_rootlayout "https://github.com/gmshadowe/chatgpt-workspace/blob/main/app/layout.tsx"
click node_globalstyles "https://github.com/gmshadowe/chatgpt-workspace/blob/main/app/globals.css"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_http,node_transport,node_mcpserver,node_toolhandler,node_filetools,node_workspace,node_client,node_browser toneBlue
class node_home,node_rootlayout,node_globalstyles toneAmber
```

## Components

### Workspace MCP

- [HTTP Routes](https://github.com/gmshadowe/chatgpt-workspace/blob/main/mcp-server/src/index.ts): `mcp-server/src/index.ts`
- [Session Transport](https://github.com/gmshadowe/chatgpt-workspace/blob/main/mcp-server/src/index.ts): `mcp-server/src/index.ts`
- [MCP Server](https://github.com/gmshadowe/chatgpt-workspace/blob/main/mcp-server/src/index.ts): `mcp-server/src/index.ts`
- [Tool Handler](https://github.com/gmshadowe/chatgpt-workspace/blob/main/mcp-server/src/index.ts): `mcp-server/src/index.ts`
- [File Tools](https://github.com/gmshadowe/chatgpt-workspace/blob/main/mcp-server/src/index.ts): `mcp-server/src/index.ts`
- [Workspace Files](https://github.com/gmshadowe/chatgpt-workspace/blob/main/mcp-server/src/index.ts): `mcp-server/src/index.ts`

### Starter Web UI

- [Home Page](https://github.com/gmshadowe/chatgpt-workspace/blob/main/app/page.tsx): `app/page.tsx`
- [Root Layout](https://github.com/gmshadowe/chatgpt-workspace/blob/main/app/layout.tsx): `app/layout.tsx`
- [Global Styles](https://github.com/gmshadowe/chatgpt-workspace/blob/main/app/globals.css): `app/globals.css`

### Other components

- **MCP Client**
- **Browser User**

## Connections

- MCP Client → HTTP Routes: sends MCP requests (evidence: `mcp-server/src/index.ts`)
- HTTP Routes → Session Transport: creates or reuses (evidence: `mcp-server/src/index.ts`)
- HTTP Routes → MCP Server: connects server (evidence: `mcp-server/src/index.ts`)
- Session Transport → MCP Server: routes requests (evidence: `mcp-server/src/index.ts`)
- MCP Server → Tool Handler: dispatches tools (evidence: `mcp-server/src/index.ts`)
- Tool Handler → File Tools: selects operation (evidence: `mcp-server/src/index.ts`)
- File Tools → Workspace Files: reads and writes (evidence: `mcp-server/src/index.ts`)
- Browser User → Home Page: opens page
- Root Layout → Home Page: wraps page (evidence: `app/layout.tsx`)
- Root Layout → Global Styles: imports styles (evidence: `app/layout.tsx`)
