Get the FREE Ultimate OpenClaw Setup Guide →

codeglide gen

Generation of Secure MCP (Model Context Protocol) Servers from API source code at Scale

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio codeglide-codeglide-mcpgen npx -y CodeGlide/codeglide-mcpgen@v1.0.10 \
  --env CREATE_PR="Whether to create a PR for the generated MCP server" \
  --env CUSTOM_HEADERS="Optional headers for API requests during generation" \
  --env INPUT_DIRECTORY="Path to the API source directory (defaults to project root in CI)" \
  --env CREATE_BRANCH_AND_COMMIT="Whether to create a new branch and commit the generated MCP server"

How to use

CodeGlide's MCP generator action analyzes your API source code and produces MCP servers from it. It can extract Swagger specifications and wire up MCP server implementations based on your API surface, then package the result into a generated-mcp artifact ready for deployment or further customization. The action supports inputs for specifying the source directory, optional custom headers to access private APIs, and flags to create a pull request or a branch with the generated MCP server changes. After running, you’ll typically obtain an artifact named generated-mcp that contains the MCP server ready to run in your environment. Use the generated MCP server with your standard MCP runtime (Node-based or your preferred MCP runtime) according to your project’s deployment pipeline.

How to install

Prerequisites:

  • Node.js (recommended) and npm installed on your machine or CI environment.

Installation steps:

  1. Ensure Node.js is installed. You can install via:

    • macOS: brew install node
    • Windows: download from nodejs.org
    • Linux: use your distribution's package manager or Node Version Manager (nvm)
  2. Run the generator using npx (no global install required):

    npx -y CodeGlide/codeglide-mcpgen@v1.0.10 \
      --input_directory ./api \
      --custom_headers "Authorization: Bearer TOKEN" \
      --create_pr true \
      --create_branch_and_commit true
    
  3. If you prefer a local npm-based workflow (alternative):

    npm init -y
    npm install -D CodeGlide/codeglide-mcpgen@v1.0.10
    npx CodeGlide/codeglide-mcpgen@v1.0.10 --input_directory ./api --custom_headers "" --create_pr=false --create_branch_and_commit=false
    
  4. After generation, locate the generated-mcp artifact in your workflow or output directory and deploy it according to your MCP runtime environment.

Additional notes

Tips and common issues:

  • Ensure your API source directory is accessible to the generator (correct paths in input_directory).
  • If your API requires authentication, provide custom_headers with appropriate tokens; consider masking sensitive data in CI logs.
  • The generator may produce Swagger specs as part of the MCP server; review the generatedSwagger.json if needed.
  • If you enable create_pr or create_branch_and_commit, ensure the generator runner has git permissions in your repository.
  • Verify the generated MCP server compatibility with your MCP runtime version and any framework version constraints.
  • The output artifact is typically named generated-mcp and should be committed or deployed as part of your release pipeline.
Sponsor this space

Reach thousands of developers