code-engine-mcp-server 1.0.0

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.
Files changed (43) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +387 -0
  3. package/build/client.d.ts +3 -0
  4. package/build/client.d.ts.map +1 -0
  5. package/build/client.js +194 -0
  6. package/build/client.js.map +1 -0
  7. package/build/context-discovery.d.ts +86 -0
  8. package/build/context-discovery.d.ts.map +1 -0
  9. package/build/context-discovery.js +291 -0
  10. package/build/context-discovery.js.map +1 -0
  11. package/build/deploy-tool-enhanced.d.ts +42 -0
  12. package/build/deploy-tool-enhanced.d.ts.map +1 -0
  13. package/build/deploy-tool-enhanced.js +323 -0
  14. package/build/deploy-tool-enhanced.js.map +1 -0
  15. package/build/deploy-tool.d.ts +27 -0
  16. package/build/deploy-tool.d.ts.map +1 -0
  17. package/build/deploy-tool.js +213 -0
  18. package/build/deploy-tool.js.map +1 -0
  19. package/build/index.d.ts +11 -0
  20. package/build/index.d.ts.map +1 -0
  21. package/build/index.js +1117 -0
  22. package/build/index.js.map +1 -0
  23. package/build/simple-client.d.ts +3 -0
  24. package/build/simple-client.d.ts.map +1 -0
  25. package/build/simple-client.js +275 -0
  26. package/build/simple-client.js.map +1 -0
  27. package/build/test-all-tools.d.ts +3 -0
  28. package/build/test-all-tools.d.ts.map +1 -0
  29. package/build/test-all-tools.js +254 -0
  30. package/build/test-all-tools.js.map +1 -0
  31. package/build/test-integration.d.ts +3 -0
  32. package/build/test-integration.d.ts.map +1 -0
  33. package/build/test-integration.js +484 -0
  34. package/build/test-integration.js.map +1 -0
  35. package/docs/API_CALL_SCENARIOS.md +594 -0
  36. package/docs/CLIENT_README.md +310 -0
  37. package/docs/CLINE_CONFIG_EXAMPLE.json +14 -0
  38. package/docs/CODE_ENGINE_API_REFERENCE.md +764 -0
  39. package/docs/CODE_OF_CONDUCT.md +46 -0
  40. package/docs/CONTRIBUTING.md +38 -0
  41. package/docs/MAINTAINERS.md +15 -0
  42. package/docs/SETUP_INSTRUCTIONS.md +218 -0
  43. package/package.json +44 -0
