Sometimes a button updates a counter, but the value shown elsewhere remains unchanged. Rather than telling an AI coding agent to guess from source files, you can connect it to the running Vue application and inspect the actual component and Pinia state.
Outcome: reproduce a stale-value bug, inspect the live state, correct the component and verify the result. Requirements: a development app built with supported Vite and Vue DevTools versions, a browser, and an MCP-capable coding client. Allow roughly 35 minutes.
1. Understand what the tool can see
The Vue DevTools agent integration uses the Vite development plugin. At the time this guide was checked, the documentation specifies Vite 8.3+ and @vitejs/devtools 0.7.6+ and a connection through @vue/devtools-agent. This is not the Chromium extension's feature. An agent can inspect live components, stores and routes; treat its access to application state as sensitive. Use sanitized demo data rather than production accounts.
2. Prepare the demonstration
Download vue-pinia-mcp-demo.zip. This intentionally broken demo contains BuggyCounter.vue, a Pinia counter store, an entry point and tests. Start from the README, install the locked dependencies, run the checks and open the Vite page in your browser. The demo illustrates a bug; it does not establish that MCP works until an actual client is connected.
The bug is a detached snapshot, conceptually:
const store = useCounterStore()
const frozenCount = store.count // takes a number now; not a reactive reference
When the store changes, frozenCount stays behind. Prefer using the store directly in the template, or use storeToRefs(store) for reactive destructuring:
import { storeToRefs } from 'pinia'
const store = useCounterStore()
const { count } = storeToRefs(store)
3. Connect your coding agent
With the Vite server running and the page open, approve the DevTools connection when prompted. Configure the MCP-capable client according to its documentation. The official default connector command is:
{
"mcpServers": {
"vue-devtools": {
"command": "npx",
"args": ["-y", "@vue/devtools-agent", "connect"]
}
}
}
Depending on the client, MCP configuration may be stored globally or in project settings. Do not replace other configured servers. A production build, browser extension or closed page is not a substitute for the development connection. If the embedded dock says Unauthorized, open the local /__devtools/ page, enter the one-time code shown by your Vite server, then return to the app and rediscover the tools. Never publish that code or the browser token.
Ask: “Find the counter component in the running app, inspect the Pinia store and displayed local state, and explain why the displayed counter does not change when I click Increment. Show the observed values before proposing a code change.”
4. Fix and verify
Click Increment twice. If the store reports 2 while the frozen display still shows 0, you have evidence of the stale snapshot. Apply storeToRefs or render store.count, retest the visible value and run the demo's checks. Record the observed values, client name, package versions and test output so the result can be reproduced.
5. Common failure modes
- Project not found: verify Vite is running and the correct project port is selected.
- Page tools missing: open the app in a browser, accept the connection and rediscover tools.
- No editable fields: inspect the read-only status rather than trying to force a mutation.
- Stale value handle: reread the state and request a fresh handle.
Official source: Vue DevTools — Agents and Pinia — Destructuring from a Store.
Downloads and next steps
Download the Vue + Pinia demo. It includes the intentional bug, tests and a lockfile. Use Node 22.12+ (or a supported newer release), run npm ci, then npm run test:state, npm run test:dom, npm run build and npm run dev. The dependency set uses Vue DevTools 9.0.0-rc.3 and the agent 9.0.0-rc.1: these are release candidates. The original ^9.0.0 constraint did not resolve from npm when checked. Keep the supplied lockfile to reproduce this example.
Verified on macOS on 12 November 2026 with Node 26.13.1, Chromium 156.0.8078.4 and MCP Inspector CLI. The live MCP component and Pinia reads reported store count 2 and frozenCount 0. With storeToRefs, both browser displays showed 2; the fixed check and build passed. The download keeps the original intentional bug. This verifies the named client and demo, not every client or operating system.
Building a feature for your web application?
The useful part of a technical approach is how it works for your users. I build interfaces, connect them to existing APIs and help product teams improve features, including loading, empty and error states.
Explore frontend development for your application
Related work and examples
Dashboard
A COVID data explorer grew into a personal dashboard and a collection of everyday web tools. A long-running React project where I learned to connect interfaces, interactive charts and real data.