Overview
The MCP server provides:- API Integration: Direct access to Codegen platform APIs
- Agent Management: Create and monitor agent runs
- Organization Management: Access organization and user information
- Workflow Integration: Seamless integration with AI development tools
Installation
The MCP server is included with the Codegen CLI. Install it using:Configuration
For Cline (VS Code Extension)
Add this to yourcline_mcp_settings.json file:
For Claude Desktop
Under theSettings > Feature > MCP Servers section, click “Add New MCP Server” and add the following:
- Server Name: codegen-mcp
- Command:
codegen - Arguments:
["mcp"]
For Cursor
To configure the Codegen MCP server in Cursor:- Open Cursor Settings (Cmd/Ctrl + ,)
- Navigate to
Features>Model Context Protocol - Click “Add Server” and configure:
- Server Name:
codegen-mcp - Command:
codegen - Arguments:
["mcp"] - Working Directory:
<path to your project>(optional)
- Server Name:
Usage
Starting the Server
Start the MCP server using the Codegen CLI:Environment Variables
Configure the MCP server using these environment variables:CODEGEN_API_KEY: Your Codegen API key for authenticationCODEGEN_API_BASE_URL: Base URL for the Codegen API (defaults tohttps://api.codegen.com)
Available Tools
The MCP server provides the following tools for AI agents:Agent Management
- create_agent_run: Create a new agent run in your organization
- get_agent_run: Get details of a specific agent run
Organization Management
- get_organizations: List organizations you have access to
- get_users: List users in an organization
- get_user: Get details of a specific user
Transport Options
The MCP server supports two transport methods:stdio (Default)
- Best for most AI agents and IDE integrations
- Direct communication through standard input/output
- No network configuration required
HTTP
- Useful for web-based integrations
- Requires specifying host and port
- Currently falls back to stdio (HTTP support coming soon)
Authentication
The MCP server uses your Codegen API key for authentication. You can obtain your API key from the Codegen dashboard. Set your API key as an environment variable:Troubleshooting
Common Issues
Server won’t start- Ensure the Codegen CLI is properly installed
- Check that your API key is set correctly
- Verify network connectivity to the Codegen API
- Verify your API key is valid and not expired
- Check that the API key has the necessary permissions
- Ensure the
CODEGEN_API_KEYenvironment variable is set
- For stdio transport, ensure your AI agent supports MCP
- For HTTP transport, check firewall settings and port availability
- Verify the host and port configuration
Getting Help
If you encounter issues with the MCP server:- Check the Codegen documentation
- Join our community Slack
- Report issues on GitHub