@@ -0,0 +1,46 @@
1
+ # Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as contributors and maintainers pledge to make participation in this project a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment include:
12
+
13
+ - Demonstrating empathy and kindness toward other people.
14
+ - Being respectful of differing opinions, viewpoints, and experiences.
15
+ - Giving and gracefully accepting constructive feedback.
16
+ - Accepting responsibility and apologizing to those affected by mistakes.
17
+ - Focusing on what is best for the overall community.
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ - The use of sexualized language or imagery, and sexual attention or advances of any kind.
22
+ - Trolling, insulting or derogatory comments, and personal or political attacks.
23
+ - Public or private harassment.
24
+ - Publishing others' private information, such as a physical or email address, without explicit permission.
25
+ - Other conduct which could reasonably be considered inappropriate in a professional setting.
26
+
27
+ ## Enforcement Responsibilities
28
+
29
+ Project maintainers are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to behavior that they deem inappropriate, threatening, offensive, or harmful.
30
+
31
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned with this Code of Conduct.
32
+
33
+ ## Scope
34
+
35
+ This Code of Conduct applies within all project spaces and also applies when an individual is officially representing the project in public spaces.
36
+
37
+ ## Enforcement
38
+
39
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the project maintainers by opening a private communication channel agreed by the maintainers.
40
+
41
+ All complaints will be reviewed and investigated promptly and fairly.
42
+
43
+ ## Attribution
44
+
45
+ This Code of Conduct is adapted from the Contributor Covenant, version 2.1:
46
+ https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
@@ -0,0 +1,38 @@
1
+ # Contributing
2
+
3
+ Thanks for your interest in contributing.
4
+
5
+ ## Getting Started
6
+
7
+ - Fork and clone the repository.
8
+ - Install dependencies with `npm install`.
9
+ - Build with `npm run build`.
10
+ - Run tests or validations relevant to your change.
11
+
12
+ ## Development Workflow
13
+
14
+ - Create a branch from `main` for each change.
15
+ - Keep pull requests focused and reviewable.
16
+ - Write clear commit messages that explain why the change is needed.
17
+
18
+ ## Pull Request Guidelines
19
+
20
+ - Provide a concise description of the change and motivation.
21
+ - Link related issues when applicable.
22
+ - Include manual testing steps or automated test coverage.
23
+ - Ensure CI is passing before requesting review.
24
+
25
+ ## Code Style
26
+
27
+ - Follow the existing style and patterns in the repository.
28
+ - Keep changes small and avoid unrelated refactors.
29
+ - Update documentation when behavior or usage changes.
30
+
31
+ ## Reporting Issues
32
+
33
+ When opening an issue, include:
34
+
35
+ - Expected behavior
36
+ - Actual behavior
37
+ - Steps to reproduce
38
+ - Relevant logs or screenshots
@@ -0,0 +1,15 @@
1
+ # Maintainers
2
+
3
+ This file lists the current project maintainers.
4
+
5
+ ## Active Maintainers
6
+
7
+ - Markus van Kempen
8
+
9
+ ## Responsibilities
10
+
11
+ Maintainers are responsible for:
12
+
13
+ - Reviewing and merging pull requests
14
+ - Triaging issues and discussions
15
+ - Maintaining release quality and project direction
@@ -0,0 +1,218 @@
1
+ # Quick Setup Instructions for Bob/Cline
2
+
3
+ Follow these steps to enable Bob to understand Docker and Code Engine commands.
4
+
5
+ ## Step 1: Verify the Build
6
+
7
+ The MCP server has been built successfully. Verify it exists:
8
+
9
+ ```bash
10
+ ls -la /Users/markusvankempen/projects/code-engine/code-engine-mcp-server/build/index.js
11
+ ```
12
+
13
+ You should see the compiled JavaScript file.
14
+
15
+ ## Step 2: Configure Cline in VSCode
16
+
17
+ 1. **Open VSCode Settings**
18
+ - Press `Cmd + ,` (Mac) or `Ctrl + ,` (Windows/Linux)
19
+ - Or go to: Code → Settings → Settings
20
+
21
+ 2. **Search for MCP Settings**
22
+ - Type "Cline MCP" in the search bar
23
+ - Look for "Cline: MCP Settings"
24
+
25
+ 3. **Edit settings.json**
26
+ - Click "Edit in settings.json" link
27
+ - This will open your VSCode settings file
28
+
29
+ 4. **Add the MCP Server Configuration**
30
+
31
+ Copy and paste this configuration into your settings.json:
32
+
33
+ ```json
34
+ {
35
+ "cline.mcpServers": {
36
+ "code-engine": {
37
+ "command": "node",
38
+ "args": [
39
+ "/Users/markusvankempen/projects/code-engine/code-engine-mcp-server/build/index.js"
40
+ ],
41
+ "env": {
42
+ "IBMCLOUD_API_KEY": "YOUR_IBM_CLOUD_API_KEY_HERE"
43
+ }
44
+ }
45
+ }
46
+ }
47
+ ```
48
+
49
+ 5. **Replace YOUR_IBM_CLOUD_API_KEY_HERE**
50
+ - Get your IBM Cloud API key from: https://cloud.ibm.com/iam/apikeys
51
+ - Replace the placeholder with your actual API key
52
+ - Keep the quotes around the key
53
+
54
+ 6. **Save the file**
55
+ - Press `Cmd + S` (Mac) or `Ctrl + S` (Windows/Linux)
56
+
57
+ ## Step 3: Restart Cline/Bob
58
+
59
+ 1. **Reload VSCode Window**
60
+ - Press `Cmd + Shift + P` (Mac) or `Ctrl + Shift + P` (Windows/Linux)
61
+ - Type "Reload Window"
62
+ - Press Enter
63
+
64
+ 2. **Or Restart Cline**
65
+ - Open Cline sidebar
66
+ - Look for restart/reload option
67
+
68
+ ## Step 4: Verify the Connection
69
+
70
+ 1. **Check MCP Status**
71
+ - Look at the Cline status bar
72
+ - You should see "MCP" indicator
73
+ - It should show "code-engine" as connected
74
+
75
+ 2. **Test with a Simple Command**
76
+
77
+ Ask Bob:
78
+ ```
79
+ Can you detect which container runtime I have installed?
80
+ ```
81
+
82
+ Bob should respond with Docker or Podman version information.
83
+
84
+ ## Step 5: Test Docker/Podman Integration
85
+
86
+ Ask Bob:
87
+ ```
88
+ Can you list all my local Docker images?
89
+ ```
90
+
91
+ Bob should execute the `list_local_images` tool and show your images.
92
+
93
+ ## Step 6: Test Code Engine Integration
94
+
95
+ Ask Bob:
96
+ ```
97
+ Can you list all my Code Engine projects?
98
+ ```
99
+
100
+ Bob should execute the `ce_list_projects` tool and show your projects.
101
+
102
+ ## Troubleshooting
103
+
104
+ ### MCP Server Not Showing as Connected
105
+
106
+ 1. **Check the path is correct**
107
+ ```bash
108
+ ls -la /Users/markusvankempen/projects/code-engine/code-engine-mcp-server/build/index.js
109
+ ```
110
+
111
+ 2. **Check Node.js is available**
112
+ ```bash
113
+ node --version
114
+ ```
115
+ Should show v18 or higher
116
+
117
+ 3. **Test the server manually**
118
+ ```bash
119
+ node /Users/markusvankempen/projects/code-engine/code-engine-mcp-server/build/index.js
120
+ ```
121
+ Should show: "Code Engine MCP Server running on stdio"
122
+ Press Ctrl+C to exit
123
+
124
+ 4. **Check VSCode Output**
125
+ - View → Output
126
+ - Select "Cline" from dropdown
127
+ - Look for MCP connection errors
128
+
129
+ ### Docker Commands Not Working
130
+
131
+ 1. **Verify Docker is installed**
132
+ ```bash
133
+ docker --version
134
+ ```
135
+
136
+ 2. **Check Docker daemon is running**
137
+ ```bash
138
+ docker ps
139
+ ```
140
+
141
+ 3. **Check permissions**
142
+ - You may need to add your user to the docker group
143
+ - Or use Podman instead
144
+
145
+ ### Code Engine Commands Not Working
146
+
147
+ 1. **Verify IBM Cloud CLI**
148
+ ```bash
149
+ ibmcloud --version
150
+ ```
151
+
152
+ 2. **Check Code Engine plugin**
153
+ ```bash
154
+ ibmcloud plugin list
155
+ ```
156
+ Should show "code-engine" plugin
157
+
158
+ 3. **Verify API key**
159
+ - Make sure you replaced the placeholder in settings.json
160
+ - Test manually:
161
+ ```bash
162
+ export IBMCLOUD_API_KEY="your-key-here"
163
+ ibmcloud ce project list
164
+ ```
165
+
166
+ ## What You Can Do Now
167
+
168
+ Once configured, you can ask Bob to:
169
+
170
+ ### Docker/Podman Operations
171
+ - "Detect my container runtime"
172
+ - "Build a container from ./Dockerfile as myapp:latest"
173
+ - "List all my local images"
174
+ - "Test myapp:latest locally on port 8080"
175
+ - "Get logs from container abc123"
176
+ - "Stop and remove container abc123"
177
+ - "List all running containers"
178
+
179
+ ### Code Engine Operations
180
+ - "List all my Code Engine projects"
181
+ - "List applications in project 'my-project'"
182
+ - "Get details of application 'my-app' in project 'my-project'"
183
+ - "Create an application named 'test-app' with image 'nginx:latest' in project 'my-project'"
184
+
185
+ ### Complete Workflows
186
+ ```
187
+ I have a Node.js app in ./my-app with a Dockerfile. Can you:
188
+ 1. Build it as myapp:v1.0.0
189
+ 2. Test it locally on port 3000
190
+ 3. Push it to icr.io/my-namespace/myapp:v1.0.0
191
+ 4. Deploy it to my Code Engine project "production"
192
+ ```
193
+
194
+ Bob will execute all these steps automatically!
195
+
196
+ ## Next Steps
197
+
198
+ 1. ✅ MCP server is built and ready
199
+ 2. ✅ Configuration example is provided
200
+ 3. ⏳ Add configuration to VSCode settings
201
+ 4. ⏳ Restart VSCode/Cline
202
+ 5. ⏳ Test with simple commands
203
+ 6. ⏳ Start using Bob for Docker and Code Engine tasks!
204
+
205
+ ## Need Help?
206
+
207
+ - Check the README.md for detailed documentation
208
+ - Review MCP_SERVER_SETUP_GUIDE.md for comprehensive setup
209
+ - Look at CLINE_CONFIG_EXAMPLE.json for configuration reference
210
+ - Open an issue if you encounter problems
211
+
212
+ ## Security Note
213
+
214
+ ⚠️ **Important**: Never commit your IBM Cloud API key to version control!
215
+
216
+ - Keep your API key in VSCode settings (not tracked by git)
217
+ - Or use environment variables
218
+ - Consider using IBM Cloud IAM for better security
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "code-engine-mcp-server",
3
+ "version": "1.0.0",
4
+ "description": "MCP server for IBM Code Engine and Docker/Podman integration",
5
+ "type": "module",
6
+ "main": "build/index.js",
7
+ "bin": {
8
+ "code-engine-mcp-server": "build/index.js"
9
+ },
10
+ "scripts": {
11
+ "build": "tsc && chmod +x build/index.js && chmod +x build/simple-client.js && chmod +x build/deploy-tool.js",
12
+ "dev": "tsx src/index.ts",
13
+ "client": "tsx simple-client.ts",
14
+ "deploy": "tsx src/deploy-cli.ts",
15
+ "start": "node build/simple-client.js",
16
+ "prepare": "npm run build",
17
+ "test": "echo \"Error: no test specified\" && exit 1"
18
+ },
19
+ "keywords": [
20
+ "mcp",
21
+ "code-engine",
22
+ "ibm-cloud",
23
+ "docker",
24
+ "podman"
25
+ ],
26
+ "author": "",
27
+ "license": "ISC",
28
+ "files": [
29
+ "build/",
30
+ "docs/",
31
+ "README.md",
32
+ "LICENSE"
33
+ ],
34
+ "dependencies": {
35
+ "@modelcontextprotocol/sdk": "^1.29.0",
36
+ "axios": "^1.7.0",
37
+ "dotenv": "^17.4.2"
38
+ },
39
+ "devDependencies": {
40
+ "@types/node": "^20.0.0",
41
+ "tsx": "^4.7.0",
42
+ "typescript": "^5.3.0"
43
+ }
44
+ }