LibreChat/packages/api/src/admin
Danny Avila 8c51a3f9f8
🙈 feat: Let Config Profiles Hide librechat.yaml MCP Servers and Remove Their Fields (#17327)
* 🙈 feat: Let Config Profiles Hide librechat.yaml MCP Servers and Remove Their Fields

Config profiles are the `__base__`, role, group and user documents written through `/api/admin/config`. A profile can tombstone `mcpServers.<name>`, and the merge then removes that server from the principal's resolved `mcpConfig`.

* 🛡️ fix: Apply MCP Hiding to Server Instructions, Failed Removals and the Startup Audit

- Server instructions bound for the model now leave out librechat.yaml servers hidden from the acting user, including one a model spec pins. `applyContextToAgent` passes the request user through `formatInstructionsForContext`, which drops the user's hidden set from the user-less catalog it reads.
- A config-tier candidate that removes a librechat.yaml value (a field, or a key of a record such as `headers`) and fails inspection now stands as a failed config-source entry instead of falling back to the librechat.yaml base that still carries the removed value. A failed change that removes nothing still falls back, and an entry with no transport (fields written over a hidden server) keeps the documented librechat.yaml fallback.
- The startup tombstone report reads every tenant's profiles in the system tenant scope, so it also runs from entry points without an outer system scope under strict tenant isolation, and names each profile's tenant.

* 🗂️ fix: Project the Startup MCP Tombstone Report Query and Run It Alongside Connections

* 🔑 fix: Keep Removed OAuth Headers Out of the MCP OAuth Callback

* 📝 docs: Note That Removed OAuth Headers Stay Out of MCP Sign-In

* 🔐 fix: Recheck the MCP OAuth Flow's Server Before Initiation Redirects

OAuth initiation redirected to a flow's stored authorization URL, or started
a new authorization from the flow's stored server URL, without resolving the
server again, so a principal whose profile hid the server after the flow was
created could still be sent to its authorization endpoint. The callback's
active-server check and its OAuth header fallback lived in the CJS route.

resolveMCPOAuthTarget (packages/api/src/mcp/oauth/target.ts) now owns both:
it resolves the server in the principal's current config with a strict read,
refuses a flow admitted for another server, a server the principal can no
longer use, or a redefined one, and selects the headers the flow sends (the
initiation snapshot, else the principal's config). Initiation calls it before
either redirect (404 or 400); the callback calls it before the exchange and
from the token-store fence.

* 📝 docs: Note That a Hidden MCP Server Ends OAuth Sign-Ins Already Started

* 🚩 feat: Publish the yamlMcpHide Admin Config Meta Flag

Profiles can hide librechat.yaml MCP servers and a hidden server is an
access boundary, so GET /api/admin/config/meta now reports
features.yamlMcpHide for the admin panel to gate its hide UI on. The
meta.spec probe checks the behaviour itself: the admin API stores an
mcpServers.<name> tombstone, the merged config drops the server, the
registry withholds it from principal lookups and checkout but not from
app-level lookups, process-backed servers stay, and an unreadable
principal config withholds every hideable server.

* 🧪 test: Align MCP Tombstone Specs With the Portable Config Store

The admin config handlers now write whole documents through
writeConfigDocument, so the end-to-end tombstone spec wires it in place
of the removed upsertConfig/patchConfigFields deps. A reset of a whole
MCP record now also prunes the parents it leaves empty.
2026-10-22 14:10:31 +02:00
..
audit.spec.ts 🛂 feat: Audit Resource Sharing Changes and Fail Closed on Reversible Audit Writes (#17053) 2026-10-15 00:30:16 +02:00
audit.ts 🛂 feat: Audit Resource Sharing Changes and Fail Closed on Reversible Audit Writes (#17053) 2026-10-15 00:30:16 +02:00
auditLog.spec.ts 🗂️ feat: Audit MCP, Code Worker, Langfuse, Skill Credential, Passkey and Audit Log Access (#17054) 2026-10-15 00:30:26 +02:00
auditLog.ts 🗂️ feat: Audit MCP, Code Worker, Langfuse, Skill Credential, Passkey and Audit Log Access (#17054) 2026-10-15 00:30:26 +02:00
binding.ts ⚛️ feat: Atomic Admin Config Changes Endpoint (set, unset, tombstone, entry upsert/remove/rename) (#17328) 2026-10-22 13:38:06 +02:00
cascade.spec.ts 📜 feat: Audit Admin Role, Group, Config and IdP Role Mutations (#17052) 2026-10-14 23:57:07 +02:00
cascade.ts 📜 feat: Audit Admin Role, Group, Config and IdP Role Mutations (#17052) 2026-10-14 23:57:07 +02:00
code.spec.ts 🗂️ feat: Audit MCP, Code Worker, Langfuse, Skill Credential, Passkey and Audit Log Access (#17054) 2026-10-15 00:30:26 +02:00
code.ts 🗂️ feat: Audit MCP, Code Worker, Langfuse, Skill Credential, Passkey and Audit Log Access (#17054) 2026-10-15 00:30:26 +02:00
config.changes.integration.spec.ts ⚛️ feat: Atomic Admin Config Changes Endpoint (set, unset, tombstone, entry upsert/remove/rename) (#17328) 2026-10-22 13:38:06 +02:00
config.dotted.integration.spec.ts 🗄️ refactor: Portable Admin Config Store with Revisions, Key Encoding and Coherent Writes (#17326) 2026-10-22 13:04:35 +02:00
config.handler.spec.ts ⚛️ feat: Atomic Admin Config Changes Endpoint (set, unset, tombstone, entry upsert/remove/rename) (#17328) 2026-10-22 13:38:06 +02:00
config.spec.ts
config.store.spec.ts 🗄️ refactor: Portable Admin Config Store with Revisions, Key Encoding and Coherent Writes (#17326) 2026-10-22 13:04:35 +02:00
config.ts ⚛️ feat: Atomic Admin Config Changes Endpoint (set, unset, tombstone, entry upsert/remove/rename) (#17328) 2026-10-22 13:38:06 +02:00
context.spec.ts 🗂️ feat: Audit MCP, Code Worker, Langfuse, Skill Credential, Passkey and Audit Log Access (#17054) 2026-10-15 00:30:26 +02:00
context.ts 🗂️ feat: Audit MCP, Code Worker, Langfuse, Skill Credential, Passkey and Audit Log Access (#17054) 2026-10-15 00:30:26 +02:00
grants.spec.ts 🛂 feat: Audit Resource Sharing Changes and Fail Closed on Reversible Audit Writes (#17053) 2026-10-15 00:30:16 +02:00
grants.ts 🛂 feat: Audit Resource Sharing Changes and Fail Closed on Reversible Audit Writes (#17053) 2026-10-15 00:30:16 +02:00
groups.spec.ts 🗂️ feat: Audit MCP, Code Worker, Langfuse, Skill Credential, Passkey and Audit Log Access (#17054) 2026-10-15 00:30:26 +02:00
groups.ts 🗄️ refactor: Portable Admin Config Store with Revisions, Key Encoding and Coherent Writes (#17326) 2026-10-22 13:04:35 +02:00
index.ts 🛂 feat: Audit Resource Sharing Changes and Fail Closed on Reversible Audit Writes (#17053) 2026-10-15 00:30:16 +02:00
langfuse.handler.spec.ts 🗄️ refactor: Portable Admin Config Store with Revisions, Key Encoding and Coherent Writes (#17326) 2026-10-22 13:04:35 +02:00
langfuse.ts 🗄️ refactor: Portable Admin Config Store with Revisions, Key Encoding and Coherent Writes (#17326) 2026-10-22 13:04:35 +02:00
lease.spec.ts 🛂 feat: Audit Resource Sharing Changes and Fail Closed on Reversible Audit Writes (#17053) 2026-10-15 00:30:16 +02:00
lease.ts 🛂 feat: Audit Resource Sharing Changes and Fail Closed on Reversible Audit Writes (#17053) 2026-10-15 00:30:16 +02:00
meta.spec.ts 🙈 feat: Let Config Profiles Hide librechat.yaml MCP Servers and Remove Their Fields (#17327) 2026-10-22 14:10:31 +02:00
meta.ts 🙈 feat: Let Config Profiles Hide librechat.yaml MCP Servers and Remove Their Fields (#17327) 2026-10-22 14:10:31 +02:00
pagination.ts
roles.spec.ts 📜 feat: Audit Admin Role, Group, Config and IdP Role Mutations (#17052) 2026-10-14 23:57:07 +02:00
roles.ts 🗄️ refactor: Portable Admin Config Store with Revisions, Key Encoding and Coherent Writes (#17326) 2026-10-22 13:04:35 +02:00
secrets.integration.spec.ts 🗄️ refactor: Portable Admin Config Store with Revisions, Key Encoding and Coherent Writes (#17326) 2026-10-22 13:04:35 +02:00
secrets.runtime.spec.ts 🔑 fix: Use Admin-Stored Web Search Credentials at Runtime (#17323) 2026-10-22 11:29:20 +02:00
secrets.spec.ts ⚛️ feat: Atomic Admin Config Changes Endpoint (set, unset, tombstone, entry upsert/remove/rename) (#17328) 2026-10-22 13:38:06 +02:00
secrets.ts ⚛️ feat: Atomic Admin Config Changes Endpoint (set, unset, tombstone, entry upsert/remove/rename) (#17328) 2026-10-22 13:38:06 +02:00
skills.spec.ts 🗂️ feat: Audit MCP, Code Worker, Langfuse, Skill Credential, Passkey and Audit Log Access (#17054) 2026-10-15 00:30:26 +02:00
skills.ts 🗂️ feat: Audit MCP, Code Worker, Langfuse, Skill Credential, Passkey and Audit Log Access (#17054) 2026-10-15 00:30:26 +02:00
users.spec.ts 🔎 perf: Index-Bound Word-Prefix Search for Users and Groups (#16719) 2026-10-16 22:41:37 +02:00
users.ts 🗄️ refactor: Portable Admin Config Store with Revisions, Key Encoding and Coherent Writes (#17326) 2026-10-22 13:04:35 +02:00