Skip to content

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/cache

Configuration File

Create ~/.gm-mcp/config.json:

json
{
  "defaultTemplate": "advanced",
  "autoInstall": true,
  "registry": "https://registry.npmmirror.com"
}

Custom Templates

Creating Templates

  1. Create a new folder under templates/ directory
  2. Add necessary file structure
  3. Register template in configuration

Template Structure

templates/custom/
├── package.json
├── tsconfig.json
├── README.md
├── src/
│   └── index.ts
└── .gitignore

Batch 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
done

CI/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 --yes

Troubleshooting

Common Issues

  1. Permission Issues

    bash
    sudo npm install -g @studiogm/gm-mcp
  2. Network Issues

    bash
    npm config set registry https://registry.npmmirror.com
  3. Version Conflicts

    bash
    npm uninstall -g @studiogm/gm-mcp
    npm install -g @studiogm/gm-mcp@latest

Next Steps

Released under the MIT License