Repository navigation
Closed
Labels
Description
Problem
The admin assistant can call only the external service tools in lib/chatbot/tools/ (Plex, Tautulli, Overseerr, Sonarr, Radarr, media marking). It cannot query this app's own data, for example users, invites, subscriptions, Rewind status, queues, LLM usage or settings. It also has no source of operator knowledge, so it cannot diagnose common problems well. To add a capability, a developer must write a tool and an executor in code.
Goal
Make it easy to plug MCP servers and APIs into the assistant, so that it can look up information and debug common problems.
Scope
- Add read-only tools for the app's admin data. Reuse the
lib/data/*loaders so that each tool keeps itsassertAdmin()check. - Add an admin setting to register MCP servers (URL, transport, auth header). Store secrets in
ENCRYPTED_FIELDS. - Expose each MCP server's tools to the assistant. Let the admin turn each tool on or off.
- Add a knowledge base source. The first target is the
mchestr/knowledgebaserepo. Also consider a memini MCP server. - Add tools for common debug tasks: service health checks, failed queue jobs, recent errors, a user's Plex access and subscription state.
- Review the current tools and the system prompt (
lib/chatbot/prompts/). Confirm that each integration works and that the prompt lists all tools.
Notes
- The chat assistant still uses
callChatLLM(lib/llm/chat.ts, OpenAI only). Moving it onto thelib/llm/registry.tsmodel registry and the Vercel AI SDK makes MCP tool support simpler. - WARNING: An MCP server or an API can return text that contains instructions. Treat all tool output as data. Keep write tools behind a confirmation step, and audit-log each call with
@/lib/security/audit-log. - Keep Discord out of scope until the admin path works.
DISCORD_SAFE_TOOLSmust not get admin tools.
Acceptance
- The assistant answers "which invites expire this week?" and "why did user X's Rewind fail?" from app data.
- An admin adds an MCP server in settings, and the assistant uses its tools without a code change.
- The assistant cites the knowledge base when it answers an operator question.
Activity
feat(assistant): MCP servers and a knowledge base source (#389)
fix(assistant): address review of the app data, MCP and knowledge too…
feat(assistant): add read-only app data and debug tools (#389)
feat(assistant): MCP servers and a knowledge base source (#389)
fix(assistant): address review of the app data, MCP and knowledge too…
fix(assistant): read User.exemptNote after the rename on main (#389)
feat(assistant): add read-only app data and debug tools (#389)
feat(assistant): MCP servers and a knowledge base source (#389)
fix(assistant): address review of the app data, MCP and knowledge too…
fix(assistant): read User.exemptNote after the rename on main (#389)
fix(assistant): gate the new tools behind an admin-only permission af…
feat(assistant): add read-only app data and debug tools (#389)
feat(assistant): MCP servers and a knowledge base source (#389)
fix(assistant): address review of the app data, MCP and knowledge too…
fix(assistant): read User.exemptNote after the rename on main (#389)
fix(assistant): gate the new tools behind an admin-only permission af…
chore(assistant): order the assistant sources migration after main's …
feat(assistant): add read-only app data and debug tools (#389)
feat(assistant): MCP servers and a knowledge base source (#389)
fix(assistant): address review of the app data, MCP and knowledge too…
fix(assistant): read User.exemptNote after the rename on main (#389)
fix(assistant): gate the new tools behind an admin-only permission af…
chore(assistant): order the assistant sources migration after main's …
Merge pull request #412 from mchestr/claude/youthful-brahmagupta-mys4ws