Skip to content

Feat/mcp public mode#82

Merged
lxsaah merged 9 commits intomainfrom
feat/mcp-public-mode
Apr 13, 2026
Merged

Feat/mcp public mode#82
lxsaah merged 9 commits intomainfrom
feat/mcp-public-mode

Conversation

@lxsaah
Copy link
Copy Markdown
Contributor

@lxsaah lxsaah commented Apr 12, 2026

Added

  • MCP public mode: New --public flag restricts the MCP server to read-only tools for safe internet-facing deployments with SSRF protection (tools/aimdb-mcp)
  • MCP --socket flag: Default socket path can be set at startup, simplifying single-instance workflows (tools/aimdb-mcp)

Changed

  • rand 0.8 → 0.10.1: Upgraded across workspace (aimdb-data-contracts, aimdb-embassy-adapter, examples). Migrated API: genrandom, SmallRng seed size 16 → 32, added RngExt imports.
  • README: Reordered quickstart — remote MCP exploration (zero install) is now step 2, local Docker setup moved to step 3.

lxsaah added 8 commits April 11, 2026 19:29
Add clap for CLI argument parsing with two new flags:

- --public: restricts the MCP server to 3 read-only tools
  (discover_instances, list_records, get_record) for use on
  untrusted/internet-facing endpoints. Non-public tools are
  excluded from tools/list and rejected in tools/call.

- --socket <PATH>: sets a default Unix socket path for all
  tool connections (equivalent to AIMDB_SOCKET env var).

Also provides --help and --version for free via clap.

Ref: design doc 007 (public MCP endpoint)
@lxsaah lxsaah requested a review from Copilot April 12, 2026 19:33
@lxsaah lxsaah self-assigned this Apr 12, 2026
@lxsaah lxsaah added the 🏗️ core Core engine work label Apr 12, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds “public mode” and a startup-configurable default socket to the aimdb-mcp server, alongside a workspace-wide rand upgrade and quickstart docs reordering.

Changes:

  • Add MCP server --public mode (tool allowlist + SSRF-style socket_path stripping) and tests.
  • Add MCP server --socket startup flag and global socket resolution precedence.
  • Upgrade rand to 0.10.1 across crates/examples and adjust simulation code + docs.

Reviewed changes

Copilot reviewed 23 out of 24 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tools/aimdb-mcp/src/tools/mod.rs Add global default socket and update socket resolution order/error.
tools/aimdb-mcp/src/server.rs Implement public mode tool filtering/guardrails and add tests.
tools/aimdb-mcp/src/main.rs Add clap-based CLI parsing for --public/--socket.
tools/aimdb-mcp/CHANGELOG.md Document new flags and public-mode behavior.
tools/aimdb-mcp/Cargo.toml Add clap dependency for CLI flags.
README.md Reorder quickstart to highlight remote MCP exploration.
examples/weather-mesh-demo/weather-station-gamma/src/main.rs Update SmallRng seed size for new rand.
examples/weather-mesh-demo/weather-station-gamma/Cargo.toml Bump rand dependency for embedded example.
examples/weather-mesh-demo/weather-station-beta/src/main.rs Update RNG initialization for new rand.
examples/weather-mesh-demo/weather-station-beta/Cargo.toml Bump rand dependency.
examples/weather-mesh-demo/weather-mesh-common/src/contracts/temperature.rs Migrate genrandom and add RngExt import.
examples/weather-mesh-demo/weather-mesh-common/src/contracts/location.rs Migrate genrandom and add RngExt import.
examples/weather-mesh-demo/weather-mesh-common/src/contracts/humidity.rs Migrate genrandom and add RngExt import.
examples/weather-mesh-demo/weather-mesh-common/Cargo.toml Bump rand dependency/features for simulation.
examples/embassy-mqtt-connector-demo/Cargo.toml Bump rand dependency for embedded demo.
examples/embassy-knx-connector-demo/Cargo.toml Bump rand dependency for embedded demo.
CHANGELOG.md Document MCP flags + rand upgrade + README change (but duplicates headings).
Cargo.lock Lockfile updates for rand/clap transitive changes.
aimdb-embassy-adapter/CHANGELOG.md Note rand dev-dependency bump.
aimdb-embassy-adapter/Cargo.toml Bump rand dev-dependency.
aimdb-data-contracts/CHANGELOG.md Note rand dependency bump.
aimdb-data-contracts/Cargo.toml Bump rand dependency.
.vscode/mcp.json Update workspace MCP config to point at remote HTTP server.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tools/aimdb-mcp/src/server.rs
Comment thread tools/aimdb-mcp/src/server.rs Outdated
Comment thread examples/weather-mesh-demo/weather-station-beta/src/main.rs
Comment thread examples/weather-mesh-demo/weather-station-gamma/Cargo.toml
Comment thread CHANGELOG.md
Comment thread tools/aimdb-mcp/src/server.rs
@lxsaah lxsaah merged commit bbe6414 into main Apr 13, 2026
9 checks passed
@lxsaah lxsaah deleted the feat/mcp-public-mode branch April 13, 2026 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🏗️ core Core engine work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants