Skip to content

feat: Implement MCP (Model Context Protocol) resource and controller with RBAC roles#12

Merged
edenreich merged 15 commits intomainfrom
feature/add-mcp-server-crds
Jun 28, 2025
Merged

feat: Implement MCP (Model Context Protocol) resource and controller with RBAC roles#12
edenreich merged 15 commits intomainfrom
feature/add-mcp-server-crds

Conversation

@edenreich
Copy link
Copy Markdown
Collaborator

Summary

This pull request implements the Model Context Protocol (MCP) resource and controller in the Inference Gateway project. It's just an initial scaffolding, and possibly a draft implementation, would surely be changed after merge.

edenreich added 15 commits June 27, 2025 15:32
…with RBAC roles

Signed-off-by: Eden Reich <eden.reich@gmail.com>
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>
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>
Signed-off-by: Eden Reich <eden.reich@gmail.com>
… specifications

Signed-off-by: Eden Reich <eden.reich@gmail.com>
- 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>
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>
… then will switch to custom MCPs

Signed-off-by: Eden Reich <eden.reich@gmail.com>
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>
Signed-off-by: Eden Reich <eden.reich@gmail.com>
Signed-off-by: Eden Reich <eden.reich@gmail.com>
Signed-off-by: Eden Reich <eden.reich@gmail.com>
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>
- 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>
Signed-off-by: Eden Reich <eden.reich@gmail.com>
@edenreich edenreich merged commit ee8c869 into main Jun 28, 2025
4 checks passed
@edenreich edenreich deleted the feature/add-mcp-server-crds branch June 28, 2025 23:40
ig-semantic-release-bot bot added a commit that referenced this pull request Jun 28, 2025
## [0.9.0](v0.8.0...v0.9.0) (2025-06-28)

### ✨ Features

* Implement MCP (Model Context Protocol) resource and controller with RBAC roles ([#12](#12)) ([ee8c869](ee8c869))

### 📚 Documentation

* **fix:** Correct emoji rendering in API Overview section of README ([0481b4f](0481b4f))
@ig-semantic-release-bot
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.9.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant