From dcc5735eb10a43499c5b6faff0aaac9b8d4f8952 Mon Sep 17 00:00:00 2001 From: "codegen-sh[bot]" <131295404+codegen-sh[bot]@users.noreply.github.com> Date: Fri, 15 Aug 2025 21:59:51 +0000 Subject: [PATCH 1/6] Add remote MCP server configuration documentation This adds documentation for the remote MCP server at mcp.codegen.com, including: - Configuration for Claude Code - Configuration for Cursor/Windsurf/VSCode forks - Updated transport options section with remote HTTP details Co-authored-by: Jay Hack --- docs/integrations/mcp.mdx | 72 +++++++++++++++++++++++++++++++++++---- 1 file changed, 66 insertions(+), 6 deletions(-) diff --git a/docs/integrations/mcp.mdx b/docs/integrations/mcp.mdx index d6b6a225e..6ebde7908 100644 --- a/docs/integrations/mcp.mdx +++ b/docs/integrations/mcp.mdx @@ -25,7 +25,9 @@ uv tool install codegen ## Configuration -### For Cline (VS Code Extension) +### Local MCP Server + +#### For Cline (VS Code Extension) Add this to your `cline_mcp_settings.json` file: @@ -41,7 +43,7 @@ Add this to your `cline_mcp_settings.json` file: } ``` -### For Claude Desktop +#### For Claude Desktop Under the `Settings` > `Feature` > `MCP Servers` section, click "Add New MCP Server" and add the following: @@ -49,7 +51,7 @@ Under the `Settings` > `Feature` > `MCP Servers` section, click "Add New MCP Ser - **Command**: `codegen` - **Arguments**: `["mcp"]` -### For Cursor +#### For Cursor To configure the Codegen MCP server in Cursor: @@ -75,6 +77,61 @@ Alternatively, you can add the configuration directly to your Cursor settings fi } ``` +### Remote MCP Server + +Codegen provides a hosted MCP server that you can connect to directly without running a local server. This is useful for cloud-based environments or when you prefer not to run a local server. + +#### For Claude Code + +To configure the remote Codegen MCP server in Claude Code: + +```bash +claude mcp add --transport http codegen-tools https://mcp.codegen.com/mcp/ --header "Authorization: Bearer " +``` + +Replace `` with your Codegen API key. + +#### For Cursor/Windsurf/VSCode Forks + +Add the following configuration to your settings: + +```json +{ + "mcp.servers": { + "codegen-remote": { + "transport": "http", + "url": "https://mcp.codegen.com/mcp/", + "headers": { + "Authorization": "Bearer " + } + } + } +} +``` + +Replace `` with your Codegen API key. + +#### For VSCode with MCP Extension + +If you're using VSCode with an MCP extension, add this to your settings.json: + +```json +{ + "mcp.servers": [ + { + "name": "codegen-remote", + "transport": "http", + "url": "https://mcp.codegen.com/mcp/", + "headers": { + "Authorization": "Bearer " + } + } + ] +} +``` + +Replace `` with your Codegen API key. + ## Usage ### Starting the Server @@ -131,12 +188,15 @@ The MCP server supports two transport methods: - Best for most AI agents and IDE integrations - Direct communication through standard input/output - No network configuration required +- Ideal for local development environments ### HTTP -- Useful for web-based integrations -- Requires specifying host and port -- Currently falls back to stdio (HTTP support coming soon) +- Useful for web-based integrations and remote connections +- Available as both a local server (by specifying host and port) and a hosted service +- Remote HTTP endpoint: `https://mcp.codegen.com/mcp/` +- Requires authentication via Bearer token in the Authorization header +- Enables cloud-based environments to connect to Codegen services ## Authentication From ccd67d092f05aca26da92b7da9301b5bbb90b591 Mon Sep 17 00:00:00 2001 From: "codegen-sh[bot]" <131295404+codegen-sh[bot]@users.noreply.github.com> Date: Fri, 15 Aug 2025 22:03:13 +0000 Subject: [PATCH 2/6] Update docs.json to include MCP in sidebar navigation Added integrations/mcp to the sidebar navigation in docs.json so it appears in the documentation sidebar. Co-authored-by: Jay Hack --- docs/docs.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/docs.json b/docs/docs.json index 52b11ea2b..46d2732d0 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -38,7 +38,8 @@ "integrations/figma", "integrations/circleci", "integrations/web-search", - "integrations/postgres" + "integrations/postgres", + "integrations/mcp" ] }, { From 99a661f50808a97b9f29edac566cd096789fe072 Mon Sep 17 00:00:00 2001 From: "codegen-sh[bot]" <131295404+codegen-sh[bot]@users.noreply.github.com> Date: Sun, 17 Aug 2025 20:23:08 +0000 Subject: [PATCH 3/6] Remove remote MCP server documentation As requested, removed all references to the remote MCP server: - Removed the Remote MCP Server section with configuration for Claude Code and VSCode forks - Reverted the Transport Options section to remove remote HTTP endpoint details - Restored original heading structure Co-authored-by: Jay Hack --- docs/integrations/mcp.mdx | 71 ++++----------------------------------- 1 file changed, 6 insertions(+), 65 deletions(-) diff --git a/docs/integrations/mcp.mdx b/docs/integrations/mcp.mdx index 6ebde7908..96953a2b4 100644 --- a/docs/integrations/mcp.mdx +++ b/docs/integrations/mcp.mdx @@ -25,9 +25,7 @@ uv tool install codegen ## Configuration -### Local MCP Server - -#### For Cline (VS Code Extension) +### For Cline (VS Code Extension) Add this to your `cline_mcp_settings.json` file: @@ -43,7 +41,7 @@ Add this to your `cline_mcp_settings.json` file: } ``` -#### For Claude Desktop +### For Claude Desktop Under the `Settings` > `Feature` > `MCP Servers` section, click "Add New MCP Server" and add the following: @@ -51,7 +49,7 @@ Under the `Settings` > `Feature` > `MCP Servers` section, click "Add New MCP Ser - **Command**: `codegen` - **Arguments**: `["mcp"]` -#### For Cursor +### For Cursor To configure the Codegen MCP server in Cursor: @@ -77,61 +75,6 @@ Alternatively, you can add the configuration directly to your Cursor settings fi } ``` -### Remote MCP Server - -Codegen provides a hosted MCP server that you can connect to directly without running a local server. This is useful for cloud-based environments or when you prefer not to run a local server. - -#### For Claude Code - -To configure the remote Codegen MCP server in Claude Code: - -```bash -claude mcp add --transport http codegen-tools https://mcp.codegen.com/mcp/ --header "Authorization: Bearer " -``` - -Replace `` with your Codegen API key. - -#### For Cursor/Windsurf/VSCode Forks - -Add the following configuration to your settings: - -```json -{ - "mcp.servers": { - "codegen-remote": { - "transport": "http", - "url": "https://mcp.codegen.com/mcp/", - "headers": { - "Authorization": "Bearer " - } - } - } -} -``` - -Replace `` with your Codegen API key. - -#### For VSCode with MCP Extension - -If you're using VSCode with an MCP extension, add this to your settings.json: - -```json -{ - "mcp.servers": [ - { - "name": "codegen-remote", - "transport": "http", - "url": "https://mcp.codegen.com/mcp/", - "headers": { - "Authorization": "Bearer " - } - } - ] -} -``` - -Replace `` with your Codegen API key. - ## Usage ### Starting the Server @@ -192,11 +135,9 @@ The MCP server supports two transport methods: ### HTTP -- Useful for web-based integrations and remote connections -- Available as both a local server (by specifying host and port) and a hosted service -- Remote HTTP endpoint: `https://mcp.codegen.com/mcp/` -- Requires authentication via Bearer token in the Authorization header -- Enables cloud-based environments to connect to Codegen services +- Useful for web-based integrations +- Requires specifying host and port +- Currently falls back to stdio (HTTP support coming soon) ## Authentication From 282df488f1e1a6b38218d6bbb6a1e5ca06048e00 Mon Sep 17 00:00:00 2001 From: "codegen-sh[bot]" <131295404+codegen-sh[bot]@users.noreply.github.com> Date: Sun, 17 Aug 2025 20:32:04 +0000 Subject: [PATCH 4/6] Update MCP documentation to focus exclusively on remote MCP server - Completely rewrote the documentation to focus only on the remote MCP server - Removed all local MCP server configuration and usage instructions - Updated title and description to reflect remote MCP focus - Added cloud-based integration benefits to the overview - Simplified troubleshooting section to focus on remote-specific issues Co-authored-by: Jay Hack --- docs/integrations/mcp.mdx | 151 +++++++++++--------------------------- 1 file changed, 42 insertions(+), 109 deletions(-) diff --git a/docs/integrations/mcp.mdx b/docs/integrations/mcp.mdx index 96953a2b4..7a21f4e19 100644 --- a/docs/integrations/mcp.mdx +++ b/docs/integrations/mcp.mdx @@ -1,115 +1,81 @@ --- -title: "MCP Server" -description: "Connect AI agents to Codegen using the Model Context Protocol (MCP) server" +title: "Remote MCP Server" +description: "Connect AI agents to Codegen using the hosted Model Context Protocol (MCP) server" icon: "server" --- -The Codegen MCP server enables AI agents to interact with the Codegen platform through the Model Context Protocol (MCP). This integration allows AI agents to access Codegen APIs, manage agent runs, and interact with your development workflow. +Codegen provides a hosted MCP server that allows AI agents to interact with the Codegen platform through the Model Context Protocol (MCP). This integration enables AI agents to access Codegen APIs, manage agent runs, and interact with your development workflow without running a local server. ## Overview -The MCP server provides: +The remote MCP server provides: +- **Cloud-Based Integration**: Access Codegen services from anywhere without local setup - **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 +## Configuration + +### For Claude Code -The MCP server is included with the Codegen CLI. Install it using: +To configure the remote Codegen MCP server in Claude Code: ```bash -uv tool install codegen +claude mcp add --transport http codegen-tools https://mcp.codegen.com/mcp/ --header "Authorization: Bearer " ``` -## Configuration +Replace `` with your Codegen API key. -### For Cline (VS Code Extension) +### For Cursor/Windsurf/VSCode Forks -Add this to your `cline_mcp_settings.json` file: +Add the following configuration to your settings: ```json { - "mcpServers": { - "codegen": { - "command": "codegen", - "args": ["mcp"], - "cwd": "" + "mcp.servers": { + "codegen-remote": { + "transport": "http", + "url": "https://mcp.codegen.com/mcp/", + "headers": { + "Authorization": "Bearer " + } } } } ``` -### For Claude Desktop - -Under the `Settings` > `Feature` > `MCP Servers` section, click "Add New MCP Server" and add the following: +Replace `` with your Codegen API key. -- **Server Name**: codegen-mcp -- **Command**: `codegen` -- **Arguments**: `["mcp"]` +### For VSCode with MCP Extension -### For Cursor - -To configure the Codegen MCP server in Cursor: - -1. Open Cursor Settings (Cmd/Ctrl + ,) -2. Navigate to `Features` > `Model Context Protocol` -3. Click "Add Server" and configure: - - **Server Name**: `codegen-mcp` - - **Command**: `codegen` - - **Arguments**: `["mcp"]` - - **Working Directory**: `` (optional) - -Alternatively, you can add the configuration directly to your Cursor settings file: +If you're using VSCode with an MCP extension, add this to your settings.json: ```json { - "mcp.servers": { - "codegen": { - "command": "codegen", - "args": ["mcp"], - "cwd": "" + "mcp.servers": [ + { + "name": "codegen-remote", + "transport": "http", + "url": "https://mcp.codegen.com/mcp/", + "headers": { + "Authorization": "Bearer " + } } - } + ] } ``` -## Usage - -### Starting the Server - -Start the MCP server using the Codegen CLI: - -```bash -# Start with stdio transport (default) -codegen mcp - -# Start with HTTP transport on a specific port -codegen mcp --transport http --port 8080 - -# Start with custom host and port -codegen mcp --transport http --host 0.0.0.0 --port 3000 -``` - -The server will display the transport method and port information when it starts: - -``` -🚀 Starting Codegen MCP server... -📡 Using stdio transport -🚀 MCP server running on stdio transport -``` - -### Environment Variables +Replace `` with your Codegen API key. -Configure the MCP server using these environment variables: +## Authentication -- `CODEGEN_API_KEY`: Your Codegen API key for authentication -- `CODEGEN_API_BASE_URL`: Base URL for the Codegen API (defaults to `https://api.codegen.com`) +The remote MCP server uses your Codegen API key for authentication. You can obtain your API key from the [Codegen dashboard](https://codegen.com/settings). ## Available Tools -The MCP server provides the following tools for AI agents: +The remote MCP server provides the following tools for AI agents: ### Agent Management @@ -122,58 +88,25 @@ The MCP server provides the following tools for AI agents: - **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 -- Ideal for local development environments - -### 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](https://codegen.com/settings). - -Set your API key as an environment variable: - -```bash -export CODEGEN_API_KEY="your-api-key-here" -``` - ## 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 - **Authentication errors** - Verify your API key is valid and not expired - Check that the API key has the necessary permissions -- Ensure the `CODEGEN_API_KEY` environment variable is set +- Ensure the Authorization header is correctly formatted **Connection issues** -- For stdio transport, ensure your AI agent supports MCP -- For HTTP transport, check firewall settings and port availability -- Verify the host and port configuration +- Check your network connectivity to mcp.codegen.com +- Verify the URL is correctly specified +- Ensure your AI agent supports HTTP transport for MCP ### Getting Help -If you encounter issues with the MCP server: +If you encounter issues with the remote MCP server: 1. Check the [Codegen documentation](https://docs.codegen.com) 2. Join our [community Slack](https://community.codegen.com) @@ -210,4 +143,4 @@ If you encounter issues with the MCP server: } ``` -The MCP server makes it easy to integrate Codegen's powerful AI development capabilities into your existing AI agent workflows. +The remote MCP server makes it easy to integrate Codegen's powerful AI development capabilities into your existing AI agent workflows without the need to run a local server. From b195458457918d265df6bb5d8510a7ff8f282290 Mon Sep 17 00:00:00 2001 From: "codegen-sh[bot]" <131295404+codegen-sh[bot]@users.noreply.github.com> Date: Sun, 17 Aug 2025 20:32:33 +0000 Subject: [PATCH 5/6] Update docs.json to display 'Remote MCP Server' in sidebar Updated the sidebar entry for the MCP documentation to display 'Remote MCP Server' instead of the default filename. Co-authored-by: Jay Hack --- docs/docs.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/docs.json b/docs/docs.json index 46d2732d0..47845451f 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -39,7 +39,10 @@ "integrations/circleci", "integrations/web-search", "integrations/postgres", - "integrations/mcp" + { + "group": "integrations/mcp", + "name": "Remote MCP Server" + } ] }, { From 3f8c6e0627a561ce89f22e72303c479b9bd814df Mon Sep 17 00:00:00 2001 From: jayhack Date: Sun, 17 Aug 2025 13:38:48 -0700 Subject: [PATCH 6/6] . --- docs/integrations/mcp.mdx | 58 --------------------------------------- 1 file changed, 58 deletions(-) diff --git a/docs/integrations/mcp.mdx b/docs/integrations/mcp.mdx index 7a21f4e19..553d0f095 100644 --- a/docs/integrations/mcp.mdx +++ b/docs/integrations/mcp.mdx @@ -77,33 +77,6 @@ The remote MCP server uses your Codegen API key for authentication. You can obta The remote 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 - -## Troubleshooting - -### Common Issues - -**Authentication errors** - -- Verify your API key is valid and not expired -- Check that the API key has the necessary permissions -- Ensure the Authorization header is correctly formatted - -**Connection issues** - -- Check your network connectivity to mcp.codegen.com -- Verify the URL is correctly specified -- Ensure your AI agent supports HTTP transport for MCP - ### Getting Help If you encounter issues with the remote MCP server: @@ -112,35 +85,4 @@ If you encounter issues with the remote MCP server: 2. Join our [community Slack](https://community.codegen.com) 3. Report issues on [GitHub](https://github.com/codegen-sh/codegen) -## Examples - -### Creating an Agent Run - -```python -# Example of how an AI agent might use the MCP server -# This would be handled automatically by your AI agent - -{ - "tool": "create_agent_run", - "arguments": { - "org_id": 123, - "prompt": "Review the latest pull request and suggest improvements", - "repo_name": "my-project", - "branch_name": "feature-branch" - } -} -``` - -### Getting Organization Information - -```python -{ - "tool": "get_organizations", - "arguments": { - "page": 1, - "limit": 10 - } -} -``` - The remote MCP server makes it easy to integrate Codegen's powerful AI development capabilities into your existing AI agent workflows without the need to run a local server.