Conversation
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)
Contributor
There was a problem hiding this comment.
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
--publicmode (tool allowlist + SSRF-style socket_path stripping) and tests. - Add MCP server
--socketstartup flag and global socket resolution precedence. - Upgrade
randto0.10.1across 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 gen → random and add RngExt import. |
| examples/weather-mesh-demo/weather-mesh-common/src/contracts/location.rs | Migrate gen → random and add RngExt import. |
| examples/weather-mesh-demo/weather-mesh-common/src/contracts/humidity.rs | Migrate gen → random 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added
--publicflag restricts the MCP server to read-only tools for safe internet-facing deployments with SSRF protection (tools/aimdb-mcp)--socketflag: Default socket path can be set at startup, simplifying single-instance workflows (tools/aimdb-mcp)Changed
rand0.8 → 0.10.1: Upgraded across workspace (aimdb-data-contracts,aimdb-embassy-adapter, examples). Migrated API:gen→random,SmallRngseed size 16 → 32, addedRngExtimports.