LibreChat/api/server/services
Danny Avila 3375bb5c3c
🗝️ feat: Limit an API Key's Runs to the MCP Tools Its Owner Granted It (#18280)
* 🗝️ feat: Store an API Key's MCP Grants on the Key, One per Agent

* 🧬 refactor: Let the Consent Service and Enforcement Act for Any Grant Subject

* 🗝️ feat: Check an API Key Run's MCP Calls Against the Key's Grant for the Agent

* 🗝️ feat: Put Remote API Runs Under Their Key's Grant, Behind a Config Switch

* 🩹 fix: Export the Key Grant Storage the Server Wiring Loads

* 🔌 feat: Let an Owner Grant an API Key Its MCP Access From Settings

* 🗝️ fix: Decide Key Grant Access, Mode and Kind of Key in the TypeScript Host

The agent-access check and the grant-mode lookup lived in the legacy route and service
files. The host now builds the check from an injected agent reader and permission
reader, and the key handlers resolve the mode from an injected configuration reader.

Each authorized call read the owner three times and their configuration twice. The host
now reads both once per call and shares them between the access check, the limits and
the offer; nothing is kept between calls.

A background worker rebuilds its request from the admitted record, which names the key
but not its kind, so a key issued to an integration lost its exemption and its channel
runs were refused. The host asks the key store when the request carries no key itself.

* 🔌 fix: Say When a Key Grant's Agent List Is Loading, Failed or Empty

The key grant dialog turned a failed or pending agent list into an empty picker with an
instruction to choose from it. It now shows a spinner while the list loads, an error
with a retry when it could not be read and nothing is cached, and a plain statement when
the owner has no agent the key could run.

* 🧪 test: Hold the Pin Fences on an API Key's Per-Agent Grants

* 🔌 fix: Offer a Key Grant for the Agents the Key Can Run, and Only for Personal Keys

The grant dialog's picker read the app's agent catalog, which lists agents the owner can
view. Running an agent with a key follows another rule: the agent is shared with the
owner for remote use, or is theirs to share. An agent shared only for remote use could be
run but not granted. A new list, GET /api/api-keys/agents, applies that rule to all
agents, and the picker reads it.

