LibreChat/api/server/controllers
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: Support Native PostgreSQL Tool Favorites (#18032) 2026-11-11 12:07:07 -05:00
agents 🗝️ feat: Limit an API Key's Runs to the MCP Tools Its Owner Granted It (#18280) 2026-11-18 13:28:39 -05:00
assistants 🛝 perf: Render Chats Independently of Catalog Discovery (#17692) 2026-11-09 11:11:22 -05:00
auth ⚡ fix: Parallelize Setup Cancel Lookups and Keep Attachment Drafts on Reload (#17963) 2026-11-09 21:57:01 +01:00
AuthController.js 🛂 fix: Only Hand Out OpenID Access Tokens the Bearer Verifier Accepts (#17904) 2026-11-08 23:40:21 +01:00
AuthController.spec.js 🛂 fix: Only Hand Out OpenID Access Tokens the Bearer Verifier Accepts (#17904) 2026-11-08 23:40:21 +01:00
avatar.contentFilter.spec.js 🛍️ fix: Discover Managed Agents in Marketplace Search (#16324) 2026-09-24 22:48:56 -04:00
Balance.js 🗓️ feat: Align Balance Resets to Fixed Calendar Boundaries (#18144) 2026-11-17 09:37:34 -05:00
Balance.spec.js 📏 fix: Measure Usage Percent Against the Allowance Each Period Granted (#17850) 2026-11-09 08:27:13 -05:00
EndpointController.js ✨ refactor: Integrate Capabilities into Agent File Uploads and Tool Handling (#5048) 2024-12-19 13:04:48 -05:00
FavoritesController.js 📌 feat: Add Pin Support for Model Specs (#11219) 2026-04-09 18:37:25 -04:00
FavoritesController.spec.js 📌 feat: Add Pin Support for Model Specs (#11219) 2026-04-09 18:37:25 -04:00
mcp.js 🔐 fix: Fence ACL Viewers and Surface Revocation Failures When Removing Shared MCP Servers (#17506) 2026-10-28 00:37:07 +01:00
mcpApps.js 🐛 fix: Restore MCP App Rendering and Actions (#16382) 2026-10-16 13:27:29 -07:00
mcpApps.test.js 🐛 fix: Restore MCP App Rendering and Actions (#16382) 2026-10-16 13:27:29 -07:00
ModelController.js 🛝 perf: Render Chats Independently of Catalog Discovery (#17692) 2026-11-09 11:11:22 -05:00
ModelController.spec.js 🧭 perf: Validate Agent Models Against Their Own Endpoint Catalog (#17972) 2026-11-10 17:33:29 +01:00
PermissionsController.js 🥸 fix: Resolve Directory Principals Through Trusted Integration Data (#17825) 2026-11-10 09:22:08 -05:00
PluginController.js 🔭 feat: Admin Config Read APIs (Resolved and Effective Config, Scope Catalog, Env Status) (#17383) 2026-10-24 09:23:22 +02:00
PluginController.spec.js 🪦 refactor: Remove Dead Legacy API Modules and Root Tooling (#17114) 2026-10-15 12:25:24 +02:00
ReasoningCapabilitiesController.js 🎚️ feat: Filter OpenRouter Reasoning Efforts by the Selected Model (#16808) 2026-10-08 18:04:13 +02:00
SkillStatesController.js 🔌 feat: Integrate Durable Skill Lifecycle Across Writers and Routes (#17043) 2026-10-16 09:05:05 -07:00
TokenConfigController.js 💧 feat: Add Gemini Hydrogen Support (#18159) 2026-11-16 10:26:55 -05:00
tools.js 🪦 chore: Retire the DALL-E 3 Tool (#17205) 2026-10-17 18:24:22 +02:00
TwoFactorController.js 🔐 fix: Retire Credentials by Their Committing Write and on Opt-In 2FA (#17504) 2026-11-05 22:53:11 +01:00
UserController.js 🚜 feat: Support Native PostgreSQL Tool Favorites (#18032) 2026-11-11 12:07:07 -05:00
UserController.spec.js 🚜 feat: Support Native PostgreSQL Tool Favorites (#18032) 2026-11-11 12:07:07 -05:00