Advanced Usage
Explore advanced features and customization options of gm-mcp.
Custom Configuration
Environment Variables
bash
export NPM_REGISTRY=https://registry.npmmirror.com
export GM_MCP_CACHE_DIR=~/.gm-mcp/cacheConfiguration File
Create ~/.gm-mcp/config.json:
json
{
"defaultTemplate": "advanced",
"autoInstall": true,
"registry": "https://registry.npmmirror.com"
}Custom Templates
Creating Templates
- Create a new folder under
templates/directory - Add necessary file structure
- Register template in configuration
Template Structure
templates/custom/
├── package.json
├── tsconfig.json
├── README.md
├── src/
│ └── index.ts
└── .gitignoreBatch Creation
Use scripts to create projects in batch:
bash
#!/bin/bash
projects=("project1" "project2" "project3")
for project in "${projects[@]}"; do
gm-mcp init "$project" --template basic --yes
doneCI/CD Integration
GitHub Actions
yaml
name: Create MCP Project
on: [push]
jobs:
create-project:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '18'
- run: npm install -g @studiogm/gm-mcp
- run: gm-mcp init my-project --template advanced --yesTroubleshooting
Common Issues
Permission Issues
bashsudo npm install -g @studiogm/gm-mcpNetwork Issues
bashnpm config set registry https://registry.npmmirror.comVersion Conflicts
bashnpm uninstall -g @studiogm/gm-mcp npm install -g @studiogm/gm-mcp@latest
Next Steps
- API Reference - View all commands
- Template Overview - Learn about template details