mirror of
https://github.com/Dasemu/chatgpt-imagegen-mcp.git
synced 2026-11-27 15:56:56 +00:00
chore: scaffold TypeScript project with Playwright
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7d5da95403
commit
15c2a90f08
6 files changed
+1999
No files matched your search
@@ -0,0 +1,55 @@
|
|||||||
|
# --- MCP server ---
|
||||||
|
HOST=127.0.0.1
|
||||||
|
PORT=8088
|
||||||
|
# Bearer token required on /mcp, /health and /media (generate with: openssl rand -hex 32)
|
||||||
|
MCP_SERVER_TOKEN=replace-with-a-long-random-secret
|
||||||
|
# External base URL used to build downloadUrl/publicUrl (no trailing slash)
|
||||||
|
PUBLIC_BASE_URL=https://mcp.example.com/chatgptimagegen
|
||||||
|
# HMAC secret for /public-media signed URLs (>= 32 chars)
|
||||||
|
PUBLIC_MEDIA_SIGNING_SECRET=replace-with-at-least-32-random-characters
|
||||||
|
PUBLIC_MEDIA_URL_TTL_SECONDS=86400
|
||||||
|
MAX_MCP_REQUEST_MB=40
|
||||||
|
# Express "trust proxy" value; set to 1 behind nginx
|
||||||
|
TRUST_PROXY=
|
||||||
|
|
||||||
|
# --- Media storage ---
|
||||||
|
MEDIA_DIR=media
|
||||||
|
MEDIA_RETENTION_HOURS=168
|
||||||
|
TOMBSTONE_RETENTION_DAYS=30
|
||||||
|
MAX_INLINE_MEDIA_MB=25
|
||||||
|
MAX_MEDIA_MB=50
|
||||||
|
MAX_REFERENCE_INPUT_MB=25
|
||||||
|
|
||||||
|
# --- ChatGPT browser ---
|
||||||
|
CHATGPT_URL=https://chatgpt.com/
|
||||||
|
# Persistent Chromium profile holding the chatgpt.com login (keep private, never commit)
|
||||||
|
CHATGPT_PROFILE_DIR=profiles/chatgpt
|
||||||
|
# Headed under Xvfb is the default in production; headless is blocked more often
|
||||||
|
CHATGPT_HEADLESS=false
|
||||||
|
# Optional: "chrome" to use an installed Google Chrome instead of Playwright's Chromium
|
||||||
|
CHATGPT_BROWSER_CHANNEL=
|
||||||
|
# Optional user agent override (leave empty to use the browser's own)
|
||||||
|
CHATGPT_USER_AGENT=
|
||||||
|
CHATGPT_LOCALE=es-ES
|
||||||
|
CHATGPT_TURN_TIMEOUT_SECONDS=600
|
||||||
|
CHATGPT_IMAGE_TIMEOUT_SECONDS=180
|
||||||
|
CHATGPT_BROWSER_IDLE_CLOSE_MINUTES=10
|
||||||
|
# Random pause between generations, in seconds (min..max)
|
||||||
|
CHATGPT_MIN_INTERVAL_SECONDS=30
|
||||||
|
CHATGPT_MAX_INTERVAL_SECONDS=90
|
||||||
|
# Circuit breaker cooldowns
|
||||||
|
CHATGPT_USAGE_LIMIT_COOLDOWN_MINUTES=60
|
||||||
|
CHATGPT_SESSION_RECHECK_MINUTES=5
|
||||||
|
MAX_QUEUE_LENGTH=20
|
||||||
|
# HTML + screenshot dumps on UI failures (may contain conversation text)
|
||||||
|
DIAGNOSTICS_DIR=diagnostics
|
||||||
|
MAX_DIAGNOSTICS=10
|
||||||
|
|
||||||
|
# --- Update endpoint (/admin/update) ---
|
||||||
|
# Bearer secret, >= 32 chars; unset disables the endpoint
|
||||||
|
UPDATE_TOKEN=
|
||||||
|
UPDATE_SCRIPT=scripts/update.sh
|
||||||
|
UPDATE_LOG_FILE=logs/update.log
|
||||||
|
UPDATE_RATE_LIMIT_MAX=30
|
||||||
|
UPDATE_RATE_LIMIT_WINDOW_SECONDS=900
|
||||||
|
SERVICE_NAME=chatgpt-imagegen-mcp.service
|
||||||
@@ -6,3 +6,7 @@ media/*
|
|||||||
!media/.gitkeep
|
!media/.gitkeep
|
||||||
profiles/
|
profiles/
|
||||||
diagnostics/
|
diagnostics/
|
||||||
|
.browsers/
|
||||||
|
logs/
|
||||||
|
.update.lock
|
||||||
|
.dist-backup.*
|
||||||
Whitespace-only changes.
Generated
+1891
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,32 @@
|
|||||||
|
{
|
||||||
|
"name": "@zenvairo/chatgpt-imagegen-mcp",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"description": "Remote Streamable HTTP MCP server that generates images through the chatgpt.com web UI driven by Playwright",
|
||||||
|
"type": "module",
|
||||||
|
"private": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=20"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"build": "tsc -p tsconfig.json",
|
||||||
|
"dev": "tsx src/index.ts",
|
||||||
|
"start": "node dist/index.js",
|
||||||
|
"login": "tsx src/login.ts",
|
||||||
|
"login:prod": "node dist/login.js",
|
||||||
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
||||||
|
"test": "MEDIA_DIR=${TMPDIR:-/tmp}/chatgpt-imagegen-mcp-tests-$$ node --import tsx --test test/*.test.ts"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@modelcontextprotocol/sdk": "1.30.0",
|
||||||
|
"dotenv": "16.6.1",
|
||||||
|
"express": "5.2.1",
|
||||||
|
"playwright": "1.63.0",
|
||||||
|
"zod": "3.25.76"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/express": "5.0.6",
|
||||||
|
"@types/node": "24.3.0",
|
||||||
|
"tsx": "4.23.13",
|
||||||
|
"typescript": "5.9.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "ES2022",
|
||||||
|
"module": "NodeNext",
|
||||||
|
"moduleResolution": "NodeNext",
|
||||||
|
"rootDir": "src",
|
||||||
|
"outDir": "dist",
|
||||||
|
"strict": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
"declaration": true,
|
||||||
|
"sourceMap": true
|
||||||
|
},
|
||||||
|
"include": ["src/**/*.ts"]
|
||||||
|
}
|
||||||
Reference in new issue
Block a user