Skip to content

Add read-only local MCP session discovery - #57

Merged
purpshell merged 1 commit into
devfrom
codex/cli-mcp-audit-20260927
Sep 27, 2026
Merged

purpshell merged 1 commit into
devfrom
codex/cli-mcp-audit-20260927

Conversation

@purpshell

@purpshell purpshell commented Sep 27, 2026 •

Copy link
Copy Markdown
Member

Change

Add polymorfa_session_list to the local stdio MCP server as a bounded read-only discovery tool. It requires an explicit project UUID and the selected CLI organization API key with sessions:read. It uses the typed SDK and returns session ID, name, stored status and test-mode flag, plus safe request metadata. Phone numbers, message data, credentials and the raw API response are excluded. Project tokens do not silently fall back to an active API-key profile; errors return generic text so upstream response bodies cannot leak into MCP output.

Messaging sends, webhook mutations, broad toolsets and hosted MCP parity remain separate because their approval and authority contracts need individual treatment. Public docs are in monorepo PR #400, which must merge before this CLI PR.

Five-part assessment

  • API: Unaffected. Existing GET /platform/sessions?projectId= route enforces sessions:read and organization/project scope.
  • SDKs: Unaffected. The exact pinned @polymorfa/sdk@0.1.0-dev.20260926005918 already exposes typed sessions.list.
  • CLI: Updated local MCP tool registration, read-only annotations, credential resolution, curated output, error handling, help and tests. Existing listener tools and retry/write behavior unchanged.
  • Docs: README updated here; source-build public guide in PR #400. No changelog while the CLI npm package is unpublished.
  • Feature release: Source-build only, no flag, entitlement, experiment, deployment, or npm CLI publication. No live test per owner direction.

Verification

Node 22 format, lint, typecheck, build and full suite passed (919 tests, 4 skipped). Protocol tests verify discovery registration and read-only annotation; a local HTTP test verifies exact project filtering and credential use while excluding phone and secret data. Project-token fallback and error redaction are covered.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith with what you need. Autofix is disabled.

@coderabbitai

coderabbitai Bot commented Sep 27, 2026

Copy link
Copy Markdown

Warning

Review limit reached

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 37 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available. Your 68 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

The included review limit has been reached and this organization has disabled usage-based review continuation. Wait for reviews to reset or ask a billing admin to change After included review limits.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 47388efe-35b6-4123-a538-e5fe2c768bf7

📥 Commits

Reviewing files that changed from the base of the PR and between f2d7605 and 725421b.

📒 Files selected for processing (6)
  • README.md
  • src/commands/mcp/serve.ts
  • src/mcp/server.ts
  • src/mcp/session-discovery.ts
  • test/mcp/server.test.ts
  • test/mcp/session-discovery.test.ts

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

@purpshell

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-27T00:07:25.840916Z 725421b Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 725421b568

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@purpshell
purpshell merged commit efca79c into dev Sep 27, 2026
3 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