vue-chat gets a "Connect Notion" button: the MCP client weighs 9 KB instead of 120 KB
vue-llm 1.9, a library for AI chats on Vue, adds a useMCP hook: the user clicks "Connect," signs in to their Notion account, and the model searches their pages through the MCP standard. The official SDK would add 120 KB to the browser, so the author wrote a 9 KB client instead, compressed. Final review found a hole: someone else's login link would record the victim's tokens on the attacker's account. Now the login completes only in the window that started it.
AI-processed from Habr AI; edited by Hamidun News
Claude and ChatGPT only need a click on "Connect Notion" and a sign-in, and the assistant starts searching your pages. The author of vue-llm, a set of ready-made tools for AI chats built on the Vue framework, wanted the same: users should connect their own Notion, Linear, or Hugging Face accounts, while developers need only a couple of lines of code. That is how version 1.
9 introduced the useMCP and useMCPServers hooks. Connections use the MCP standard. To avoid pulling the heavy official SDK (the protocol authors' ready-made code, about 120 KB compressed) into the browser, the team wrote the client from scratch.
It adds only about 9 KB. Along the way, they also found a serious vulnerability in the OAuth sign-in. The story is useful beyond Vue developers: it covers the cost of dependency weight, the choice of where to store tokens, and an analysis of a real attack.
What it looks like for users and developers
MCP (Model Context Protocol) is the standard through which a model gets tools: search, files, tasks, databases. Notion, Linear, and many other services already have their own MCP servers. In vue-llm, you list them in a catalog and pass the tools of all connected servers to useChat. The user clicks "Connect," signs in to their Notion in a pop-up, and grants access. The window closes, the server gets the ready status, and the model gets 77 tools with the notion_ prefix. The connection is remembered, so the user does not need to sign in again after a page reload.
There are two modes, and the main question is where to store tokens. In browser mode, they live in localStorage: it is a quick start without a server, but the tokens are visible to any script on the page, which makes them vulnerable to XSS. In server mode, tokens are stored encrypted in your storage, and the toolsFor method gives the model only the tools of a specific user. An AI chat usually already has a backend, since the model key is not put in the browser, so the author recommends the server option for production.
Not every server works from the browser. For sign-in without a backend, the MCP server must allow requests from other sites (CORS) and support on-the-fly app registration. Notion and Linear support all of this, while GitHub, Vercel, Stripe, and Asana (as of November 2026) lack something. Such servers are immediately marked in the interface as "works only through the server," rather than opening a sign-in window that would then fail.
Why they didn't use the official SDK
The official @modelcontextprotocol/sdk weighs about 120 KB gzipped in the browser (the size after compression) and pulls in zod, ajv, and another fifteen-odd packages. For a library whose runtime has no dependencies besides Vue, that is too much. The browser needs a small part of the protocol: connect, get the tool list, call a tool, and, on a 401 response, complete the OAuth 2.1 sign-in by finding the authorization server, registering the app, going through PKCE, and refreshing the token. The team wrote that part themselves, and useMCP together with useMCPServers add about 9 KB gzipped to the bundle.
The official SDK remains in the project as a reference for tests: the client is run against its real server in three configurations: with session and SSE, with session and JSON, and without a session. Before writing any code, the author manually signed in to Notion and Linear from the browser. By his estimate, this saved a week: for example, it turned out that Linear does not give the browser a session ID but still works without one. A client written "by the spec" would have gotten an extra workaround mode.
The hole that task-by-task checks missed
The feature was built according to a plan, and after each task a separate reviewer checked the code. The reviewer caught issuer substitution in the OAuth metadata, a javascript: scheme in the authorization address, token deletion on a temporary provider error, and a chat freezing because of one silent server. But only the final review of the entire branch found the main problem.
In server mode, the backend determined whose sign-in it was by a one-time state written when the link was created. The attack: a malicious actor, a regular user of the application, requests a Notion sign-in link and sends it to a victim. The victim grants access (or Notion lets them through without a question if access was already granted). The backend receives the code with the attacker's state and saves the victim's tokens under the attacker's account. The attacker then searches the victim's pages in their own chat. PKCE does not help, because its secret is held by the backend itself.
The fix: the /callback page no longer completes anything. It only passes the provider's response to the window that opened the sign-in. That window sends it to POST /servers/:id/complete with its normal session, and the backend exchanges the code only if the same user started the sign-in. A forwarded link has no such window, so there is nothing to complete. Tests cover a forwarded link, a foreign session, a foreign server, and a replayed state.
Tools cost money too
Notion provides 77 tools and Linear 70. Connect both, and the request already holds 147 descriptions, while OpenAI accepts no more than 128 and returns an error. Even under the limit, the descriptions consume hundreds of tokens in every request. The solution is the include field on a server, which keeps only the needed tools, such as search and page reading.
The limitations are candid: in the browser with real sign-in, only Notion and Linear were tested; through the server, Notion and DeepWiki were checked manually. GitHub will require its own OAuth app, and the author has not yet tested it through the server. The main lesson for anyone connecting user accounts to agents: check not only individual pieces but the entire sign-in chain, because attacks live at the seams.
- Dec 1, 2026India Leads $27M Round for Soket as Startup Releases 26.3B-Parameter Eka-1 Model
- Dec 1, 2026Every $1 of Claude Pro Subscription Yields Up to $99 in API Tokens, ChatGPT Plus Only $16
- Dec 1, 2026A Developer Built a Fork of RSS Guard with an AI Agent: Prompts Fell Short, Specs Helped
- Dec 1, 20269 of 10 AI agents raised their own spending limits by reading the owner's email code
Key Questions Answered
What it looks like for users and developers?
MCP (Model Context Protocol) is the standard through which a model gets tools: search, files, tasks, databases. Notion, Linear, and many other services already have their own MCP servers. In vue-llm, you list them in a catalog and pass the tools of all connected servers to useChat. The user clicks "Connect," signs in to their Notion in a pop-up, and grants access. The window closes, the server gets the ready status, and the model gets 77 tools with the notion_ prefix.
Why they didn't use the official SDK?
The official @modelcontextprotocol/sdk weighs about 120 KB gzipped in the browser (the size after compression) and pulls in zod, ajv, and another fifteen-odd packages. For a library whose runtime has no dependencies besides Vue, that is too much. The browser needs a small part of the protocol: connect, get the tool list, call a tool, and, on a 401 response, complete the OAuth 2.1 sign-in by finding the authorization server, registering the app, going through PKCE, and refreshing the token.
What are the key details on The hole that task-by-task checks missed?
The feature was built according to a plan, and after each task a separate reviewer checked the code. The reviewer caught issuer substitution in the OAuth metadata, a javascript: scheme in the authorization address, token deletion on a temporary provider error, and a chat freezing because of one silent server. But only the final review of the entire branch found the main problem. In server mode, the backend determined whose sign-in it was by a one-time state written when the link was created.
Free 2-Day Vibecoding & AI Agents Intensive
Day 1: the autonomous Hermes + DeepSeek AI agent — vibecoding and development on par with Claude Code / Codex / Gemini. Led by Jemal Hamidun, Head of AI at Alpina Digital and academic supervisor at MIPT. Right after you register with our bot Nika: the recording + 11 materials from the previous intensive.
Daily 60-sec AI Voice Brief + Weekly Production AI Agent Playbook
Listen to a 60-second AI news brief every morning and get a weekly hands-on playbook for shipping AI agents to production — tools, MCP servers and patterns that work. Curated by Jemal Hamidun, Head of AI at Alpina Digital.