A key issued to an integration holds no grants but showed the MCP access button. The key
list now marks such a key, and the button is not shown for it.
2026-11-18 13:28:39 -05:00
..
__tests__ 🧵 feat: Run Background Shell Commands Without Holding Their Worktree (#18247) 2026-11-17 09:36:27 -05:00
Agents 🌐 feat: Wire Responses and Channel Lifecycle APIs (#17611) 2026-11-10 21:04:03 -08:00
ApiKeys 🗝️ feat: Limit an API Key's Runs to the MCP Tools Its Owner Granted It (#18280) 2026-11-18 13:28:39 -05:00
Artifacts
Config 📦 feat: Package Shared Slack Workspace Deployments (#17815) 2026-11-10 21:04:10 -08:00
Endpoints 🙋 feat: Let a Schedule's Owner Approve a Tool Before Each Use (#18277) 2026-11-18 12:18:15 -05:00
Files 🥤 feat: Let Remote SDK Agents Read Native Chat Attachments (#18419) 2026-11-18 11:49:24 -05:00
MCP 🔐 fix: Fence ACL Viewers and Surface Revocation Failures When Removing Shared MCP Servers (#17506) 2026-10-28 00:37:07 +01:00
Runs 🗑️ fix: Drain Assistants Runs Before Erasing the Account (#17937) 2026-11-09 15:35:31 +01:00
Schedules 🙋 feat: Let a Schedule's Owner Approve a Tool Before Each Use (#18277) 2026-11-18 12:18:15 -05:00
Skills 🔌 feat: Integrate Durable Skill Lifecycle Across Writers and Routes (#17043) 2026-10-16 09:05:05 -07:00
start 🔑 perf: Cache JWT Users and Batch Auth-Path Reads (#17466) 2026-10-30 00:24:08 +01:00
Threads fix: Guard Mongo Cleanup In Api Services Tests (#17990) 2026-11-11 11:10:39 +01:00
Tools 🚪 fix: Refuse Interactive MCP Sign-in on Remote Agent API Runs (#18058) 2026-11-11 20:56:17 -05:00
ActionService.js 🫢 fix: Keep OAuth Credentials Out of Logs (#17409) 2026-10-24 09:43:06 +02:00
ActionService.spec.js 🫢 fix: Keep OAuth Credentials Out of Logs (#17409) 2026-10-24 09:43:06 +02:00
AssistantService.js 🪦 refactor: Remove Dead Legacy API Modules and Root Tooling (#17114) 2026-10-15 12:25:24 +02:00
AuthService.js 📪 fix: Require Email Delivery for Password Reset Links (#17823) 2026-11-09 08:27:33 -05:00
AuthService.spec.js 📪 fix: Require Email Delivery for Password Reset Links (#17823) 2026-11-09 08:27:33 -05:00
ChannelAuthority.js 🔗 fix: Update Slack Account Linking in Place (#18039) 2026-11-10 21:04:12 -08:00
ChannelAuthority.spec.js 👤 feat: Link and Revoke Personal Channel Accounts (#17615) 2026-11-10 21:04:04 -08:00
Channels.js 🧹 refactor: Consolidate Channel and Response Contracts (#17705) 2026-11-10 21:04:06 -08:00
Channels.spec.js 🌐 feat: Connect Organization Slack Workspaces to Agents (#17811) 2026-11-10 21:04:10 -08:00
createRunBody.js
createRunBody.spec.js
GraphApiService.js 🥸 fix: Resolve Directory Principals Through Trusted Integration Data (#17825) 2026-11-10 09:22:08 -05:00
GraphApiService.spec.js fix: Guard Mongo Cleanup In Api Services Tests (#17990) 2026-11-11 11:10:39 +01:00
GraphTokenService.js
initializeMCPs.js 🙈 feat: Let Config Profiles Hide librechat.yaml MCP Servers and Remove Their Fields (#17327) 2026-10-22 14:10:31 +02:00
initializeMCPs.plugins.spec.js 🙈 feat: Let Config Profiles Hide librechat.yaml MCP Servers and Remove Their Fields (#17327) 2026-10-22 14:10:31 +02:00
initializeMCPs.spec.js 🙈 feat: Let Config Profiles Hide librechat.yaml MCP Servers and Remove Their Fields (#17327) 2026-10-22 14:10:31 +02:00
initializeOAuthReconnectManager.js 🧯 fix: Guard SSE Writes and Interval Cleanups Against Crashes (#17462) 2026-10-27 23:06:58 +01:00
initializeOAuthReconnectManager.spec.js 🧯 fix: Guard SSE Writes and Interval Cleanups Against Crashes (#17462) 2026-10-27 23:06:58 +01:00
LangfusePromptSync.js 🏭 refactor: Centralize Source Prompt Imports in the Prompt Service (#17272) 2026-10-24 13:51:31 +02:00
LangfusePromptSync.spec.js 🏭 refactor: Centralize Source Prompt Imports in the Prompt Service (#17272) 2026-10-24 13:51:31 +02:00
MCP.js 🪪 feat: Add Agent Identity to Provider and MCP Header Templates (#18113) 2026-11-13 13:02:39 -05:00
MCP.spec.js 🪪 feat: Add Agent Identity to Provider and MCP Header Templates (#18113) 2026-11-13 13:02:39 -05:00
MCPAuthorizationFenceRetry.js
MCPAuthorizationFenceRetry.spec.js
MCPRequestContext.js
OboPolicyService.js
OboTokenService.js 🙈 fix: Mask Emails and Drop Personal Identifiers From Logs (#17048) 2026-10-15 15:54:27 +02:00
OboTokenService.spec.js
OpenIDRefreshFlight.js
OpenIDRefreshFlight.spec.js
OpenIDRefreshRecovery.js 🔐 fix: Retire Credentials by Their Committing Write and on Opt-In 2FA (#17504) 2026-11-05 22:53:11 +01:00
OpenIDSessionRefresh.js
OpenIDSessionRefresh.spec.js 🪪 fix: Boot-Paint a Cached Theme Only for Its Signed-In Owner (#16926) 2026-10-14 11:08:53 +02:00
PermissionService.js 🥸 fix: Resolve Directory Principals Through Trusted Integration Data (#17825) 2026-11-10 09:22:08 -05:00
PermissionService.spec.js fix: Guard Mongo Cleanup In Api Services Tests (#17990) 2026-11-11 11:10:39 +01:00
PluginService.js 🪦 refactor: Remove Dead Legacy API Modules and Root Tooling (#17114) 2026-10-15 12:25:24 +02:00
PluginService.spec.js 🔐 fix: Encrypt User Plugin Credentials With Random-IV v3 Format (#16996) 2026-10-12 16:33:08 +02:00
Prompts.consumers.spec.js 🏭 refactor: Centralize Source Prompt Imports in the Prompt Service (#17272) 2026-10-24 13:51:31 +02:00
Prompts.js 🏭 refactor: Centralize Source Prompt Imports in the Prompt Service (#17272) 2026-10-24 13:51:31 +02:00
Prompts.spec.js 🏭 refactor: Centralize Source Prompt Imports in the Prompt Service (#17272) 2026-10-24 13:51:31 +02:00
RefreshTokenBridge.js
RefreshTokenBridge.spec.js
Responses.js ⏯️ feat: Review and Stop Background Responses (#17613) 2026-11-10 21:04:04 -08:00
Responses.spec.js ⏯️ feat: Review and Stop Background Responses (#17613) 2026-11-10 21:04:04 -08:00
SlackDispatch.js 🌐 feat: Connect Organization Slack Workspaces to Agents (#17811) 2026-11-10 21:04:10 -08:00
SlackWorkspaceBindings.js 👥 fix: Let Members Connect Agents to Slack Workspaces (#17835) 2026-11-10 21:04:11 -08:00
SlackWorkspaces.js 🔌 feat: Add Tenant-Owned Slack Installation Storage and OAuth (#17810) 2026-11-10 21:04:09 -08:00
systemGrant.spec.js fix: Guard Mongo Cleanup In Api Services Tests (#17990) 2026-11-11 11:10:39 +01:00
ToolService.js 🧵 feat: Run Background Shell Commands Without Holding Their Worktree (#18247) 2026-11-17 09:36:27 -05:00
twoFactorService.js 🗝️ fix: Strengthen Two-Factor Recovery Credentials (#16742) 2026-10-04 12:16:37 -04:00
twoFactorService.spec.js 🗃️ refactor: Remove Dead Data Schemas Methods and Data Provider Exports (#17113) 2026-10-15 12:23:29 +02:00