Commit ee8c869
authored
feat: Implement MCP (Model Context Protocol) resource and controller with RBAC roles (#12)
* feat: Implement MCP (Model Context Protocol) resource and controller with RBAC roles
Signed-off-by: Eden Reich <eden.reich@gmail.com>
* feat: Add MCP server configuration with namespace and specifications
Would be cool to just have a side-car container that ensures those STDIO MCP servers can also support SSE or any streamable HTTP.
Some MCPs supports only STDIO. which makes it complex to connect to in a containerized environment. Meaning you would normally have to create a custom bridge (web server) that sends a command to the internal process - not ideal, but it-is what it-is.
Signed-off-by: Eden Reich <eden.reich@gmail.com>
* fix: Update MCP image reference to use the correct repository
I'm not going to host those servers registry, I think it would be easier to just use the existing ones.
Signed-off-by: Eden Reich <eden.reich@gmail.com>
* fix: Ensure consistent TLS secret name in MCP ingress configuration
Signed-off-by: Eden Reich <eden.reich@gmail.com>
* feat: Enhance MCP configuration with server, bridge, ingress, and TLS specifications
Signed-off-by: Eden Reich <eden.reich@gmail.com>
* feat: Add Horizontal Pod Autoscaler (HPA) configuration for MCP server
- Introduced HPA configuration under the MCP server spec, allowing for dynamic scaling based on defined metrics.
- Added properties for scaling behavior, including scaleUp and scaleDown policies, stabilization windows, and metrics specifications.
- Updated image and replicas fields to provide defaults and descriptions for better clarity.
- Removed deprecated ingress configuration and replaced it with HPA-specific settings to streamline deployment management.
Signed-off-by: Eden Reich <eden.reich@gmail.com>
* fix: WIP - update import statements and logger usage in MCP controller
I think I should stick to standard MCP using node life time support server, and if the user wants they can configure their own container image, this allows more flexibility. Depending on what's configured option is used the package will take precedence over the image.
Signed-off-by: Eden Reich <eden.reich@gmail.com>
* fix: Start with implementing the official way of running MCP servers, then will switch to custom MCPs
Signed-off-by: Eden Reich <eden.reich@gmail.com>
* fix: Remove unused ingress configuration from MCP server YAML
I think ingress doesn't make a lot of sense in the context of MCP, normally those are server you would like to run internally. I don't think there is a use-case to expose it to the outside world.
Signed-off-by: Eden Reich <eden.reich@gmail.com>
* fix: Remove unnecessary comment in shouldWatchNamespace function
Signed-off-by: Eden Reich <eden.reich@gmail.com>
* test: Add basic tests
Signed-off-by: Eden Reich <eden.reich@gmail.com>
* fix: Remove unnecessary variable declaration in MCP controller test
Signed-off-by: Eden Reich <eden.reich@gmail.com>
* refactor: Simplify fields
Building a generic bridge for all Stdio servers is too complex. I'll just create a registry for MCP servers written in golang so people can pull them.
Will add the essential ones like filesystem context7. Just need to build those containers and push them to registry so it's possible to pull them and run them as a streamable http that supports also https.
I think the default npx -y with the modelcontext protocol lake of production settings.
Signed-off-by: Eden Reich <eden.reich@gmail.com>
* feat: Enhance MCP Controller Tests and CRD Definitions
- Refactored MCP controller tests to use DescribeTable for better organization and readability.
- Added additional test cases for various reconciliation scenarios, including handling of HPA and service reconciliation.
- Updated CRD definitions to include additional printer columns for MCP resources, displaying the URL of the MCP server and the resource age.
- Modified the schema to support an array type for the command field in the MCP spec.
- Added a new field in the status to store the URL of the MCP server.
Signed-off-by: Eden Reich <eden.reich@gmail.com>
* chore: Update test coverage badge to reflect current coverage
Signed-off-by: Eden Reich <eden.reich@gmail.com>
---------
Signed-off-by: Eden Reich <eden.reich@gmail.com>1 parent 0481b4f commit ee8c869
21 files changed
Lines changed: 4577 additions & 28 deletions
File tree
- api/v1alpha1
- cmd
- config
- crd
- bases
- rbac
- samples
- examples
- internal/controller
- manifests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
29 | 38 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
275 | | - | |
276 | | - | |
| 275 | + | |
| 276 | + | |
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
0 commit comments