feat(connect): stat-only status + on-demand content reads (US1, MCP-2829)#706
Merged
Conversation
Related #696 Spec 075 US1. Connect overall status (GetAllStatus) now determines each client's installed state via os.Stat metadata only and performs ZERO config content reads, eliminating the macOS "wants to access data from other apps" privacy prompt storm when simply viewing status (FR-001, SC-001/SC-002). Reading a client's config contents to detect whether mcpproxy is registered now happens only on an explicit per-client action via the new GetStatus(id), which resolves Connected + AccessState (FR-002). ## Changes - Add a content-read seam: Service.readFile (default os.ReadFile) + NewServiceWithReader / setReadFile so tests inject reads/denials. - ClientStatus gains additive access_state + remediation fields (FR-006). - GetAllStatus: metadata-only existence; AccessState="unknown", Connected=false for installed clients (eager findEntry removed). - GetStatus(clientID): single on-demand content read via the seam; resolves accessible/absent/malformed and Connected. - Route all content reads (readOrCreate*, disconnect*, verifyJSONEntry, entry-finders) through the seam; entry-finders parse bytes only. - GetConnectedCount/GetConnectedIDs re-implemented to read lazily per client. - CLI `mcpproxy connect` resolves Connected on demand (explicit action), preserving the CONNECTED column. ## Testing - New TestGetAllStatus_NoContentReads (reader asserts 0 calls), TestGetStatus_ReadsSingleClientOnDemand (exactly 1 read), plus absent / malformed / unknown-client cases. - Migrated GetAllStatus connected-detection tests to GetStatus. - go test ./internal/connect/... ./internal/httpapi/... -race green; golangci-lint v2 clean; build (personal+server) ok; API E2E 65/65 pass.
Deploying mcpproxy-docs with
|
| Latest commit: |
27de6cb
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://5ad2b565.mcpproxy-docs.pages.dev |
| Branch Preview URL: | https://075-us1-stat-only-connect.mcpproxy-docs.pages.dev |
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 27713068786 --repo smart-mcp-proxy/mcpproxy-go
|
This was referenced Jun 17, 2026
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.
Summary
Spec 075 US1 (MVP) — kills the macOS "wants to access data from other apps" App-Data prompt storm by making Connect's overall status determine installed-state via
os.Statmetadata only, deferring config content reads to explicit per-client actions.Related #696· Spec:specs/075-macos-tcc-connect/(US1, FR-001/FR-002, SC-001/SC-002) · Tasks T003–T012.What changed
Service.readFile(defaultos.ReadFile) +NewServiceWithReader/setReadFile, mirroring the existinghomeDiroverride, so tests inject reads/denials without a real OS denial.ClientStatusfields (T007, FR-006):access_state(json:"access_state") andremediation(json:"remediation,omitempty"). No existing field removed/repurposed.GetAllStatusis now content-read-free (T008): existence viaos.Stat; installed clients reportaccess_state="unknown",connected=false. The eagerfindEntrycall is removed.GetStatus(clientID)(T009): single on-demand content read via the seam; resolvesConnected+access_state∈ {accessible,absent,malformed}. (deniedis US2.)readOrCreate*,disconnect*,verifyJSONEntry, and the entry-finders (now byte-parsers) — route throughs.read.GetConnectedCount/GetConnectedIDsre-implemented to read per-client on demand.mcpproxy connectresolvesConnectedon demand (explicit user action) so the CONNECTED column is unchanged.docs/api/rest-api.mddocuments the GET/api/v1/connectstat-only behavior + additive fields.Testing (T012)
TestGetAllStatus_NoContentReads(injected reader fails if called → asserts 0 content reads) andTestGetStatus_ReadsSingleClientOnDemand(asserts exactly 1 read), plus absent / malformed / unknown-client cases.GetAllStatus().Connectedassertions to the on-demandGetStatuspath (behavior change is by design per the spec).go test ./internal/connect/... ./internal/httpapi/... -race✅ ·golangci-lintv2 (CI config) 0 issues ✅ · build personal +-tags server✅ ·./scripts/test-api-e2e.sh65/65 ✅Scope
US1 only. US2 (denied classification + remediation surfacing) and US3 (doctor check) are separate issues; the
access_state/remediationfields and the seam are forward-compatible with them. A permission-denied read currently maps toaccess_state="unknown"(US2 refines it todenied).