@apexmcp/cli
v0.1.3
Published
CLI tool for deploying MCP servers to ApexMCP
Maintainers
Readme
@apexmcp/cli
CLI tool for deploying MCP servers to ApexMCP.
✨ Features
- Simple Deployment: Deploy MCP servers with a single command
- Flexible Configuration: Support for environment files, custom domains, and URL strategies
- Deployment Management: View, update, and delete deployments from the CLI
- Authentication Management: Login/logout with persistent token storage
- MCP Server Management: Enable/disable and configure MCP servers from the catalog
- Plugin & Secret Management: Manage secrets and configurations for MCP servers
- MCP Interactions: List and call tools, read resources directly from the CLI
- Configuration Management: Persistent CLI settings and preferences
- Cross-platform: Works on any platform with Node.js
🚀 Installation
Global Installation (Recommended)
npm install -g @apexmcp/cli
# or
yarn global add @apexmcp/cli
# or
pnpm add -g @apexmcp/clinpx (One-time usage)
npx @apexmcp/cli deploy ./my-mcp-serverLocal Development
git clone <repo>
cd deploy-cli
bun install
bun run build
bun run cli --help🧪 Usage
Deploy an MCP Server
# Basic deployment
apexmcp deploy ./my-mcp-server
# With custom project name
apexmcp deploy ./my-mcp-server --project-name "My Custom MCP"
# With environment variables
apexmcp deploy ./my-mcp-server --env-file .env.production
# With custom domain and authentication
apexmcp deploy ./my-mcp-server --domain my-custom-domain.com --token your-auth-token
# Full example
apexmcp deploy ./my-mcp-server \
--project-name "My MCP Server" \
--env-file .env \
--url-strategy readable \
--endpoint https://deploy.apexmcp.dev \
--token eyJhbGciOiJIUzI1NiIs...Deployment Command Options
| Option | Description | Default |
| --------------------------- | --------------------------------------------------------------------------- | --------------------------- |
| --project-name <name> | Display name for the deployment | Derived from directory name |
| --env-file <file> | Environment variables file | None |
| --domain <domain> | Custom domain for deployment | None |
| --url-strategy <strategy> | URL generation strategy (readable, obscure, timestamp-only, random) | readable |
| --endpoint <url> | Deploy service endpoint | Configured endpoint |
| --token <token> | Authentication token | Configured token |
Authentication Commands
# Login with token
apexmcp login --token your-jwt-token
# Login with email/password (if supported)
apexmcp login --email [email protected] --password yourpassword
# Logout and clear credentials
apexmcp logout
# Show current authentication status
apexmcp whoamiMCP Server Management
# List all available MCP servers
apexmcp servers
# List enabled MCP servers for your organization
apexmcp servers:enabled
# Enable an MCP server
apexmcp servers:enable <catalog-id>
# Disable an MCP server
apexmcp servers:disable <catalog-id>
# Get detailed info about an MCP server
apexmcp servers:info <catalog-id>Deployment Management
# List all deployments
apexmcp list
# Get detailed status of a specific deployment (use the deployment ID from `apexmcp list`)
apexmcp status <deployment-id>
# Update deployment properties
apexmcp update <deployment-id> --name "New Name"
apexmcp update <deployment-id> --domain "new-domain.com"
apexmcp update <deployment-id> --env-file .env.production
# Delete a deployment (with confirmation)
apexmcp delete <deployment-id>
# Force delete without confirmation
apexmcp delete <deployment-id> --forceDeletion Process
When you delete a deployment, ApexMCP will:
- Mark as deleted in the ApexMCP database (status = 'deleted')
- Delete the Deno deployment from Deno Deploy
- Remove DNS records from Cloudflare
- Clear external references (project_id, URLs)
The CLI now calls the /api/deployments/:id DELETE endpoint using the deployment ID returned by apexmcp list, and the API handles all cleanup operations.
Plugin & Secret Management
# List secrets for an MCP server
apexmcp secrets <catalog-id>
# Set a secret for an MCP server
apexmcp secrets:set <catalog-id> <secret-key> <secret-value>
# Delete a secret for an MCP server
apexmcp secrets:delete <catalog-id> <secret-key>
# Delete entire plugin configuration
apexmcp plugins:delete <catalog-id>MCP Interactions
# List available tools
apexmcp tools
# Call a tool with parameters
apexmcp tools:call <tool-name> '{"param1": "value1", "param2": "value2"}'
# List available resources
apexmcp resources
# Read a specific resource
apexmcp resources:read <resource-uri>
# List resource templates
apexmcp resources:templatesConfiguration Management
# Show current configuration
apexmcp config get
# Set configuration values
apexmcp config set endpoints.core https://api.apexmcp.dev
apexmcp config set endpoints.deploy https://deploy.apexmcp.dev
apexmcp config set preferences.json true
# Reset configuration to defaults
apexmcp config resetURL Strategies
readable(default): Project name + date + random suffix (e.g.,my-project-241219ab.org-123.apexmcp.dev)obscure: Date + random characters only (e.g.,241219abcd.org-123.apexmcp.dev)timestamp-only: Clean date/time format (e.g.,2412191435.org-123.apexmcp.dev)random: Pure random characters (e.g.,a8b3c9d2ef.org-123.apexmcp.dev)
📁 Project Structure
Your MCP server project should have an entry point file. Configuration files are optional but recommended.
Minimal Project Structure
my-mcp-server/
├── main.ts # Entry point (or index.ts, server.ts, app.ts)
└── [other files...] # Additional source filesRecommended Project Structure
my-mcp-server/
├── deno.json # Optional: Deno configuration
├── package.json # Optional: Node.js configuration
├── main.ts # Entry point
├── README.md # Documentation
└── [other files...] # Additional source filesEntry Point Detection
The CLI automatically detects entry points in this order:
Configuration files (if present):
deno.json/deno.jsonc:mainorentryPointfieldpackage.json:main,module, orexports["."]field
Common filenames (fallback):
main.ts,main.jsindex.ts,index.jsserver.ts,server.jsapp.ts,app.js
Configuration Examples
deno.json:
{
"main": "main.ts",
"name": "my-mcp-server",
"version": "1.0.0"
}package.json:
{
"name": "my-mcp-server",
"version": "1.0.0",
"main": "server.js"
}deno.jsonc:
{
"main": "main.ts",
"name": "my-mcp-server"
}Supported Files
The CLI includes all project files in deployments, letting the deploy service decide what's acceptable. This includes:
- Source files:
.ts,.js,.mjs,.cjs, HTML, CSS, etc. - Configuration files:
deno.json,package.json,tsconfig.json, etc. - Documentation:
README.md,LICENSE,CHANGELOG.md - Package files: Lock files, manifest files, etc.
- Assets: Images, fonts, and other web assets
- Build outputs: Generated files from build processes
Excluded files: Temporary files, OS-specific files (.DS_Store, Thumbs.db), and development artifacts.
Note: The deploy service validates all files and may reject certain types or enforce size limits with clear error messages.
🔐 Authentication
Get your authentication token from the ApexMCP dashboard or your deployment service administrator.
📝 Scripts
bun run build- Build the CLI with tsupbun run cli- Run the CLI locallybun run dev- Build with watch modebun test- Run tests
Built with Commander.js. MIT License.
