Registry / devops / nanostores-mcp

nanostores-mcp

JSON →
library0.1.2jsnpmunverified

Model Context Protocol server for Nanostores that enables AI assistants (e.g., Claude Desktop) to analyze, debug, and monitor Nanostores state management. Current stable version is 0.1.2 (beta). Release cadence is irregular; tool is actively developed. Key differentiators: zero-config setup, AST-based static analysis (dependency graphs, store inspection), runtime monitoring via @nanostores/logger integration, framework-agnostic support (React, Vue, Svelte, Angular, Solid, Preact, Lit), and built-in documentation search. Requires Node.js ^20.0.0 || >=22.0.0.

npm install nanostores-mcp
INSTALL
IMPORT
SIG · NANOSTORES-MCP
N
nanostores-mcp
devopsjavascriptv0.1.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

startMCP
import { startMCP } from 'nanostores-mcp'
import startMCP from 'nanostores-mcp'
Named export since v0.1.0; no default export.
createMCPServer
import { createMCPServer } from 'nanostores-mcp'
const { createMCPServer } = require('nanostores-mcp')
Package is ESM-only; CommonJS require is not supported.
analyzeProject
import { analyzeProject } from 'nanostores-mcp'
import { analyzeProject } from 'nanostores-mcp/analyze'
All exports are from the main entry point; no subpath exports.

Starts the Nano Stores MCP server programmatically with optional runtime monitoring. Shows default config and tool usage.

import { startMCP } from 'nanostores-mcp' // Start the MCP server with default settings // In most cases, you just run: npx nanostores-mcp // For programmatic usage: const server = await startMCP({ // Optional: specify project root (default: process.cwd()) projectRoot: process.argv[2] ?? process.cwd(), // Optional: enable runtime monitoring (requires @nanostores/logger integration) monitoring: { enabled: true, port: 3001 // WebSocket port for live events } }) console.log('Nano Stores MCP server started on stdio') // Then connect from an MCP client (e.g., Claude Desktop) // Use tools like "analyze_store_architecture" or "get_runtime_metrics"
Debug
Known issues
breakingRequires Node.js ^20.0.0 || >=22.0.0. Older Node versions (18.x, 19.x, 21.x) are not supported.
fix
Upgrade Node.js to v20 LTS or v22+.
affects: <0.1.0
gotchaRuntime monitoring requires @nanostores/logger to be integrated into your project; MCP server itself does not inject logging. Without logger setup, monitoring tools will return empty results.
fix
Install and configure @nanostores/logger in your application, e.g., import { logger } from '@nanostores/logger' and wrap your stores.
affects: >=0.1.0
gotchaStatic analysis for Svelte and Vue requires optional peer dependencies (svelte, @vue/compiler-sfc) to be installed. Without them, those file types are skipped during scanning.
fix
Install the relevant peer dependency: npm install svelte or @vue/compiler-sfc.
affects: >=0.1.0
deprecatedThe analyzeProject function signature changed between 0.1.0 and 0.1.2: the second parameter is now an options object instead of a string for project root.
fix
Update calls from analyzeProject(path) to analyzeProject(projectRoot, { ... }) or use single argument for default.
affects: 0.1.0 - 0.1.1
gotchaMCP server communicates over stdio by default. If your AI environment uses HTTP/SSE, you must enable the HTTP transport explicitly.
fix
Pass { transport: 'http', port: 8080 } to startMCP or use the CLI flags --http-port in npx.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'nanostores-mcp'
Package not installed, or using CommonJS require which is unsupported.
fix
Run: npm install nanostores-mcp. Then use ESM import syntax.
Error: The module '@vue/compiler-sfc' does not provide an export named 'parse'
Outdated version of @vue/compiler-sfc (<3.0.0) installed as peer dependency.
fix
Update to @vue/compiler-sfc@^3.0.0: npm install @vue/compiler-sfc@latest
Error: No stores found. Make sure your project uses nanostores
Project root not correctly detected, or stores are defined in files that are not scanned (e.g., .tsx without JSX).
fix
Verify that your project has .js/.ts/.vue/.svelte files importing from 'nanostores'. You can pass explicit project root path.
Error: listen EADDRINUSE :::3001
Default WebSocket port 3001 for runtime monitoring is already in use.
fix
Specify a different port: startMCP({ monitoring: { port: 3002 } })
Upgrade
Version history
0.1.2latest on npm
Audit
Dependencies
nanostoresrequiredPeer dependency: core library for store definitions and runtime monitoring.
@nanostores/loggerrequiredPeer dependency: provides runtime events (mount/unmount, value changes) for live monitoring.
svelteoptionalPeer dependency: required for parsing Svelte components and detecting auto-subscriptions.
@vue/compiler-sfcoptionalPeer dependency: required for parsing Vue Single File Components (SFC) in static analysis.
Agent activity
19 hits · last 30 days
node
12
Amazon
1
Resources