Connect
Claude Code
Let Claude Code see the tabs you have open.
What it is
Lean runs a small MCP server on your Mac. Claude Code connects to it and can then look at your tabs, so you can say “look at the error in the tab I have open” and it reads the page.
Connect
Lean must be running. In the project where you use Claude Code:
claude mcp add --transport http lean http://127.0.0.1:8719/mcp \
--header "Authorization: Bearer $(cat ~/.config/lean/mcp-token)"
Add --scope user to have it in every project.
What Claude Code can do
| Tool | Does |
|---|---|
list_tabs | the open tabs with title, address, project, Jira status, and whether each is awake |
read_page | the text of a tab |
screenshot | a picture of a tab |
open_url | opens an address; http and https only |
select_tab | brings a tab to the front |
close_tab | closes a tab |
What it cannot do
- Click, type, or run a script in a page. In a tab where you are logged in, it can read; it cannot act as you.
- Reach your passwords. No tool reads the vault or triggers a fill.
Keep in mind that a page's text is whatever the page says. A hostile page can contain text that reads like an instruction to an assistant.
How the server is guarded
- It listens on
127.0.0.1only and is not reachable from the network. - Every request needs the token from
~/.config/lean/mcp-token. The file is readable by you alone. - Requests that come from a web page, or under a foreign host name, are refused. A page you visit cannot talk to the server.
Port, and turning it off
mcpPort in the config sets the port; 0 turns the server off. It is read
at start, so restart Lean after changing it.