@flexweg/mcp-cli
v1.0.14
Published
CLI tool to configure Flexweg MCP server in AI coding assistants (Claude Code, Cursor, Windsurf, VSCode)
Maintainers
Readme
@flexweg/mcp-cli
CLI tool to configure Flexweg MCP server in AI coding assistants
What is this?
This CLI tool helps you quickly set up Flexweg MCP server in your AI coding assistant (Claude Code, Cursor, Windsurf, VSCode, Codex).
With one simple command, you can start deploying and managing HTML files directly from your AI assistant!
Quick Start
# Interactive setup (recommended)
npx -y @flexweg/mcp-cli init
# Specific IDE
npx -y @flexweg/mcp-cli init cursor
npx -y @flexweg/mcp-cli init windsurf
npx -y @flexweg/mcp-cli init vscode
npx -y @flexweg/mcp-cli init codexThat's it! The CLI will guide you through the rest.
Features
- 🎯 One-command setup - No manual config editing
- 🔐 Secure authentication - API key validation & temporary key generation
- 🤖 Multi-IDE support - Works with Claude Code, Cursor, Windsurf, VSCode, Codex
- ✨ Interactive wizard - Guides you step-by-step
- 📝 Auto-gitignore - Excludes sensitive config files automatically
Supported AI Assistants
| IDE | Config Scope | Setup Command |
|-----|-------------|---------------|
| Claude Code | Project | npx @flexweg/mcp-cli init |
| Cursor | Project | npx @flexweg/mcp-cli init cursor |
| Windsurf | Project | npx @flexweg/mcp-cli init windsurf |
| VSCode | Project | npx @flexweg/mcp-cli init vscode |
| Codex | Project | npx @flexweg/mcp-cli init codex |
What Does It Do?
The CLI configures your AI assistant to connect to Flexweg MCP server, giving it access to tools like:
- publish_html - Publish HTML pages (temporary, 1h auto-delete)
- list_files - List all files in your storage
- get_file_content - Read file content
- upload_file - Create or update files
- rename_file - Rename or move files
- delete_file - Delete files
- create_folder - Create directories
- rename_folder - Rename directories
- delete_folder - Delete directories
After setup, you can simply ask your AI assistant:
"Deploy this HTML page to Flexweg"
"Show me all my files on Flexweg"
"Update the index.html file on Flexweg"
Usage
Interactive Mode (Recommended)
npx @flexweg/mcp-cli initThe wizard will:
- Ask which IDE you want to configure
- Guide you through API key setup (3 options):
- Enter existing API key
- Generate temporary key (24h, requires login)
- Open dashboard to copy permanent key
- Verify your API key
- Write configuration files
- Show next steps
Non-Interactive Mode
# With existing API key
npx @flexweg/mcp-cli init cursor --api-key=abc123...
# Trust Codex project
npx @flexweg/mcp-cli init codex --trust-project --api-key=abc123...Environment Variables
# Use custom Flexweg instance (self-hosted)
FLEXWEG_BASE_URL=https://my-flexweg.com npx @flexweg/mcp-cli init
# Use API key from environment
FLEXWEG_API_KEY=abc123... npx @flexweg/mcp-cli init --api-key=$FLEXWEG_API_KEYConfiguration Files
The CLI creates different config files depending on the IDE:
Claude Code (Project-level)
.mcp.json
.claude/
skills/
flexweg-hosting/
SKILL.md
commands/
flexweg.md
.gitignore (updated).mcp.json example:
{
"mcpServers": {
"flexweg": {
"type": "http",
"url": "https://www.flexweg.com/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}Important: Claude Code VSCode extension requires version 2.1.0+ for MCP HTTP transport to work correctly.
Cursor (Project-level)
.cursor/mcp.json
.gitignore (updated)Windsurf (Project-level)
.windsurf/mcp.json
.gitignore (updated)VSCode (Project-level)
.vscode/settings.json
.gitignore (updated)Codex (Project-level)
.codex/mcp.json
.codex/.trusted (if --trust-project flag used)
.gitignore (updated)API Key Management
Option 1: Existing API Key
Get your permanent API key from Flexweg Dashboard.
npx @flexweg/mcp-cli init --api-key=YOUR_64_CHAR_API_KEYOption 2: Generate Temporary Key
The CLI can generate a 24-hour temporary API key:
npx @flexweg/mcp-cli init
# Select: "Generate a temporary API key (24h)"
# Enter email & passwordOption 3: Open Dashboard
The CLI can open your browser to the API keys page:
npx @flexweg/mcp-cli init
# Select: "Open dashboard to get my API key"
# Copy your key from the browser
# Paste when promptedSecurity
- API keys are validated before writing config
- Config files are auto-gitignored to prevent accidental commits
- Keys are stored locally in config files (not sent to Flexweg CLI servers)
- Use temporary keys for short-term projects or testing
⚠️ Never commit API keys to version control!
Command Reference
# Show help
npx @flexweg/mcp-cli --help
# Show version
npx @flexweg/mcp-cli --version
# Initialize with options
npx @flexweg/mcp-cli init [ide] [options]
Options:
--api-key=KEY Use existing API key
--trust-project Trust project (Codex only)
--help, -h Show help message
--version, -v Show version numberTroubleshooting
Claude Code: "No running MCP servers" or "flexweg failed"
Most common issue: Outdated VSCode extension version.
Solution:
- Open VSCode
- Go to Extensions (Cmd+Shift+X / Ctrl+Shift+X)
- Search for "Claude Code"
- Click "Update" button (if available)
- Restart VSCode
Required version: 2.1.0 or higher (version 2.0.37 and earlier have broken MCP HTTP transport)
Check your version:
ls ~/.vscode/extensions/ | grep anthropic.claude-code
# Should show: anthropic.claude-code-2.1.X-...The CLI automatically warns you if your extension is outdated during setup.
"Invalid API key format"
Flexweg API keys are 64 hexadecimal characters. Make sure you copied the full key from your dashboard.
"API key verification failed"
- Check your internet connection
- Verify the API key is active in your dashboard
- Try generating a new temporary key
"Permission denied" errors
- Make sure you have write permissions in the project directory
- Make sure you have write permissions in the project directory
Config not detected by IDE
- Claude Code: Ensure
.mcp.jsonis in project root, restart VSCode, run/mcpcommand - Cursor: Ensure
.cursor/mcp.jsonis in project root, restart Cursor - Windsurf: Ensure
.windsurf/mcp.jsonis in project root, restart Windsurf - VSCode/Codex: Restart the application
Self-hosted Flexweg instance
FLEXWEG_BASE_URL=https://your-instance.com npx @flexweg/mcp-cli initDevelopment
# Clone the repo
git clone https://github.com/fleweg/static-host.git
cd static-host/mcp-cli
# Install dependencies
npm install
# Link for local testing
npm link
# Test locally
flexweg-mcp init
# Or run directly
node bin/flexweg.js initRequirements
- Node.js >= 18.0.0
- Internet connection (for API key verification)
- One of the supported AI assistants installed
Links
- Flexweg Website: flexweg.com
- MCP Documentation: flexweg.com/docs/mcp
- API Keys Dashboard: flexweg.com/account/api-keys
License
MIT © Flexweg Team
Contributing
Contributions are welcome! Please read our contributing guidelines and submit pull requests to our GitHub repository.
Made with ❤️ by the Flexweg team
