ai-coding-gym-mcp 0.1.0__tar.gz → 0.1.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ai_coding_gym_mcp-0.1.0 → ai_coding_gym_mcp-0.1.3}/PKG-INFO +40 -37
- {ai_coding_gym_mcp-0.1.0 → ai_coding_gym_mcp-0.1.3}/README.md +39 -36
- {ai_coding_gym_mcp-0.1.0 → ai_coding_gym_mcp-0.1.3}/ai_coding_gym_mcp.egg-info/PKG-INFO +40 -37
- {ai_coding_gym_mcp-0.1.0 → ai_coding_gym_mcp-0.1.3}/pyproject.toml +1 -1
- {ai_coding_gym_mcp-0.1.0 → ai_coding_gym_mcp-0.1.3}/server.py +4 -46
- {ai_coding_gym_mcp-0.1.0 → ai_coding_gym_mcp-0.1.3}/setup.py +1 -1
- {ai_coding_gym_mcp-0.1.0 → ai_coding_gym_mcp-0.1.3}/ai_coding_gym_mcp.egg-info/SOURCES.txt +0 -0
- {ai_coding_gym_mcp-0.1.0 → ai_coding_gym_mcp-0.1.3}/ai_coding_gym_mcp.egg-info/dependency_links.txt +0 -0
- {ai_coding_gym_mcp-0.1.0 → ai_coding_gym_mcp-0.1.3}/ai_coding_gym_mcp.egg-info/entry_points.txt +0 -0
- {ai_coding_gym_mcp-0.1.0 → ai_coding_gym_mcp-0.1.3}/ai_coding_gym_mcp.egg-info/requires.txt +0 -0
- {ai_coding_gym_mcp-0.1.0 → ai_coding_gym_mcp-0.1.3}/ai_coding_gym_mcp.egg-info/top_level.txt +0 -0
- {ai_coding_gym_mcp-0.1.0 → ai_coding_gym_mcp-0.1.3}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ai-coding-gym-mcp
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.3
|
|
4
4
|
Summary: MCP server for AI Coding Gym - fetch and submit coding challenges
|
|
5
5
|
Home-page: https://github.com/yourusername/ai-coding-gym-mcp
|
|
6
6
|
Author: AICodingGym Team
|
|
@@ -63,10 +63,7 @@ Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_
|
|
|
63
63
|
"mcpServers": {
|
|
64
64
|
"ai-coding-gym": {
|
|
65
65
|
"command": "python",
|
|
66
|
-
"args": ["-m", "server"]
|
|
67
|
-
"env": {
|
|
68
|
-
"AI_CODING_GYM_SERVER": "https://your-server-url.com"
|
|
69
|
-
}
|
|
66
|
+
"args": ["-m", "server"]
|
|
70
67
|
}
|
|
71
68
|
}
|
|
72
69
|
}
|
|
@@ -86,30 +83,48 @@ python server.py
|
|
|
86
83
|
|
|
87
84
|
Or configure it in your MCP client settings (e.g., Claude Desktop).
|
|
88
85
|
|
|
86
|
+
### Tool: `/configure`
|
|
87
|
+
|
|
88
|
+
Configure the MCP server with your user ID. This generates an SSH key pair and registers it with the server.
|
|
89
|
+
|
|
90
|
+
**Parameters:**
|
|
91
|
+
- `user_id` (required): Your user ID for authentication
|
|
92
|
+
- `workspace_dir` (optional): Default workspace directory (default: `"./workspace"`)
|
|
93
|
+
|
|
94
|
+
**Example:**
|
|
95
|
+
```json
|
|
96
|
+
{
|
|
97
|
+
"user_id": "user_123",
|
|
98
|
+
"workspace_dir": "./workspace"
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**What it does:**
|
|
103
|
+
1. Generates an SSH key pair locally (stored in `~/.mcp-keys/`)
|
|
104
|
+
2. Sends the public key to the server
|
|
105
|
+
3. Receives your repository name
|
|
106
|
+
4. Stores configuration for future use
|
|
107
|
+
|
|
89
108
|
### Tool: `/fetch`
|
|
90
109
|
|
|
91
110
|
Fetches a problem from the backend and clones the repository locally.
|
|
92
111
|
|
|
93
112
|
**Parameters:**
|
|
94
113
|
- `problem_id` (required): Problem identifier (e.g., `"django__django-10097"`)
|
|
95
|
-
- `user_id` (
|
|
96
|
-
- `server_url` (optional): Backend server URL (default: `"https://api.example.com"`)
|
|
114
|
+
- `user_id` (optional): Your user ID (uses configured value if not provided)
|
|
97
115
|
- `workspace_dir` (optional): Local workspace directory (default: `"./workspace"`)
|
|
98
116
|
|
|
99
117
|
**Example:**
|
|
100
118
|
```json
|
|
101
119
|
{
|
|
102
|
-
"problem_id": "django__django-10097"
|
|
103
|
-
"user_id": "user_123",
|
|
104
|
-
"server_url": "https://ai-coding-gym.example.com"
|
|
120
|
+
"problem_id": "django__django-10097"
|
|
105
121
|
}
|
|
106
122
|
```
|
|
107
123
|
|
|
108
124
|
**What it does:**
|
|
109
|
-
1.
|
|
110
|
-
2. Clones the
|
|
111
|
-
3.
|
|
112
|
-
4. Saves the problem statement to `PROBLEM_STATEMENT.md`
|
|
125
|
+
1. Uses your SSH key from `/configure` to access the repository
|
|
126
|
+
2. Clones only the specific problem branch (shallow clone)
|
|
127
|
+
3. Sets up the workspace at `workspace/{problem_id}/`
|
|
113
128
|
|
|
114
129
|
### Tool: `/submit`
|
|
115
130
|
|
|
@@ -117,15 +132,13 @@ Submits your solution by committing changes and pushing to the remote repository
|
|
|
117
132
|
|
|
118
133
|
**Parameters:**
|
|
119
134
|
- `problem_id` (required): Problem identifier
|
|
120
|
-
- `user_id` (
|
|
121
|
-
- `server_url` (optional): Backend server URL (default: `"https://api.example.com"`)
|
|
135
|
+
- `user_id` (optional): Your user ID (uses configured value if not provided)
|
|
122
136
|
- `commit_message` (optional): Custom commit message
|
|
123
137
|
|
|
124
138
|
**Example:**
|
|
125
139
|
```json
|
|
126
140
|
{
|
|
127
141
|
"problem_id": "django__django-10097",
|
|
128
|
-
"user_id": "user_123",
|
|
129
142
|
"commit_message": "Fixed the authentication bug"
|
|
130
143
|
}
|
|
131
144
|
```
|
|
@@ -138,25 +151,22 @@ Submits your solution by committing changes and pushing to the remote repository
|
|
|
138
151
|
|
|
139
152
|
## Backend API Endpoints
|
|
140
153
|
|
|
141
|
-
The MCP server
|
|
154
|
+
The MCP server connects to the hardcoded AI Coding Gym server and uses the following endpoints:
|
|
142
155
|
|
|
143
|
-
### POST `/api/
|
|
156
|
+
### POST `/api/configure`
|
|
144
157
|
|
|
145
158
|
**Request:**
|
|
146
159
|
```json
|
|
147
160
|
{
|
|
148
|
-
"
|
|
149
|
-
"
|
|
161
|
+
"user_id": "user_123",
|
|
162
|
+
"public_key": "ssh-rsa AAAAB3..."
|
|
150
163
|
}
|
|
151
164
|
```
|
|
152
165
|
|
|
153
166
|
**Response:**
|
|
154
167
|
```json
|
|
155
168
|
{
|
|
156
|
-
"
|
|
157
|
-
"branch": "django__django-10097-user_123",
|
|
158
|
-
"deploy_key": "-----BEGIN OPENSSH PRIVATE KEY-----\n...\n-----END OPENSSH PRIVATE KEY-----",
|
|
159
|
-
"problem_statement": "# Problem Description\n\n..."
|
|
169
|
+
"repo_name": "user_123-swebench"
|
|
160
170
|
}
|
|
161
171
|
```
|
|
162
172
|
|
|
@@ -183,23 +193,16 @@ The MCP server expects the following backend API endpoints:
|
|
|
183
193
|
|
|
184
194
|
## Security
|
|
185
195
|
|
|
186
|
-
-
|
|
187
|
-
- Keys are
|
|
196
|
+
- User SSH keys are stored in `~/.mcp-keys/` with 600 permissions
|
|
197
|
+
- Keys are generated locally and public key is shared with the server
|
|
188
198
|
- SSH host key checking is disabled for convenience (consider enabling in production)
|
|
189
|
-
-
|
|
190
|
-
|
|
191
|
-
## Configuration
|
|
192
|
-
|
|
193
|
-
Default server URL is `https://api.example.com`. You can override it by passing `server_url` parameter to each tool call, or set it via environment variable:
|
|
194
|
-
|
|
195
|
-
```bash
|
|
196
|
-
export AI_CODING_GYM_SERVER="https://your-server.com"
|
|
197
|
-
```
|
|
199
|
+
- Configuration is cached in memory during the MCP server session
|
|
198
200
|
|
|
199
201
|
## Troubleshooting
|
|
200
202
|
|
|
201
203
|
**"No credentials found for problem_id"**
|
|
202
|
-
- Run `/
|
|
204
|
+
- Run `/configure` first to set up your credentials
|
|
205
|
+
- Then run `/fetch` to download the problem
|
|
203
206
|
|
|
204
207
|
**"Git clone/push failed"**
|
|
205
208
|
- Check network connectivity
|
|
@@ -37,10 +37,7 @@ Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_
|
|
|
37
37
|
"mcpServers": {
|
|
38
38
|
"ai-coding-gym": {
|
|
39
39
|
"command": "python",
|
|
40
|
-
"args": ["-m", "server"]
|
|
41
|
-
"env": {
|
|
42
|
-
"AI_CODING_GYM_SERVER": "https://your-server-url.com"
|
|
43
|
-
}
|
|
40
|
+
"args": ["-m", "server"]
|
|
44
41
|
}
|
|
45
42
|
}
|
|
46
43
|
}
|
|
@@ -60,30 +57,48 @@ python server.py
|
|
|
60
57
|
|
|
61
58
|
Or configure it in your MCP client settings (e.g., Claude Desktop).
|
|
62
59
|
|
|
60
|
+
### Tool: `/configure`
|
|
61
|
+
|
|
62
|
+
Configure the MCP server with your user ID. This generates an SSH key pair and registers it with the server.
|
|
63
|
+
|
|
64
|
+
**Parameters:**
|
|
65
|
+
- `user_id` (required): Your user ID for authentication
|
|
66
|
+
- `workspace_dir` (optional): Default workspace directory (default: `"./workspace"`)
|
|
67
|
+
|
|
68
|
+
**Example:**
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"user_id": "user_123",
|
|
72
|
+
"workspace_dir": "./workspace"
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**What it does:**
|
|
77
|
+
1. Generates an SSH key pair locally (stored in `~/.mcp-keys/`)
|
|
78
|
+
2. Sends the public key to the server
|
|
79
|
+
3. Receives your repository name
|
|
80
|
+
4. Stores configuration for future use
|
|
81
|
+
|
|
63
82
|
### Tool: `/fetch`
|
|
64
83
|
|
|
65
84
|
Fetches a problem from the backend and clones the repository locally.
|
|
66
85
|
|
|
67
86
|
**Parameters:**
|
|
68
87
|
- `problem_id` (required): Problem identifier (e.g., `"django__django-10097"`)
|
|
69
|
-
- `user_id` (
|
|
70
|
-
- `server_url` (optional): Backend server URL (default: `"https://api.example.com"`)
|
|
88
|
+
- `user_id` (optional): Your user ID (uses configured value if not provided)
|
|
71
89
|
- `workspace_dir` (optional): Local workspace directory (default: `"./workspace"`)
|
|
72
90
|
|
|
73
91
|
**Example:**
|
|
74
92
|
```json
|
|
75
93
|
{
|
|
76
|
-
"problem_id": "django__django-10097"
|
|
77
|
-
"user_id": "user_123",
|
|
78
|
-
"server_url": "https://ai-coding-gym.example.com"
|
|
94
|
+
"problem_id": "django__django-10097"
|
|
79
95
|
}
|
|
80
96
|
```
|
|
81
97
|
|
|
82
98
|
**What it does:**
|
|
83
|
-
1.
|
|
84
|
-
2. Clones the
|
|
85
|
-
3.
|
|
86
|
-
4. Saves the problem statement to `PROBLEM_STATEMENT.md`
|
|
99
|
+
1. Uses your SSH key from `/configure` to access the repository
|
|
100
|
+
2. Clones only the specific problem branch (shallow clone)
|
|
101
|
+
3. Sets up the workspace at `workspace/{problem_id}/`
|
|
87
102
|
|
|
88
103
|
### Tool: `/submit`
|
|
89
104
|
|
|
@@ -91,15 +106,13 @@ Submits your solution by committing changes and pushing to the remote repository
|
|
|
91
106
|
|
|
92
107
|
**Parameters:**
|
|
93
108
|
- `problem_id` (required): Problem identifier
|
|
94
|
-
- `user_id` (
|
|
95
|
-
- `server_url` (optional): Backend server URL (default: `"https://api.example.com"`)
|
|
109
|
+
- `user_id` (optional): Your user ID (uses configured value if not provided)
|
|
96
110
|
- `commit_message` (optional): Custom commit message
|
|
97
111
|
|
|
98
112
|
**Example:**
|
|
99
113
|
```json
|
|
100
114
|
{
|
|
101
115
|
"problem_id": "django__django-10097",
|
|
102
|
-
"user_id": "user_123",
|
|
103
116
|
"commit_message": "Fixed the authentication bug"
|
|
104
117
|
}
|
|
105
118
|
```
|
|
@@ -112,25 +125,22 @@ Submits your solution by committing changes and pushing to the remote repository
|
|
|
112
125
|
|
|
113
126
|
## Backend API Endpoints
|
|
114
127
|
|
|
115
|
-
The MCP server
|
|
128
|
+
The MCP server connects to the hardcoded AI Coding Gym server and uses the following endpoints:
|
|
116
129
|
|
|
117
|
-
### POST `/api/
|
|
130
|
+
### POST `/api/configure`
|
|
118
131
|
|
|
119
132
|
**Request:**
|
|
120
133
|
```json
|
|
121
134
|
{
|
|
122
|
-
"
|
|
123
|
-
"
|
|
135
|
+
"user_id": "user_123",
|
|
136
|
+
"public_key": "ssh-rsa AAAAB3..."
|
|
124
137
|
}
|
|
125
138
|
```
|
|
126
139
|
|
|
127
140
|
**Response:**
|
|
128
141
|
```json
|
|
129
142
|
{
|
|
130
|
-
"
|
|
131
|
-
"branch": "django__django-10097-user_123",
|
|
132
|
-
"deploy_key": "-----BEGIN OPENSSH PRIVATE KEY-----\n...\n-----END OPENSSH PRIVATE KEY-----",
|
|
133
|
-
"problem_statement": "# Problem Description\n\n..."
|
|
143
|
+
"repo_name": "user_123-swebench"
|
|
134
144
|
}
|
|
135
145
|
```
|
|
136
146
|
|
|
@@ -157,23 +167,16 @@ The MCP server expects the following backend API endpoints:
|
|
|
157
167
|
|
|
158
168
|
## Security
|
|
159
169
|
|
|
160
|
-
-
|
|
161
|
-
- Keys are
|
|
170
|
+
- User SSH keys are stored in `~/.mcp-keys/` with 600 permissions
|
|
171
|
+
- Keys are generated locally and public key is shared with the server
|
|
162
172
|
- SSH host key checking is disabled for convenience (consider enabling in production)
|
|
163
|
-
-
|
|
164
|
-
|
|
165
|
-
## Configuration
|
|
166
|
-
|
|
167
|
-
Default server URL is `https://api.example.com`. You can override it by passing `server_url` parameter to each tool call, or set it via environment variable:
|
|
168
|
-
|
|
169
|
-
```bash
|
|
170
|
-
export AI_CODING_GYM_SERVER="https://your-server.com"
|
|
171
|
-
```
|
|
173
|
+
- Configuration is cached in memory during the MCP server session
|
|
172
174
|
|
|
173
175
|
## Troubleshooting
|
|
174
176
|
|
|
175
177
|
**"No credentials found for problem_id"**
|
|
176
|
-
- Run `/
|
|
178
|
+
- Run `/configure` first to set up your credentials
|
|
179
|
+
- Then run `/fetch` to download the problem
|
|
177
180
|
|
|
178
181
|
**"Git clone/push failed"**
|
|
179
182
|
- Check network connectivity
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ai-coding-gym-mcp
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.3
|
|
4
4
|
Summary: MCP server for AI Coding Gym - fetch and submit coding challenges
|
|
5
5
|
Home-page: https://github.com/yourusername/ai-coding-gym-mcp
|
|
6
6
|
Author: AICodingGym Team
|
|
@@ -63,10 +63,7 @@ Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_
|
|
|
63
63
|
"mcpServers": {
|
|
64
64
|
"ai-coding-gym": {
|
|
65
65
|
"command": "python",
|
|
66
|
-
"args": ["-m", "server"]
|
|
67
|
-
"env": {
|
|
68
|
-
"AI_CODING_GYM_SERVER": "https://your-server-url.com"
|
|
69
|
-
}
|
|
66
|
+
"args": ["-m", "server"]
|
|
70
67
|
}
|
|
71
68
|
}
|
|
72
69
|
}
|
|
@@ -86,30 +83,48 @@ python server.py
|
|
|
86
83
|
|
|
87
84
|
Or configure it in your MCP client settings (e.g., Claude Desktop).
|
|
88
85
|
|
|
86
|
+
### Tool: `/configure`
|
|
87
|
+
|
|
88
|
+
Configure the MCP server with your user ID. This generates an SSH key pair and registers it with the server.
|
|
89
|
+
|
|
90
|
+
**Parameters:**
|
|
91
|
+
- `user_id` (required): Your user ID for authentication
|
|
92
|
+
- `workspace_dir` (optional): Default workspace directory (default: `"./workspace"`)
|
|
93
|
+
|
|
94
|
+
**Example:**
|
|
95
|
+
```json
|
|
96
|
+
{
|
|
97
|
+
"user_id": "user_123",
|
|
98
|
+
"workspace_dir": "./workspace"
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**What it does:**
|
|
103
|
+
1. Generates an SSH key pair locally (stored in `~/.mcp-keys/`)
|
|
104
|
+
2. Sends the public key to the server
|
|
105
|
+
3. Receives your repository name
|
|
106
|
+
4. Stores configuration for future use
|
|
107
|
+
|
|
89
108
|
### Tool: `/fetch`
|
|
90
109
|
|
|
91
110
|
Fetches a problem from the backend and clones the repository locally.
|
|
92
111
|
|
|
93
112
|
**Parameters:**
|
|
94
113
|
- `problem_id` (required): Problem identifier (e.g., `"django__django-10097"`)
|
|
95
|
-
- `user_id` (
|
|
96
|
-
- `server_url` (optional): Backend server URL (default: `"https://api.example.com"`)
|
|
114
|
+
- `user_id` (optional): Your user ID (uses configured value if not provided)
|
|
97
115
|
- `workspace_dir` (optional): Local workspace directory (default: `"./workspace"`)
|
|
98
116
|
|
|
99
117
|
**Example:**
|
|
100
118
|
```json
|
|
101
119
|
{
|
|
102
|
-
"problem_id": "django__django-10097"
|
|
103
|
-
"user_id": "user_123",
|
|
104
|
-
"server_url": "https://ai-coding-gym.example.com"
|
|
120
|
+
"problem_id": "django__django-10097"
|
|
105
121
|
}
|
|
106
122
|
```
|
|
107
123
|
|
|
108
124
|
**What it does:**
|
|
109
|
-
1.
|
|
110
|
-
2. Clones the
|
|
111
|
-
3.
|
|
112
|
-
4. Saves the problem statement to `PROBLEM_STATEMENT.md`
|
|
125
|
+
1. Uses your SSH key from `/configure` to access the repository
|
|
126
|
+
2. Clones only the specific problem branch (shallow clone)
|
|
127
|
+
3. Sets up the workspace at `workspace/{problem_id}/`
|
|
113
128
|
|
|
114
129
|
### Tool: `/submit`
|
|
115
130
|
|
|
@@ -117,15 +132,13 @@ Submits your solution by committing changes and pushing to the remote repository
|
|
|
117
132
|
|
|
118
133
|
**Parameters:**
|
|
119
134
|
- `problem_id` (required): Problem identifier
|
|
120
|
-
- `user_id` (
|
|
121
|
-
- `server_url` (optional): Backend server URL (default: `"https://api.example.com"`)
|
|
135
|
+
- `user_id` (optional): Your user ID (uses configured value if not provided)
|
|
122
136
|
- `commit_message` (optional): Custom commit message
|
|
123
137
|
|
|
124
138
|
**Example:**
|
|
125
139
|
```json
|
|
126
140
|
{
|
|
127
141
|
"problem_id": "django__django-10097",
|
|
128
|
-
"user_id": "user_123",
|
|
129
142
|
"commit_message": "Fixed the authentication bug"
|
|
130
143
|
}
|
|
131
144
|
```
|
|
@@ -138,25 +151,22 @@ Submits your solution by committing changes and pushing to the remote repository
|
|
|
138
151
|
|
|
139
152
|
## Backend API Endpoints
|
|
140
153
|
|
|
141
|
-
The MCP server
|
|
154
|
+
The MCP server connects to the hardcoded AI Coding Gym server and uses the following endpoints:
|
|
142
155
|
|
|
143
|
-
### POST `/api/
|
|
156
|
+
### POST `/api/configure`
|
|
144
157
|
|
|
145
158
|
**Request:**
|
|
146
159
|
```json
|
|
147
160
|
{
|
|
148
|
-
"
|
|
149
|
-
"
|
|
161
|
+
"user_id": "user_123",
|
|
162
|
+
"public_key": "ssh-rsa AAAAB3..."
|
|
150
163
|
}
|
|
151
164
|
```
|
|
152
165
|
|
|
153
166
|
**Response:**
|
|
154
167
|
```json
|
|
155
168
|
{
|
|
156
|
-
"
|
|
157
|
-
"branch": "django__django-10097-user_123",
|
|
158
|
-
"deploy_key": "-----BEGIN OPENSSH PRIVATE KEY-----\n...\n-----END OPENSSH PRIVATE KEY-----",
|
|
159
|
-
"problem_statement": "# Problem Description\n\n..."
|
|
169
|
+
"repo_name": "user_123-swebench"
|
|
160
170
|
}
|
|
161
171
|
```
|
|
162
172
|
|
|
@@ -183,23 +193,16 @@ The MCP server expects the following backend API endpoints:
|
|
|
183
193
|
|
|
184
194
|
## Security
|
|
185
195
|
|
|
186
|
-
-
|
|
187
|
-
- Keys are
|
|
196
|
+
- User SSH keys are stored in `~/.mcp-keys/` with 600 permissions
|
|
197
|
+
- Keys are generated locally and public key is shared with the server
|
|
188
198
|
- SSH host key checking is disabled for convenience (consider enabling in production)
|
|
189
|
-
-
|
|
190
|
-
|
|
191
|
-
## Configuration
|
|
192
|
-
|
|
193
|
-
Default server URL is `https://api.example.com`. You can override it by passing `server_url` parameter to each tool call, or set it via environment variable:
|
|
194
|
-
|
|
195
|
-
```bash
|
|
196
|
-
export AI_CODING_GYM_SERVER="https://your-server.com"
|
|
197
|
-
```
|
|
199
|
+
- Configuration is cached in memory during the MCP server session
|
|
198
200
|
|
|
199
201
|
## Troubleshooting
|
|
200
202
|
|
|
201
203
|
**"No credentials found for problem_id"**
|
|
202
|
-
- Run `/
|
|
204
|
+
- Run `/configure` first to set up your credentials
|
|
205
|
+
- Then run `/fetch` to download the problem
|
|
203
206
|
|
|
204
207
|
**"Git clone/push failed"**
|
|
205
208
|
- Check network connectivity
|
|
@@ -33,7 +33,7 @@ CONFIGURE_TOOL = Tool(
|
|
|
33
33
|
name="configure",
|
|
34
34
|
description="Configure global settings for the MCP server. Generates an SSH key pair locally, "
|
|
35
35
|
"sends the public key to the server, and receives your repository name. "
|
|
36
|
-
"Set your user_id
|
|
36
|
+
"Set your user_id once. "
|
|
37
37
|
"These values will be used as defaults for all fetch and submit operations.",
|
|
38
38
|
inputSchema={
|
|
39
39
|
"type": "object",
|
|
@@ -42,20 +42,12 @@ CONFIGURE_TOOL = Tool(
|
|
|
42
42
|
"type": "string",
|
|
43
43
|
"description": "Your user ID for authentication with the backend server"
|
|
44
44
|
},
|
|
45
|
-
"server_url": {
|
|
46
|
-
"type": "string",
|
|
47
|
-
"description": "Backend server URL (e.g., 'https://api.example.com')"
|
|
48
|
-
},
|
|
49
|
-
"api_key": {
|
|
50
|
-
"type": "string",
|
|
51
|
-
"description": "API key for backend authentication (optional)"
|
|
52
|
-
},
|
|
53
45
|
"workspace_dir": {
|
|
54
46
|
"type": "string",
|
|
55
47
|
"description": "Default workspace directory for cloning repositories (optional)"
|
|
56
48
|
}
|
|
57
49
|
},
|
|
58
|
-
"required": ["user_id"
|
|
50
|
+
"required": ["user_id"]
|
|
59
51
|
}
|
|
60
52
|
)
|
|
61
53
|
|
|
@@ -74,10 +66,6 @@ FETCH_TOOL = Tool(
|
|
|
74
66
|
"type": "string",
|
|
75
67
|
"description": "Your user ID (optional if configured globally via /configure)"
|
|
76
68
|
},
|
|
77
|
-
"server_url": {
|
|
78
|
-
"type": "string",
|
|
79
|
-
"description": "Backend server URL (optional if configured globally)"
|
|
80
|
-
},
|
|
81
69
|
"workspace_dir": {
|
|
82
70
|
"type": "string",
|
|
83
71
|
"description": "Local directory to clone the repository into (optional)"
|
|
@@ -102,10 +90,6 @@ SUBMIT_TOOL = Tool(
|
|
|
102
90
|
"type": "string",
|
|
103
91
|
"description": "Your user ID (optional if configured globally via /configure)"
|
|
104
92
|
},
|
|
105
|
-
"server_url": {
|
|
106
|
-
"type": "string",
|
|
107
|
-
"description": "Backend server URL (optional if configured globally)"
|
|
108
|
-
},
|
|
109
93
|
"commit_message": {
|
|
110
94
|
"type": "string",
|
|
111
95
|
"description": "Custom commit message (optional)"
|
|
@@ -208,11 +192,10 @@ def run_git_command(cmd: str, cwd: str, key_path: Optional[Path] = None) -> subp
|
|
|
208
192
|
# Tool implementations
|
|
209
193
|
async def configure(
|
|
210
194
|
user_id: str,
|
|
211
|
-
server_url: str,
|
|
212
|
-
api_key: Optional[str] = None,
|
|
213
195
|
workspace_dir: Optional[str] = None
|
|
214
196
|
) -> str:
|
|
215
197
|
"""Configure global settings for the MCP server."""
|
|
198
|
+
server_url = DEFAULT_SERVER_URL
|
|
216
199
|
try:
|
|
217
200
|
# Generate SSH key pair
|
|
218
201
|
private_key_path, public_key = generate_ssh_key_pair(user_id)
|
|
@@ -224,9 +207,6 @@ async def configure(
|
|
|
224
207
|
"public_key": public_key
|
|
225
208
|
}
|
|
226
209
|
|
|
227
|
-
if api_key:
|
|
228
|
-
payload["api_key"] = api_key
|
|
229
|
-
|
|
230
210
|
response = requests.post(api_endpoint, json=payload, timeout=30)
|
|
231
211
|
response.raise_for_status()
|
|
232
212
|
data = response.json()
|
|
@@ -237,22 +217,16 @@ async def configure(
|
|
|
237
217
|
|
|
238
218
|
# Store configuration
|
|
239
219
|
config_store["user_id"] = user_id
|
|
240
|
-
config_store["server_url"] = server_url
|
|
241
220
|
config_store["repo_name"] = repo_name
|
|
242
221
|
config_store["private_key_path"] = str(private_key_path)
|
|
243
222
|
|
|
244
|
-
if api_key:
|
|
245
|
-
config_store["api_key"] = api_key
|
|
246
|
-
|
|
247
223
|
if workspace_dir:
|
|
248
224
|
config_store["workspace_dir"] = workspace_dir
|
|
249
225
|
|
|
250
226
|
return f"""Configuration saved successfully!
|
|
251
227
|
|
|
252
228
|
User ID: {user_id}
|
|
253
|
-
Server URL: {server_url}
|
|
254
229
|
Repository: {repo_name}
|
|
255
|
-
API Key: {'Set' if api_key else 'Not set'}
|
|
256
230
|
Workspace: {workspace_dir or 'Default (./workspace)'}
|
|
257
231
|
SSH Key: {private_key_path}
|
|
258
232
|
|
|
@@ -269,7 +243,6 @@ You can now use /fetch and /submit without passing these parameters.
|
|
|
269
243
|
async def fetch_problem(
|
|
270
244
|
problem_id: str,
|
|
271
245
|
user_id: Optional[str] = None,
|
|
272
|
-
server_url: Optional[str] = None,
|
|
273
246
|
workspace_dir: Optional[str] = None
|
|
274
247
|
) -> str:
|
|
275
248
|
"""
|
|
@@ -278,7 +251,6 @@ async def fetch_problem(
|
|
|
278
251
|
try:
|
|
279
252
|
# Use configured values if not provided
|
|
280
253
|
user_id = user_id or config_store.get("user_id") or infer_user_id_from_keys()
|
|
281
|
-
server_url = server_url or config_store.get("server_url") or DEFAULT_SERVER_URL
|
|
282
254
|
workspace_dir = workspace_dir or config_store.get("workspace_dir", "./workspace")
|
|
283
255
|
repo_name = config_store.get("repo_name")
|
|
284
256
|
|
|
@@ -310,7 +282,6 @@ async def fetch_problem(
|
|
|
310
282
|
"repo_url": repo_url,
|
|
311
283
|
"branch": branch,
|
|
312
284
|
"user_id": user_id,
|
|
313
|
-
"server_url": server_url,
|
|
314
285
|
"private_key_path": private_key_path
|
|
315
286
|
}
|
|
316
287
|
|
|
@@ -365,7 +336,6 @@ You can now start working on the solution!
|
|
|
365
336
|
async def submit_solution(
|
|
366
337
|
problem_id: str,
|
|
367
338
|
user_id: Optional[str] = None,
|
|
368
|
-
server_url: Optional[str] = None,
|
|
369
339
|
commit_message: Optional[str] = None
|
|
370
340
|
) -> str:
|
|
371
341
|
"""
|
|
@@ -374,15 +344,11 @@ async def submit_solution(
|
|
|
374
344
|
try:
|
|
375
345
|
# Use configured values if not provided
|
|
376
346
|
user_id = user_id or config_store.get("user_id") or infer_user_id_from_keys()
|
|
377
|
-
server_url = server_url or config_store.get("server_url") or DEFAULT_SERVER_URL
|
|
378
347
|
commit_message = commit_message or ""
|
|
379
348
|
|
|
380
349
|
if not user_id:
|
|
381
350
|
return "Error: Could not determine user_id. Please run /configure first to set up your credentials."
|
|
382
351
|
|
|
383
|
-
if not server_url:
|
|
384
|
-
return "Error: server_url is required. Please run /configure first or pass it as a parameter."
|
|
385
|
-
|
|
386
352
|
# Check if we have cached credentials
|
|
387
353
|
if problem_id not in credentials_store:
|
|
388
354
|
return f"Error: No credentials found for {problem_id}. Please run /fetch first."
|
|
@@ -439,7 +405,7 @@ async def submit_solution(
|
|
|
439
405
|
return f"Error: Git push failed:\n{result.stderr}"
|
|
440
406
|
|
|
441
407
|
# Notify backend server
|
|
442
|
-
api_endpoint = f"{
|
|
408
|
+
api_endpoint = f"{DEFAULT_SERVER_URL}/api/submit"
|
|
443
409
|
payload = {
|
|
444
410
|
"problem_id": problem_id,
|
|
445
411
|
"user_id": user_id,
|
|
@@ -448,10 +414,6 @@ async def submit_solution(
|
|
|
448
414
|
"timestamp": datetime.now().isoformat()
|
|
449
415
|
}
|
|
450
416
|
|
|
451
|
-
# Add API key if configured
|
|
452
|
-
if config_store.get("api_key"):
|
|
453
|
-
payload["api_key"] = config_store["api_key"]
|
|
454
|
-
|
|
455
417
|
response = requests.post(api_endpoint, json=payload, timeout=30)
|
|
456
418
|
response.raise_for_status()
|
|
457
419
|
|
|
@@ -485,8 +447,6 @@ async def call_tool(name: str, arguments: Any) -> list[TextContent]:
|
|
|
485
447
|
if name == "configure":
|
|
486
448
|
result = await configure(
|
|
487
449
|
user_id=arguments["user_id"],
|
|
488
|
-
server_url=arguments["server_url"],
|
|
489
|
-
api_key=arguments.get("api_key"),
|
|
490
450
|
workspace_dir=arguments.get("workspace_dir")
|
|
491
451
|
)
|
|
492
452
|
return [TextContent(type="text", text=result)]
|
|
@@ -495,7 +455,6 @@ async def call_tool(name: str, arguments: Any) -> list[TextContent]:
|
|
|
495
455
|
result = await fetch_problem(
|
|
496
456
|
problem_id=arguments["problem_id"],
|
|
497
457
|
user_id=arguments.get("user_id"),
|
|
498
|
-
server_url=arguments.get("server_url"),
|
|
499
458
|
workspace_dir=arguments.get("workspace_dir")
|
|
500
459
|
)
|
|
501
460
|
return [TextContent(type="text", text=result)]
|
|
@@ -504,7 +463,6 @@ async def call_tool(name: str, arguments: Any) -> list[TextContent]:
|
|
|
504
463
|
result = await submit_solution(
|
|
505
464
|
problem_id=arguments["problem_id"],
|
|
506
465
|
user_id=arguments.get("user_id"),
|
|
507
|
-
server_url=arguments.get("server_url"),
|
|
508
466
|
commit_message=arguments.get("commit_message")
|
|
509
467
|
)
|
|
510
468
|
return [TextContent(type="text", text=result)]
|
|
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
|
|
|
5
5
|
|
|
6
6
|
setup(
|
|
7
7
|
name="ai-coding-gym-mcp",
|
|
8
|
-
version="0.1.
|
|
8
|
+
version="0.1.3",
|
|
9
9
|
author="AICodingGym Team",
|
|
10
10
|
author_email="datasmithlab@gmail.com",
|
|
11
11
|
description="MCP server for AI Coding Gym - fetch and submit AI coding challenges",
|
|
File without changes
|
{ai_coding_gym_mcp-0.1.0 → ai_coding_gym_mcp-0.1.3}/ai_coding_gym_mcp.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{ai_coding_gym_mcp-0.1.0 → ai_coding_gym_mcp-0.1.3}/ai_coding_gym_mcp.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
{ai_coding_gym_mcp-0.1.0 → ai_coding_gym_mcp-0.1.3}/ai_coding_gym_mcp.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|