Skip to content

Ability to plugin additional containers#162

Merged
tleyden merged 12 commits into
mainfrom
extra_containers
Jul 12, 2026
Merged

Ability to plugin additional containers#162
tleyden merged 12 commits into
mainfrom
extra_containers

Conversation

@tleyden

@tleyden tleyden commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Drop plugin Docker/macOS-container MCP servers (e.g. a for prototyping) next to the existing core vault container. Currently via via a hand-edited config file only.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • code-rabbit-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b95fac5d-350d-4c61-947f-d308e36ebac6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch extra_containers

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds experimental plugin MCP containers alongside the existing vault container. The main changes are:

  • Plugin container config loading from brain3.yaml.
  • Startup wiring for Docker and macOS container runtimes.
  • Gateway registration of plugin MCP tools with container-name prefixes.
  • Router handling for plugin tool calls and plugin error responses.
  • E2E coverage and docs for a sample plugin container.

Confidence Score: 5/5

This looks safe to merge.

No blocking issues found in the changed code.

T-Rex T-Rex Logs

What T-Rex did

  • Runtime availability was checked and Docker or Podman were not found on the host.
  • The before-state E2E blocker command was recorded as skipped with exit code 125 due to the missing container runtime.
  • The after-state E2E blocker command was recorded as skipped with exit code 125 due to the missing container runtime.
  • The Python harness unittest suite was run and exited successfully (0).
  • The core Rust plugin tests completed successfully with exit code 0.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
crates/core/src/application/mcp_router.rs Adds plugin tool schema merging, prefixed tool-call routing, advertised-tool checks, and JSON-RPC plugin error responses.
apps/gateway/src/server.rs Builds plugin MCP clients from started containers and registers them with the gateway router.
crates/platform/src/container/startup.rs Adds plugin container startup and shutdown handling across Docker and macOS runtimes.
apps/gateway/tests/e2e_smoke.rs Adds Docker-based smoke coverage for plugin tool listing, plugin tool calls, and container cleanup.

Reviews (2): Last reviewed commit: "address greptile feedback" | Re-trigger Greptile

Comment thread crates/platform/src/container/startup.rs Outdated
Comment on lines +411 to +420
fn resolve_plugin_host_port(plugin: &PluginMcpContainerConfig) -> Result<u16, ContainerError> {
match plugin.host_port {
Some(port) => Ok(port),
None => pick_free_loopback_port().map_err(|error| {
ContainerError::Other(format!(
"failed to pick host port for Plugin MCP Container '{}': {error}",
plugin.name
))
}),
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Auto Port Can Race

When host_port is omitted, this selects a free loopback port and releases it before the container runtime publishes the port. Another local process can bind the same port in that gap, making the plugin startup fail or causing the gateway probe to reach the wrong service.

Comment thread crates/core/src/application/mcp_router.rs
Comment thread crates/core/src/application/mcp_router.rs Outdated
@tleyden
tleyden merged commit aa3213c into main Jul 12, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant