Skip to content

feat: add MCP server filter to MCP sessions sidebar - #5918

Merged
Pratham-Mishra04 merged 1 commit into
devfrom
08-06-feat_add_mcp_server_filter_to_auth_sessions_sidebar_scoped_to_per-user_auth_types_and_the_selected_type_filter
Aug 8, 2026
Merged

Pratham-Mishra04 merged 1 commit into
devfrom
08-06-feat_add_mcp_server_filter_to_auth_sessions_sidebar_scoped_to_per-user_auth_types_and_the_selected_type_filter

Conversation

@Pratham-Mishra04

Copy link
Copy Markdown
Collaborator

Summary

Adds an "MCP Server" filter section to the MCP Sessions filter sidebar, allowing users to narrow sessions down to one or more specific MCP clients. The mcp_client_id filter is now fully integrated into the shared filter state rather than being managed separately through URL state.

Changes

  • Added mcp_client_id to the MCPSessionFilters interface and EMPTY_FILTERS, bringing it in line with the other filter fields (kind, status, auth_mode) so it participates in filter count, reset, and URL sync correctly.
  • Fixed a bug where mcp_client_id was being read directly from urlState for the query instead of from the unified filters object, causing it to be out of sync with the rest of the filter pipeline.
  • Added MCPClientFilterSection to the filter sidebar — a collapsible section with a searchable checkbox list of MCP clients. The list is fetched lazily (only when the section is opened or a selection already exists) and scoped to per_user_oauth and/or per_user_headers auth types, narrowed automatically based on the active "Type" filter.
  • Added SearchableCheckboxList, a reusable component combining a debounced search input with checkbox rows, supporting server-side search via an onSearch callback and a loading indicator.
  • Added useAutoFocusOnOpen, a hook that focuses the search input when the section is explicitly opened by the user, skipping the initial mount to avoid stealing focus on page load.
  • Extended FilterSection with an onOpenChange callback so parent components can react to collapse/expand events.
  • Updated filtersActive and activeFilterCount to include mcp_client_id, ensuring the reset button and active filter badge reflect this filter correctly.

Type of change

  • Bug fix
  • Feature
  • Refactor
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (React)
  • Docs

How to test

  1. Navigate to the MCP Sessions page.
  2. Open the filter sidebar and expand the "MCP Server" section.
  3. Verify the search input focuses automatically on open.
  4. Search for an MCP client by name and confirm results are filtered.
  5. Select one or more clients and confirm the session list updates accordingly.
  6. Verify the active filter count badge increments for each selected client.
  7. Verify the "Type" filter (OAuth/Headers) narrows the available MCP clients in the list.
  8. Reset filters and confirm mcp_client_id is cleared along with the other filters.
  9. Reload the page with an mcp_client_id in the URL and confirm the section opens pre-populated.
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build

Screenshots/Recordings

Add before/after screenshots of the filter sidebar showing the new "MCP Server" section.

Breaking changes

  • Yes
  • No

Related issues

Security considerations

No new auth or PII concerns. The MCP client list query is scoped to per-user auth types and respects existing access controls.

Checklist

  • I read docs/contributing/README.md and followed the guidelines
  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI)
  • I verified the CI pipeline passes locally if applicable

This was referenced Aug 6, 2026

Pratham-Mishra04 commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@ui/app/workspace/mcp-sessions/views/mcpSessionsFilterSidebar.tsx`:
- Around line 394-416: Update the useGetMCPClientsQuery usage in the MCP filter
sidebar to read its isError state and pass that failure state to
SearchableCheckboxList using the component’s existing error and retry APIs.
Ensure failed requests render an error message with a retry action instead of
the empty “No results” state, while preserving the current loading, empty, and
successful client-list behavior.
- Around line 386-411: The MCP client filter UI must keep every ID in
filters.mcp_client_id visible and removable even when authType, searchQuery, or
the offset-0 pagination excludes it. Update the mcpClients construction in the
MCP client filter section to merge selected clients into the fetched results,
resolving their labels as needed, while preserving the existing query results
and avoiding duplicates.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 310c035f-d94c-42b2-9973-54b08d6b827f

📥 Commits

Reviewing files that changed from the base of the PR and between ee6329e and e77affc.

📒 Files selected for processing (2)
  • ui/app/workspace/mcp-sessions/page.tsx
  • ui/app/workspace/mcp-sessions/views/mcpSessionsFilterSidebar.tsx

Comment thread ui/app/workspace/mcp-sessions/views/mcpSessionsFilterSidebar.tsx
Comment thread ui/app/workspace/mcp-sessions/views/mcpSessionsFilterSidebar.tsx
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 08-06-feat_replace_mcp_oauth_grants_top_filter_bar_with_a_side_filter_panel branch from ee6329e to 67a9f01 Compare August 6, 2026 21:53
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 08-06-feat_add_mcp_server_filter_to_auth_sessions_sidebar_scoped_to_per-user_auth_types_and_the_selected_type_filter branch from e77affc to 195a3dc Compare August 6, 2026 21:53
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 6, 2026
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 08-06-feat_replace_mcp_oauth_grants_top_filter_bar_with_a_side_filter_panel branch from 67a9f01 to faca1fc Compare August 8, 2026 10:29
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 08-06-feat_add_mcp_server_filter_to_auth_sessions_sidebar_scoped_to_per-user_auth_types_and_the_selected_type_filter branch from 195a3dc to 9f7e91b Compare August 8, 2026 10:29

Pratham-Mishra04 commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator Author

Merge activity

  • Aug 8, 10:33 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Aug 8, 11:22 AM UTC: Graphite rebased this pull request as part of a merge.
  • Aug 8, 11:23 AM UTC: @Pratham-Mishra04 merged this pull request with Graphite.

@Pratham-Mishra04
Pratham-Mishra04 changed the base branch from 08-06-feat_replace_mcp_oauth_grants_top_filter_bar_with_a_side_filter_panel to graphite-base/5918 August 8, 2026 11:18
@Pratham-Mishra04
Pratham-Mishra04 changed the base branch from graphite-base/5918 to dev August 8, 2026 11:21
@Pratham-Mishra04
Pratham-Mishra04 dismissed coderabbitai[bot]’s stale review August 8, 2026 11:21

The base branch was changed.

@Pratham-Mishra04
Pratham-Mishra04 requested a review from a team as a code owner August 8, 2026 11:21
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 08-06-feat_add_mcp_server_filter_to_auth_sessions_sidebar_scoped_to_per-user_auth_types_and_the_selected_type_filter branch from 9f7e91b to 58f2e0e Compare August 8, 2026 11:21
@Pratham-Mishra04
Pratham-Mishra04 merged commit 839bfd0 into dev Aug 8, 2026
14 of 15 checks passed
@Pratham-Mishra04
Pratham-Mishra04 deleted the 08-06-feat_add_mcp_server_filter_to_auth_sessions_sidebar_scoped_to_per-user_auth_types_and_the_selected_type_filter branch August 8, 2026 11:23
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.

2 participants