Skip to content

Add a File Search plugin endpoint with folder setup during authorization - #1486

Merged
helpcodeai merged 7 commits into
mainfrom
feat/file-search-chatgpt-plugin
Nov 3, 2026
Merged

helpcodeai merged 7 commits into
mainfrom
feat/file-search-chatgpt-plugin

Conversation

@helpcodeai

Copy link
Copy Markdown
Contributor

Summary

A second plugin for OpenAI's plugin directory, for File Search only. The database plugin on /mcp/chatgpt-app is in review and stays untouched. The earlier submissions were rejected as a relay of third-party integrations; File Search has nothing third-party behind it, and the folder setup runs while ChatGPT is being connected, so the reviewer sees a complete workflow.

Changes

  • POST /mcp/file-search: 8 fixed tools (list_file_sources, search_documents, find_files, list_folder, read_document, find_exact_text, view_document_page, get_file_link), each mapped to one FILE_SEARCH built-in by its endpoint method and run through deps.execute (scope, role, folder rules, audit). Only File Search sources; no catalog connectors, databases, File Share or share_file. All hints explicit; only get_file_link is not read-only (it stores a members-only link). Searches run over every folder when no source is given.
  • OAuth: ResourceIndicatorMiddleware sets a signed mcp_app cookie when resource is /mcp/file-search (the server-id cookie is unchanged). After Approve, an ADMIN of a workspace without an active File Search folder gets "Connect a folder for " with the protocols and NAS presets; otherwise the flow goes straight back. The first-connector page is unchanged for every other client.
  • POST /auth/file-search/session: dashboard session on the granted workspace plus the wizard path for a fixed option. Needs the page's CSRF token and cookie, the dashboard header, the pending login cookie, an authorization that asked for /mcp/file-search, the recent sign-in of the same user, and ADMIN. GET /auth/file-search/continue finishes the paused authorization, or says how to go on when it expired.
  • Frontend: public hand-off page /setup/file-search; the wizard's return=authorize mode (banner with Skip, granted servers preselected, back to the authorization after Activate). Without the parameter the wizard is unchanged. New fileSearch.authorize strings in EN/DE/IT.
  • Product event file_search_authorize_offered (server-only); wizard entry point authorize.
  • Plugin package deploy/openai-plugins/file-search/ (manifest with listing, keywords, 5+3 test cases on the demo bucket, onboarding skill, icon). No "MCP" in the plugin name.
  • Docs: docs/integrations/chatgpt.md section; llms-full.txt regenerated.

Cloud and self-hosted behave the same; on a self-hosted Community edition the wizard shows its File Search trial/licence state. The network-folder option is offered on self-hosted only. No schema change.

Type

  • Bug fix
  • New feature
  • Documentation
  • Refactoring
  • Performance improvement
  • Other (describe below)

Testing

  • Added/updated unit tests
  • Tested manually (describe steps below)
  • No tests needed (explain why)

Commands and results:

  • packages/backend: npx prisma generate, npx tsc --noEmit -p tsconfig.json passed; npx eslint on the changed files: no findings; npx jest --maxWorkers=4: 996 suites passed (6 skipped), 30,473 tests passed.
  • New specs: file-search-app-toolset.spec.ts (11), file-search-app.controller.spec.ts (7), login.controller.file-search.spec.ts (16), additions to resource-indicator.middleware.spec.ts. Existing login, server picker and social login specs unchanged and passing.
  • packages/frontend: npx tsc --noEmit -p tsconfig.json passed; npx eslint on the changed files: no errors, 3 warnings that exist on main.
  • node scripts/generate-llms-txt.mjs --check: fresh.

Manual, local backend built from this branch (port 4400, own database) and next dev on 3400:

  • Scripted OAuth run, 27 of 27 checks: 401 with resource_metadata for /mcp/file-search; DCR client; /authorize with resource=…/mcp/file-search sets mcp_app; Approve shows the setup page with every protocol; hand-off refused without header, with a wrong CSRF token, with an unknown option; accepted for Nextcloud with the granted server; the session works on /api/file-search/capabilities; continue → /callback → code → token; tools/list returns the 8 tools; list_file_sources without a folder returns the wizard link; /mcp/chatgpt-app still lists its 8 tools; the database plugin's authorization goes straight to /callback.
  • In Chrome: sign-in and "Allow access" (existing session) both show the setup page; Synology opens the wizard signed in, with the banner and return=authorize&servers=… kept in the URL.

Checklist

  • My code follows the existing code style
  • I have tested my changes locally
  • I have updated documentation (if applicable)
  • All existing tests pass (npm test)
  • This PR has a descriptive title

Related Issues

Fixes #1485

…ion (#1485)

Adds /mcp/file-search, a fixed set of single-operation tools over the workspace's File Search folders for OpenAI's plugin directory, and a guided folder setup after Approve for admins whose workspace has no folder yet. Includes the plugin package in deploy/openai-plugins/file-search.
The portal's metadata check refuses "SFTP & NAS File Search" as too generic and "MCP" in a plugin name; test case 3 now matches the indexed folders (archive folders are excluded by default).
…ist (#1485)

In the demo data the 2026 PDF and Excel price lists of Brandt Türen differ for BR-12103; the test case and the first default prompt now name the PDF, so the expected answer is unambiguous.
@helpcodeai
helpcodeai enabled auto-merge (squash) November 3, 2026 15:16
ChatGPT does not show image content from a tool result inline, so the view_document_page case would not produce the expected result in review; get_file_link was checked end to end on ChatGPT web.
Leads with the protocol words people search for; the brand at the end satisfies the portal's check against generic names.
@helpcodeai
helpcodeai merged commit 2da99ae into main Nov 3, 2026
14 checks passed
@helpcodeai
helpcodeai deleted the feat/file-search-chatgpt-plugin branch November 3, 2026 16:12
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenAI directory plugin for File Search with folder setup during authorization

1 participant