Repository navigation
feat(extensions): add MCP servers by form or pasted config, with sealed tokens and per-tool switches - #468
Merged
Conversation
…ed tokens and per-tool switches Admins add an MCP server on Extensions with a short form (an address and headers, or a command with args and env) or by pasting a config from Claude or VS Code; Test lists its tools before saving. Header and env values that carry credentials are sealed with the server key, bound to the extension and where they go, and shown as "••••"; an upgrade step seals the ones saved before. Each tool gets a switch and "asks first", kept in the server's spec as off and ask. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HXPWXcSCQb9hWPr7xkZu7B
7 of 9 tasks
The last check asked for 2026-10-17's note after the call without a date had made today's note, so on that day it found the note the deleted root had left behind. It now asks for a day no earlier call makes. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HXPWXcSCQb9hWPr7xkZu7B
Owner
Author
|
Generated by Claude Code |
# Conflicts: # CHANGELOG.md # docs/database.md # fastapi_backend/app/domain/migrations.py # fastapi_backend/tests/domain/test_migrations.py # nextjs-frontend/app/openapi-client/index.ts # nextjs-frontend/app/openapi-client/sdk.gen.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Adeel · project thread
Description
Before: an admin added an MCP server only by writing YAML on
/extensions. Its token sat in plain text in the manifest, where anyone who could see the extension could read it, and every tool the server listed was on, asking first unless the server marked it read-only.After: Extensions → Add MCP server (admins) has a short form. It takes a name and either an address with headers, or a command with arguments and environment. Paste a config reads Claude's
.mcp.json/mcpServers, VS Code'smcp.json(servers) or a single server, one or many at a time. It guesses names from the package or address, points out${VAR}values to fill in, and leaves out SSE servers with a note. Test lists the server's tools before anything is saved, and Enter adds it. Tokens and keys in headers and env are sealed when saved and never shown again: the page, the API and the manifest show••••. Saving••••keeps the saved value, unless the server now goes to another host or another command or package. Each server's page lists its tools with a switch and Asks first, and conversations use the change at once.How: a new
domain/mcp_servers.pydoes three jobs. It reads pasted configs (marketplace's.mcp.jsonreader now uses the same code). It seals credential-named values with the server key (settings.seal, as notification targets and sources are, since an MCP server belongs to the whole install), bound toextension:<id>.mcp:<server>.<header|env>:<name>@<origin, or a hash of command+args>. It opens them only inrun_tooljust before the server is reached.extensions.create/save_versionopen, then check, then seal._shownandto_manifestmask. The spec gainsoffandask, whichmcp_toolshonours, and they survive tools being listed again. New endpoints:POST /extensions/mcp/read,POST /extensions/mcp/test,PATCH /extensions/{id}/tools. The upgrade stepmcp-sealed-secretsseals values already saved in plain text, in every version, and is safe to run twice.Motivation and Context
Chat gaps plan, module C6 ("Tool and MCP server settings, and a browser"), first of three PRs. Next: the services action for the
mcp,browserandsandboxprofiles plus a Playwright MCP preset, then a "Tools and MCP servers" settings body and themcp_servers/add_mcp_serverMCP tools.Screenshots (if appropriate):
Steps to reproduce (if appropriate):
{"mcpServers": {"tracker": {"type": "http", "url": "https://…/mcp", "headers": {"Authorization": "Bearer ${TOKEN}"}}}}.Authorization: ••••, and each tool has a switch and "Asks first".Types of changes
!in the title)Checklist:
make hookschecks it on commit).docs/accordingly.## UnreleasedinCHANGELOG.md.Done questions (AGENTS.md)
save_extension, asks first);••••in its manifests keeps the saved value. The MCP toolsmcp_servers/add_mcp_servercome in the third PR..envedit or manual step.mcp.list,mcp.call).mcp-sealed-secretsstep, safe twice (test_every_step_is_safe_to_repeatcovers an old-shape MCP server); documented indocs/database.md› Upgrades.make openapi).Local checks:
ruff check,ruff format --checkandmypyare clean.pytestpassed ontests/api/test_mcp_servers.py,test_extensions.py,test_marketplaces.py,test_prompt_injection.py,test_approvals.py,test_mcp.py,test_automation_tools.pyandtests/domain/test_migrations.py. On the frontend,tsc --noEmitandeslintare clean andjestpassed on the mcp-server, extensions and marketplace UI tests. OpenAPI regeneration made no further changes,mkdocs build --strictpassed, andci/validate_threat_model.pypassed.Generated by Claude Code