Skip to content

Commit e38173e

Browse files
committed
fix: add tool instructions and update readme
1 parent 0c53173 commit e38173e

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

src/codegen/cli/mcp/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Codegen MCP server
2+
3+
A MCP server implementation that provides tools and resources for using and working with the Codegen CLI and SDK, enabling AI agents to iterate quickly on writing codemods with the codegen sdk.
4+
5+
### Dependencies
6+
7+
- [fastmcp](https://github.com/codegen-sh/fastmcp)
8+
9+
## Usage
10+
11+
Most AI Agents that support MCP will have some way to configure the server startup.
12+
### Cline
13+
Add this to your `cline_mcp_settings.json` file to get started:
14+
```
15+
{
16+
"mcpServers": {
17+
"codegen-cli": {
18+
"command": "uv",
19+
"args": [
20+
"--directory",
21+
"<path to codegen installation>/codegen-sdk/src/codegen/cli/mcp",
22+
"run",
23+
"server.py"
24+
]
25+
}
26+
}
27+
}
28+
```
29+
30+
Cursor:
31+
Under the `Settings` > `Feature` > `MCP Servers` section, click "Add New MCP Server" and add the following:
32+
33+
```
34+
Name: codegen-mcp
35+
Type: Command
36+
Command: uv --directory <path to codegen installation>/codegen-sdk/src/codegen/cli/mcp run server.py
37+
```
38+
39+
40+
41+
42+

src/codegen/cli/mcp/server.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
from codegen.cli.mcp.resources.system_prompt import SYSTEM_PROMPT
66
from codegen.cli.utils.constants import ProgrammingLanguage
77
# Initialize FastMCP server
8-
mcp = FastMCP("codegen-mcp")
8+
9+
mcp = FastMCP("codegen-mcp", instructions="MCP server for the Codegen SDK. Use the tools and resources to setup codegen in your environment and to create and improve your Codegen Codemods.")
910

1011
# ----- RESOURCES -----
1112

0 commit comments

Comments
 (0)