4.5 KiB
Local Setup Helper — Documentation
Overview
The setup helper is a small interactive onboarding tool for the ChatGPT MCP Server. It reduces configuration friction when choosing between the three supported providers: openai, manual, and ollama.
Run it with:
npm run setup
What it does
- Asks you to choose a provider — OpenAI, Manual Export, or Ollama
- Prompts for provider-specific settings — API keys, model names, URLs, etc.
- Writes a clean
.envfile — with your selected configuration (asks confirmation first) - Optionally creates
.claude/settings.local.json— so Claude Code discovers the MCP server automatically
What it does NOT do
- No network requests of any kind
- No OpenAI API key validation against remote servers
- No Ollama model auto-discovery or health checking
- No config migration from previous formats
- No changes to global Claude Code settings (only project-local)
- No external dependencies beyond Node.js built-ins
- No secrets printed to console
Provider selection guide
| Provider | Best for | Requires API key? | Cost |
|---|---|---|---|
openai |
Automated second-opinion queries with best-in-class reasoning | Yes (OPENAI_API_KEY) |
~$0.003–$0.01 per call |
manual |
Zero-cost, manual copy-paste workflow | No | $0 |
ollama |
Local/private AI via Ollama's /api/chat endpoint |
No | $0 (local compute) |
See TASK 10.0 validation report for a detailed comparison of output quality, speed, and trade-offs.
How it works
.env generation
The helper generates a clean .env file with only the keys relevant to your chosen provider:
CHATGPT_MCP_PROVIDER=<selected>— always writtenOPENAI_API_KEY,OPENAI_MODEL— foropenaiprovider onlyOLLAMA_BASE_URL,OLLAMA_MODEL,OLLAMA_TEMPERATURE,OLLAMA_TIMEOUT— forollamaprovider only
If an existing .env file is detected, non-conflicting keys are preserved in a separate section. Provider-specific keys from the old file are not carried over.
.claude/settings.local.json generation
Optionally creates (or overwrites) a project-local Claude Code discovery config:
{
"mcpServers": {
"chatgpt-mcp": {
"command": "npm",
"args": ["start"]
}
}
}
You will be prompted before any file is created or overwritten. Existing files that are not settings.local.json (e.g., other MCP servers) are never modified.
Safety rules
- No secrets printed. API key input uses terminal masking; if displayed, it shows as
sk-***. - Confirmation required. You must explicitly confirm before any file is written.
- No network calls. The helper only reads/writes local files and prompts for input.
- No global settings changes. Only
.claude/settings.local.json(project-local). - Git-safe. Both
.envand.claude/are in.gitignore— nothing is committed.
Troubleshooting
"Setup helper requires an interactive terminal"
The helper detects whether stdin is a TTY. If you're piping or running in CI, configure manually via .env:
echo "CHATGPT_MCP_PROVIDER=openai" >> .env
echo "OPENAI_API_KEY=sk-your-key" >> .env
I want to change providers later
Either edit .env directly:
nano .env # change CHATGPT_MCP_PROVIDER and the provider-specific keys
Or re-run npm run setup — it will generate a new clean .env.
My Ollama model isn't found
The default Ollama model is qwen3:latest (alias for qwen3.6:35b-a3b). If yours isn't available, check with:
ollama list
Then set OLLAMA_MODEL in .env to one of your installed models.
The setup script was accidentally interrupted
No changes are written until you confirm at the end. If only partial writes happened, restore from git:
git checkout -- .env .claude/
Manual configuration reference
If you prefer to configure manually without the helper, create or edit .env with:
OpenAI
CHATGPT_MCP_PROVIDER=openai
OPENAI_API_KEY=sk-your-key-here
OPENAI_MODEL=gpt-5.1
OPENAI_TEMPERATURE=0.2
OPENAI_MAX_OUTPUT_TOKENS=2000
Manual Export
CHATGPT_MCP_PROVIDER=manual
Ollama
CHATGPT_MCP_PROVIDER=ollama
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_MODEL=qwen3:latest
OLLAMA_TEMPERATURE=0.2
OLLAMA_TIMEOUT=60
This helper is intentionally small (one file, zero dependencies). See the TASK 10.2 design for the full specification.