Skip to content

Commit 1a13544

Browse files
Add remote MCP server configuration documentation (#1199)
Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com> Co-authored-by: Jay Hack <jay@codegen.com> Co-authored-by: Jay Hack <jayhack@users.noreply.github.com> Co-authored-by: jayhack <jayhack.0@gmail.com>
1 parent 54385b7 commit 1a13544

File tree

2 files changed

+43
-163
lines changed

2 files changed

+43
-163
lines changed

docs/docs.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@
3838
"integrations/figma",
3939
"integrations/circleci",
4040
"integrations/web-search",
41-
"integrations/postgres"
41+
"integrations/postgres",
42+
{
43+
"group": "integrations/mcp",
44+
"name": "Remote MCP Server"
45+
}
4246
]
4347
},
4448
{

docs/integrations/mcp.mdx

Lines changed: 38 additions & 162 deletions
Original file line numberDiff line numberDiff line change
@@ -1,212 +1,88 @@
11
---
2-
title: "MCP Server"
3-
description: "Connect AI agents to Codegen using the Model Context Protocol (MCP) server"
2+
title: "Remote MCP Server"
3+
description: "Connect AI agents to Codegen using the hosted Model Context Protocol (MCP) server"
44
icon: "server"
55
---
66

7-
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.
7+
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.
88

99
## Overview
1010

11-
The MCP server provides:
11+
The remote MCP server provides:
1212

13+
- **Cloud-Based Integration**: Access Codegen services from anywhere without local setup
1314
- **API Integration**: Direct access to Codegen platform APIs
1415
- **Agent Management**: Create and monitor agent runs
1516
- **Organization Management**: Access organization and user information
1617
- **Workflow Integration**: Seamless integration with AI development tools
1718

18-
## Installation
19+
## Configuration
20+
21+
### For Claude Code
1922

20-
The MCP server is included with the Codegen CLI. Install it using:
23+
To configure the remote Codegen MCP server in Claude Code:
2124

2225
```bash
23-
uv tool install codegen
26+
claude mcp add --transport http codegen-tools https://mcp.codegen.com/mcp/ --header "Authorization: Bearer <auth token>"
2427
```
2528

26-
## Configuration
29+
Replace `<auth token>` with your Codegen API key.
2730

28-
### For Cline (VS Code Extension)
31+
### For Cursor/Windsurf/VSCode Forks
2932

30-
Add this to your `cline_mcp_settings.json` file:
33+
Add the following configuration to your settings:
3134

3235
```json
3336
{
34-
"mcpServers": {
35-
"codegen": {
36-
"command": "codegen",
37-
"args": ["mcp"],
38-
"cwd": "<path to your project>"
37+
"mcp.servers": {
38+
"codegen-remote": {
39+
"transport": "http",
40+
"url": "https://mcp.codegen.com/mcp/",
41+
"headers": {
42+
"Authorization": "Bearer <auth token>"
43+
}
3944
}
4045
}
4146
}
4247
```
4348

44-
### For Claude Desktop
45-
46-
Under the `Settings` > `Feature` > `MCP Servers` section, click "Add New MCP Server" and add the following:
47-
48-
- **Server Name**: codegen-mcp
49-
- **Command**: `codegen`
50-
- **Arguments**: `["mcp"]`
51-
52-
### For Cursor
53-
54-
To configure the Codegen MCP server in Cursor:
49+
Replace `<auth token>` with your Codegen API key.
5550

56-
1. Open Cursor Settings (Cmd/Ctrl + ,)
57-
2. Navigate to `Features` > `Model Context Protocol`
58-
3. Click "Add Server" and configure:
59-
- **Server Name**: `codegen-mcp`
60-
- **Command**: `codegen`
61-
- **Arguments**: `["mcp"]`
62-
- **Working Directory**: `<path to your project>` (optional)
51+
### For VSCode with MCP Extension
6352

64-
Alternatively, you can add the configuration directly to your Cursor settings file:
53+
If you're using VSCode with an MCP extension, add this to your settings.json:
6554

6655
```json
6756
{
68-
"mcp.servers": {
69-
"codegen": {
70-
"command": "codegen",
71-
"args": ["mcp"],
72-
"cwd": "<path to your project>"
57+
"mcp.servers": [
58+
{
59+
"name": "codegen-remote",
60+
"transport": "http",
61+
"url": "https://mcp.codegen.com/mcp/",
62+
"headers": {
63+
"Authorization": "Bearer <auth token>"
64+
}
7365
}
74-
}
66+
]
7567
}
7668
```
7769

78-
## Usage
79-
80-
### Starting the Server
81-
82-
Start the MCP server using the Codegen CLI:
83-
84-
```bash
85-
# Start with stdio transport (default)
86-
codegen mcp
87-
88-
# Start with HTTP transport on a specific port
89-
codegen mcp --transport http --port 8080
90-
91-
# Start with custom host and port
92-
codegen mcp --transport http --host 0.0.0.0 --port 3000
93-
```
94-
95-
The server will display the transport method and port information when it starts:
96-
97-
```
98-
🚀 Starting Codegen MCP server...
99-
📡 Using stdio transport
100-
🚀 MCP server running on stdio transport
101-
```
102-
103-
### Environment Variables
104-
105-
Configure the MCP server using these environment variables:
106-
107-
- `CODEGEN_API_KEY`: Your Codegen API key for authentication
108-
- `CODEGEN_API_BASE_URL`: Base URL for the Codegen API (defaults to `https://api.codegen.com`)
109-
110-
## Available Tools
111-
112-
The MCP server provides the following tools for AI agents:
113-
114-
### Agent Management
115-
116-
- **create_agent_run**: Create a new agent run in your organization
117-
- **get_agent_run**: Get details of a specific agent run
118-
119-
### Organization Management
120-
121-
- **get_organizations**: List organizations you have access to
122-
- **get_users**: List users in an organization
123-
- **get_user**: Get details of a specific user
124-
125-
## Transport Options
126-
127-
The MCP server supports two transport methods:
128-
129-
### stdio (Default)
130-
131-
- Best for most AI agents and IDE integrations
132-
- Direct communication through standard input/output
133-
- No network configuration required
134-
135-
### HTTP
136-
137-
- Useful for web-based integrations
138-
- Requires specifying host and port
139-
- Currently falls back to stdio (HTTP support coming soon)
70+
Replace `<auth token>` with your Codegen API key.
14071

14172
## Authentication
14273

143-
The MCP server uses your Codegen API key for authentication. You can obtain your API key from the [Codegen dashboard](https://codegen.com/settings).
144-
145-
Set your API key as an environment variable:
146-
147-
```bash
148-
export CODEGEN_API_KEY="your-api-key-here"
149-
```
150-
151-
## Troubleshooting
152-
153-
### Common Issues
154-
155-
**Server won't start**
156-
157-
- Ensure the Codegen CLI is properly installed
158-
- Check that your API key is set correctly
159-
- Verify network connectivity to the Codegen API
160-
161-
**Authentication errors**
162-
163-
- Verify your API key is valid and not expired
164-
- Check that the API key has the necessary permissions
165-
- Ensure the `CODEGEN_API_KEY` environment variable is set
74+
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).
16675

167-
**Connection issues**
76+
## Available Tools
16877

169-
- For stdio transport, ensure your AI agent supports MCP
170-
- For HTTP transport, check firewall settings and port availability
171-
- Verify the host and port configuration
78+
The remote MCP server provides the following tools for AI agents:
17279

17380
### Getting Help
17481

175-
If you encounter issues with the MCP server:
82+
If you encounter issues with the remote MCP server:
17683

17784
1. Check the [Codegen documentation](https://docs.codegen.com)
17885
2. Join our [community Slack](https://community.codegen.com)
17986
3. Report issues on [GitHub](https://github.com/codegen-sh/codegen)
18087

181-
## Examples
182-
183-
### Creating an Agent Run
184-
185-
```python
186-
# Example of how an AI agent might use the MCP server
187-
# This would be handled automatically by your AI agent
188-
189-
{
190-
"tool": "create_agent_run",
191-
"arguments": {
192-
"org_id": 123,
193-
"prompt": "Review the latest pull request and suggest improvements",
194-
"repo_name": "my-project",
195-
"branch_name": "feature-branch"
196-
}
197-
}
198-
```
199-
200-
### Getting Organization Information
201-
202-
```python
203-
{
204-
"tool": "get_organizations",
205-
"arguments": {
206-
"page": 1,
207-
"limit": 10
208-
}
209-
}
210-
```
211-
212-
The MCP server makes it easy to integrate Codegen's powerful AI development capabilities into your existing AI agent workflows.
88+
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.

0 commit comments

Comments
 (0)