Skip to content

feat(assistant): MCP servers in Settings, and MCP tools to list and add them - #506

Merged
adeelahmad merged 9 commits into
mainfrom
claude/project-thread-r960xc-c6-settings
Oct 18, 2026
Merged

adeelahmad merged 9 commits into
mainfrom
claude/project-thread-r960xc-c6-settings

Conversation

@adeelahmad

Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: Settings › AI assistant had the assistant's own tool switches but said nothing about MCP servers, and an agent couldn't see or add MCP servers at all.

After: Settings › AI assistant has an MCP servers block under the tool switches. It lists each server the assistant calls with how many of its tools are on ("10 of 12 tools", or switched off) and a link to its page, with Add MCP server and the switches that run the MCP runner and the browser on this machine. Agents get two MCP tools: mcp_servers lists the servers (header and env names, never their values) and the ready-made ones, and add_mcp_server adds a ready-made one (preset, with values for its token) or their own (server).

How: add_mcp_server builds the same manifest the web form saves and goes through extensions.create, so the checks are the form's: the server must answer, tokens are sealed, and names can't clash. mcp_servers.filled puts typed-in values in place of ${NAME}s. Adding needs an admin's API key with the write scope; an app given access (OAuth) can't add one, as with the REST route. The browser preset waits until its container answers. The Settings block reuses the extensions list and ServiceSwitch.

This stacks on #491 (the optional containers and the browser). Until that merges, this diff includes it; the change here is the last commit, ae1f69f.

Motivation and Context

Part of the chat-app gaps: settings for chat tools and MCP servers.

Local CI (ci/local-ci.sh on ae1f69f): FastAPI pass (1410 passed), Next.js pass, pre-commit pass, PR title pass.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change; ! in the title)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (make hooks checks it on commit).
  • I added or updated tests: test_agents_list_and_add_servers in test_mcp_servers.py, the writing-tools list in test_mcp.py, and the Settings block in mcp-server-ui.test.tsx.
  • My change requires documentation updates, and I have updated docs/ accordingly: assistant.md (Adding an MCP server, and a line telling the browser apart from the assistant in your browser) and mcp.md.
  • Users need more than the title to understand it, so I wrote it under ## Unreleased in CHANGELOG.md.

Done questions (AGENTS.md)

  • Goal: delivers what the user wanted, merged on green CI. Not merged yet.
  • Agents: the MCP tools mcp_servers and add_mcp_server; the REST routes were already there.
  • Zero setup: nothing new to install or configure.
  • Fewest clicks and keystrokes: each server is one click from Settings, and the switches are right there.
  • Configurable: no new settings.
  • Light: nothing new runs.
  • Private and secure: token values are never listed; adding needs an admin's own API key with the write scope; the threat model's MCP servers entry point names the two tools (companions updated, ci/validate_threat_model.py passes).
  • Cost: no model calls; listing a new server's tools goes through the activity ledger (mcp.list) as before.
  • User decides: only an admin adds a server, and its tools ask first as before; defaults unchanged.
  • Upgrades: n/a, no stored-data change.
  • Honest: docs describe what is built.
  • Tests, docs and generated files updated (no API change, so the client is unchanged; make openapi gives no diff).
  • Open standards; dependencies keep Lens MIT: no new dependencies.
  • Result reported with evidence; "refine later" items written down: extension tools and plugins in the same Settings list; Settings Find matching "MCP".

Generated by Claude Code

…p, with ready-made MCP servers

The host upgrade agent's services action now takes a profile (mcp,
browser or monitoring, a fixed list) and turn=on|off, so the web app,
the API (GET /admin/services, PUT /admin/services/{profile}) and the MCP
tools services and set_service can start or stop any of Lens's optional
containers; the old monitoring=on|off request still works.

The new browser profile runs Playwright MCP in a hardened container on
an internal network whose only way out is browser-proxy, netguard run
on its own (public addresses, ports 80 and 443, a byte budget per
connection). Add MCP server gains Ready-made: Browser (one click once
its container answers, browser_run_code_unsafe off) and GitHub (a field
for the token). ${NAME} values get their own fields, and a spec with
keep: true reuses one MCP session between calls.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HXPWXcSCQb9hWPr7xkZu7B
…-r960xc-c6-browser

# Conflicts:
#	threat-model.json
#	threat-model.md
#	threat-model.yaml
…machine

The preview waits 600 ms after the last keystroke, and findByText gives
up after 1 s, so the test failed when the machine was busy.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HXPWXcSCQb9hWPr7xkZu7B
…dd them

Settings › AI assistant lists the MCP servers the assistant calls, each
with how many of its tools are on and a link to its page, next to Add
MCP server and the switches that run the MCP runner and the browser.

Agents get the MCP tools mcp_servers (the servers, with header and env
names but never their values, and the ready-made ones) and
add_mcp_server (a preset with values for its token, or their own
server), checked as the form checks a server. Adding one needs an
admin's API key with the write scope; an app given access can't.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HXPWXcSCQb9hWPr7xkZu7B
@adeelahmad adeelahmad self-assigned this Oct 17, 2026
…-r960xc-c6-settings

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HXPWXcSCQb9hWPr7xkZu7B
…-r960xc-c6-settings

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HXPWXcSCQb9hWPr7xkZu7B
…-r960xc-c6-settings

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HXPWXcSCQb9hWPr7xkZu7B
@adeelahmad
adeelahmad merged commit b2f00e5 into main Oct 18, 2026
12 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-r960xc-c6-settings branch October 18, 2026 06:04
adeelahmad pushed a commit that referenced this pull request Oct 18, 2026
…ay and clipper sign-in as built

Since the last README refresh, #474, #484, #510, #511, #497, #495, #406, #516, #517,
#491, #400 and #506 merged. The README's built list now says the assistant answers
questions about Lens itself; a conversation exports as Markdown, PDF or JSON and its
answers, questions and code copy; a Tools chip picks an answer's tools, limit and
namespaces; sandbox runs open under the answer with downloads, and Settings starts the
gateway; deep research plans, runs and returns a cited report; ready-made MCP servers,
the MCP servers page and the optional containers start from the web app; and the web
clipper signs in or takes an API token. Each has its checks in docs/requirements.md.
In progress lists only open PRs; the Nebula mesh (#546, merged, partly built) moves to
Planned with what's next; the Planned proof item keeps only the Raspberry Pi timing;
the docs index links requirements and checks, and published feeds.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HDx7PPUauyjMn1LZs8JAsS
adeelahmad added a commit that referenced this pull request Oct 18, 2026
…ay and clipper sign-in as built (#536)

Since the last README refresh, #474, #484, #510, #511, #497, #495, #406, #516, #517,
#491, #400 and #506 merged. The README's built list now says the assistant answers
questions about Lens itself; a conversation exports as Markdown, PDF or JSON and its
answers, questions and code copy; a Tools chip picks an answer's tools, limit and
namespaces; sandbox runs open under the answer with downloads, and Settings starts the
gateway; deep research plans, runs and returns a cited report; ready-made MCP servers,
the MCP servers page and the optional containers start from the web app; and the web
clipper signs in or takes an API token. Each has its checks in docs/requirements.md.
In progress lists only open PRs; the Nebula mesh (#546, merged, partly built) moves to
Planned with what's next; the Planned proof item keeps only the Raspberry Pi timing;
the docs index links requirements and checks, and published feeds.


Claude-Session: https://claude.ai/code/session_01HDx7PPUauyjMn1LZs8JAsS

Co-authored-by: Adeel Ahmad <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants