Skip to content

Conversation

@robbrad
Copy link

@robbrad robbrad commented Sep 27, 2025

fixes #33

Summary by CodeRabbit

  • New Features
    • Introduced a configurable “browser-status” resource with a structured URI template.
    • Added a list endpoint to discover available browser status entries.
    • Enhanced the status response with clearer messaging for active/no session.
    • Responses now include an explicit MIME type for improved client handling.

@coderabbitai
Copy link

coderabbitai bot commented Sep 27, 2025

Walkthrough

Updated browser-status resource registration to use a descriptor with uriTemplate, list, and get handlers instead of ResourceTemplate. Added a list endpoint returning metadata and adjusted get to include mimeType and session-aware text. No other functional changes.

Changes

Cohort / File(s) Summary of Changes
Resource API migration
src/lib/server.js
Replaced ResourceTemplate-based registration with descriptor: added uriTemplate: "browser-status://{which}", implemented list() returning a single resource descriptor with mimeType, and updated get() to return contents with mimeType and session-based text. Minor formatting/trailing newline adjustments.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant C as Client
  participant S as MCP Server
  participant R as Resource Registry
  participant SS as Session State

  rect rgba(230,245,255,0.5)
  note over C,S: List resources
  C->>S: list("browser-status")
  S->>R: resolve descriptor
  R-->>S: { uriTemplate, list, get }
  S->>R: list()
  R-->>S: [{ uri: "browser-status://current", name, description, mimeType }]
  S-->>C: Resource list
  end

  rect rgba(235,255,235,0.5)
  note over C,S: Get resource
  C->>S: get("browser-status://current")
  S->>R: resolve descriptor
  R-->>S: { get }
  S->>SS: read currentSession
  SS-->>S: sessionId or null
  S->>R: get(uri)
  R-->>S: { contents: [{ uri, mimeType: "text/plain", text }] }
  S-->>C: Resource contents
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I hop through URIs with glee,
A list now greets inquisitively.
Get fetches truths, plain-text and bright,
Session awake or out of sight.
With templates tidy, paths align—
Thump-thump, the server’s doing fine. 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly states the correction to the MCP Resource List issue by including “fix MCP Resource List issue #33,” directly tying it to the problem being addressed. It is concise and focused on the main change without extraneous detail. This phrasing makes it clear to any reviewer that the PR resolves the specific list endpoint bug described in the linked issue.
Linked Issues Check ✅ Passed The pull request addresses the core requirement from issue #33 by implementing a list() method on the server.resource descriptor that returns an array of resource metadata, preventing the “undefined (reading 'list')” runtime error and restoring the expected resource listing functionality. The list method returns the necessary URI, name, description, and mimeType fields, and a complementary get() handler is provided as specified in the shared potential fix. These changes satisfy the linked issue’s coding requirement to provide a proper list endpoint.
Out of Scope Changes Check ✅ Passed All modifications are directly related to restructuring the server.resource API for “browser-status” to include list and get handlers and do not introduce any unrelated features or side effects beyond minor formatting adjustments. There are no code changes outside the scope of fixing the resource list issue. This ensures the pull request remains focused on the linked issue’s objectives.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9c1d066 and 8edc5ac.

📒 Files selected for processing (1)
  • src/lib/server.js (2 hunks)
🔇 Additional comments (1)
src/lib/server.js (1)

448-469: List descriptor resolves inspector crash

Registering the resource with explicit list/get handlers matches the newer MCP expectation and removes the undefined list access that was crashing the inspector. Looks solid.

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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 and usage tips.

@robbrad
Copy link
Author

robbrad commented Oct 21, 2025

@angiejones : this is to make the MCP compliant with the standard. Also allows it to work with assistants like Kiro

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.

MCP Resource List issue

1 participant