Skip to content

🧭 fix: Reduce MCP Registry ACL Lookups#13195

Merged
danny-avila merged 1 commit into
devfrom
danny-avila/fix-mcp-registry-acl-principals
May 19, 2026
Merged

🧭 fix: Reduce MCP Registry ACL Lookups#13195
danny-avila merged 1 commit into
devfrom
danny-avila/fix-mcp-registry-acl-principals

Conversation

@danny-avila

Copy link
Copy Markdown
Owner

Summary

I reduced redundant ACL principal resolution in the MCP registry DB lookup path and moved MCP-related Agent queries behind data-schemas methods.

  • Reused resolved principals across direct MCP server and agent-accessible MCP server lookups in ServerConfigsDB.getAll.
  • Added data-schemas Agent methods for MCP server-name lookups so packages/api no longer calls the Agent model directly for this flow.
  • Passed the request user role through MCP registry callers to avoid an extra user role lookup when resolving ACL principals.
  • Updated MCP service and registry tests to cover the optimized path and the role-aware call.

Change Type

  • Bug fix (non-breaking change which fixes an issue)

Testing

  • cd packages/api && npx jest src/mcp/registry/__tests__/ServerConfigsDB.test.ts --runInBand
  • cd api && npx jest server/services/__tests__/MCP.spec.js --runInBand
  • npm run build --workspace=@librechat/api

Test Configuration:

  • Node/Jest workspace test runs from the local LibreChat checkout.
  • The package build completes with existing unrelated warnings for missing optional telemetry/metrics peer packages.

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes

Copilot AI review requested due to automatic review settings May 19, 2026 15:02

Copy link
Copy Markdown
Owner Author

@codex review

@danny-avila
danny-avila changed the base branch from main to dev May 19, 2026 15:06
@danny-avila
danny-avila marked this pull request as ready for review May 19, 2026 15:06
@danny-avila
danny-avila force-pushed the danny-avila/fix-mcp-registry-acl-principals branch from bd5c29f to 2e99a68 Compare May 19, 2026 15:09

Copy link
Copy Markdown
Owner Author

@codex review

@github-actions

Copy link
Copy Markdown
Contributor

GitNexus: 🚀 deployed

The LibreChat-pr-13195 index is now live on the MCP server.
Deploy run

@danny-avila
danny-avila force-pushed the danny-avila/fix-mcp-registry-acl-principals branch from 2e99a68 to 02d5ce6 Compare May 19, 2026 15:19

Copy link
Copy Markdown
Owner Author

@codex review

Copilot AI 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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

ℹ️ 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".

@github-actions

Copy link
Copy Markdown
Contributor

GitNexus: 🚀 deployed

The LibreChat-pr-13195 index is now live on the MCP server.
Deploy run

@danny-avila
danny-avila merged commit 749eb06 into dev May 19, 2026
13 checks passed
@danny-avila
danny-avila deleted the danny-avila/fix-mcp-registry-acl-principals branch May 19, 2026 21:16
fuuuzzy pushed a commit to fuuuzzy/LibreChat that referenced this pull request May 22, 2026
ThomasVuNguyen pushed a commit to ThomasVuNguyen/LibreChat that referenced this pull request Jul 15, 2026
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.

[Bug]: ServerConfigsDB.getAll() calls getUserPrincipals twice per request, causing redundant DB queries on every MCP server list fetch

2 participants