{
  "markdown": "# Nano Stores MCP\n\n<img align=\"right\" width=\"92\" height=\"92\" title=\"Nano Stores logo\"\n     src=\"https://nanostores.github.io/nanostores/logo.svg\">\n\n**Model Context Protocol server for Nanostores** — analyze, debug and monitor\nyour nanostores in AI assistants like Claude Desktop.\n\n- **📊 Static Analysis:** AST-based project scanning, dependency graphs, store inspection\n- **🔥 Runtime Monitoring:** Live events from `@nanostores/logger`, performance metrics, activity tracking\n- **📚 Documentation:** Search and browse Nanostores docs by topic or store kind\n- **🎯 Zero Config:** Works out of the box — auto-detects project roots and nanostores docs\n- **🌐 Framework-Agnostic:** Works with React, Vue, Svelte, Angular, Solid, Preact, Lit — any framework that uses Nanostores\n\n```bash\nnpx nanostores-mcp\n```\n\nAsk your AI: _\"Analyze my store architecture\"_ or _\"Which stores update most frequently?\"_\n\n---\n\n<img src=\"https://cdn.evilmartians.com/badges/logo-no-label.svg\" alt=\"\" width=\"22\" height=\"16\" /> Made at <b><a href=\"https://evilmartians.com/devtools?utm_source=nanostores-mcp&utm_campaign=devtools-button&utm_medium=github\">Evil Martians</a></b>, product consulting for <b>developer tools</b>.\n\n---\n\n## Table of Contents\n\n- [Features](#features)\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Configuration](#configuration)\n- [Quick Start](#quick-start)\n- [MCP Interface](#mcp-interface)\n  - [Resources](#mcp-resources)\n  - [Tools](#mcp-tools)\n  - [Advanced Tool Arguments](#advanced-tool-arguments)\n  - [Prompts](#mcp-prompts)\n- [Runtime Monitoring](#runtime-monitoring)\n  - [Reading Results](#reading-results)\n  - [Privacy & Security](#privacy--security)\n- [Example Queries](#example-queries)\n- [Architecture](#architecture)\n- [Limitations & Caveats](#limitations--caveats)\n- [Development](#development)\n- [Troubleshooting](#troubleshooting)\n\n## Features\n\n### 📊 Static Analysis (AST-based)\n\nUnderstand your nanostores architecture without running your app:\n\n- **Project scanning** — find all stores, subscribers, and import/export relationships\n- **Dependency graph** — visualize how stores depend on each other (Mermaid diagrams)\n- **Store inspection** — type (atom/map/computed/batched/persistentAtom/persistentMap/router), location, usage patterns, related files\n- **Framework-aware subscriber detection** — recognizes `.subscribe()` / `.listen()` calls and component bindings across React, Vue, Svelte, and Angular\n- **Vue SFC support** — parses both `<script>` and `<script setup>` blocks in `.vue` files (requires `@vue/compiler-sfc`)\n- **Svelte support** — parses `<script context=\"module\">` and instance `<script>` blocks, auto-subscriptions (`$storeName` in templates), and filters out Svelte 5 runes (`$state`, `$derived`, `$effect`, etc.) so they are not mistaken for store references (requires `svelte`)\n- **Angular DI support** — resolves `@nanostores/angular` `NanostoresService` constructor injections and detects `this.nanostores.useStore(...)` call patterns in TypeScript component files\n\n### 🔥 Runtime Monitoring (Logger Integration)\n\nReal-time insights into your running application:\n\n- **Live event capture** — mount/unmount, value changes, action calls from `@nanostores/logger`\n- **Performance analysis** — find noisy stores, high error rates, performance bottlenecks\n- **Activity metrics** — change frequency, action success/failure rates, action duration\n- **Combined analysis** — merge static structure with runtime behavior for deep debugging\n\n### 📚 Documentation Search\n\nSearch and browse Nanostores documentation directly from your AI assistant:\n\n- **Full-text search** — find guides, API references, and best practices by query\n- **Store-kind lookup** — get docs relevant to a specific store type (atom, map, computed, etc.)\n- **Auto-detection** — picks up docs from `nanostores` in your `node_modules` automatically\n\n## Requirements\n\n| Requirement | Version                 |\n| ----------- | ----------------------- |\n| Node.js     | `^20.0.0 \\|\\| >=22.0.0` |\n\n**Required peer dependency** (for static analysis):\n\n```bash\nnpm install nanostores\n```\n\n**Optional peer dependencies** — install only if you use the corresponding file format:\n\n| Package              | When needed                            |\n| -------------------- | -------------------------------------- |\n| `@vue/compiler-sfc`  | Vue SFC (`.vue`) file scanning         |\n| `svelte`             | Svelte (`.svelte`) file scanning       |\n| `@nanostores/logger` | Runtime monitoring (`attachMcpLogger`) |\n\nWithout these optional packages the server still works — it silently skips unsupported file types.\n\n## Installation\n\n```bash\nnpm install -g nanostores-mcp\n# or\npnpm add -g nanostores-mcp\n```\n\nOr run directly without installation:\n\n```bash\nnpx nanostores-mcp\n```\n\n## Configuration\n\n### Claude Desktop\n\nAdd to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\\Claude\\claude_desktop_config.json` (Windows):\n\n```json\n{\n\t\"mcpServers\": {\n\t\t\"nanostores\": {\n\t\t\t\"command\": \"npx\",\n\t\t\t\"args\": [\"-y\", \"nanostores-mcp\"],\n\t\t\t\"env\": {\n\t\t\t\t\"NANOSTORES_MCP_ROOT\": \"/path/to/your/project\"\n\t\t\t}\n\t\t}\n\t}\n}\n```\n\n### VS Code\n\nRequires **GitHub Copilot** extension (VS Code 1.99+). Create `.vscode/mcp.json` in your project:\n\n```json\n{\n\t\"servers\": {\n\t\t\"nanostores\": {\n\t\t\t\"type\": \"stdio\",\n\t\t\t\"command\": \"npx\",\n\t\t\t\"args\": [\"-y\", \"nanostores-mcp\"]\n\t\t}\n\t}\n}\n```\n\nTools are available in Copilot's **Agent mode** (select \"Agent\" in the Copilot Chat dropdown).\n\n### Cursor\n\nCreate `.cursor/mcp.json` in your project root (or `~/.cursor/mcp.json` for global):\n\n```json\n{\n\t\"mcpServers\": {\n\t\t\"nanostores\": {\n\t\t\t\"command\": \"npx\",\n\t\t\t\"args\": [\"-y\", \"nanostores-mcp\"]\n\t\t}\n\t}\n}\n```\n\n### Zed\n\nAdd to your Zed `settings.json`:\n\n```json\n{\n\t\"context_servers\": {\n\t\t\"nanostores\": {\n\t\t\t\"command\": \"npx\",\n\t\t\t\"args\": [\"-y\", \"nanostores-mcp\"],\n\t\t\t\"env\": {\n\t\t\t\t\"NANOSTORES_MCP_ROOT\": \"/path/to/your/project\"\n\t\t\t}\n\t\t}\n\t}\n}\n```\n\nThe server appears in Zed's **Agent Panel** settings.\n\n### Windsurf\n\nAdd to `~/.codeium/windsurf/mcp_config.json`:\n\n```json\n{\n\t\"mcpServers\": {\n\t\t\"nanostores\": {\n\t\t\t\"command\": \"npx\",\n\t\t\t\"args\": [\"-y\", \"nanostores-mcp\"],\n\t\t\t\"env\": {\n\t\t\t\t\"NANOSTORES_MCP_ROOT\": \"/path/to/your/project\"\n\t\t\t}\n\t\t}\n\t}\n}\n```\n\nYou can also open this file from the MCP icon in the Cascade panel → \"Configure\".\n\n### Claude Code\n\nAdd via CLI:\n\n```bash\nclaude mcp add --transport stdio nanostores -- npx -y nanostores-mcp\n```\n\nOr create `.mcp.json` in your project root (shared with the team):\n\n```json\n{\n\t\"mcpServers\": {\n\t\t\"nanostores\": {\n\t\t\t\"command\": \"npx\",\n\t\t\t\"args\": [\"-y\", \"nanostores-mcp\"],\n\t\t\t\"env\": {\n\t\t\t\t\"NANOSTORES_MCP_ROOT\": \"/path/to/your/project\"\n\t\t\t}\n\t\t}\n\t}\n}\n```\n\n### Environment Variables\n\n| Variable                        | Default     | Description                                                                     |\n| ------------------------------- | ----------- | ------------------------------------------------------------------------------- |\n| `NANOSTORES_MCP_ROOT`           | cwd         | Project root path                                                               |\n| `NANOSTORES_MCP_ROOTS`          | —           | Platform-delimited roots (`:` on Unix, `;` on Windows) for multi-project setup  |\n| `WORKSPACE_FOLDER`              | —           | Alias for `NANOSTORES_MCP_ROOT` — set automatically by VS Code and some editors |\n| `WORKSPACE_FOLDER_PATHS`        | —           | Alias for `NANOSTORES_MCP_ROOTS` — set automatically by some editors            |\n| `NANOSTORES_MCP_LOGGER_ENABLED` | `true`      | Set to `false` or `0` to disable runtime event collection and the logger bridge |\n| `NANOSTORES_MCP_LOGGER_PORT`    | `3999`      | HTTP port for logger bridge                                                     |\n| `NANOSTORES_MCP_LOGGER_HOST`    | `127.0.0.1` | Host to bind. Allowed values: `127.0.0.1`, `localhost`, `::1`                   |\n| `NANOSTORES_DOCS_ROOT`          | auto-detect | Path to documentation directory                                                 |\n| `NANOSTORES_DOCS_PATTERNS`      | `**/*.md`   | Comma-separated glob patterns for docs                                          |\n\n### How the Project Root Is Resolved\n\nThe server picks workspace roots in priority order:\n\n1. **Environment variables** (highest priority) — `NANOSTORES_MCP_ROOTS` / `NANOSTORES_MCP_ROOT` / `WORKSPACE_FOLDER_PATHS` / `WORKSPACE_FOLDER`\n2. **Client roots** — roots reported by the MCP client via the `roots/list` capability (set automatically by some editors)\n3. **Current working directory** — `process.cwd()` used as fallback when neither env nor client roots are configured\n\nWhen a tool is called without an explicit `projectRoot` argument the server uses the **first configured root**. In a multi-root setup always pass `projectRoot` to avoid ambiguity.\n\n## Quick Start\n\n### 1. Static Analysis\n\nWorks out of the box — just point at your project and ask:\n\n- _\"Analyze my store architecture\"_\n- _\"Explain how nanostores is used in this project\"_\n- _\"Give me a summary of the $cart store\"_\n- _\"My stores changed — re-scan the project\"_ ← the AI will force a fresh scan\n\n### 2. Documentation Search\n\nAuto-detected from `nanostores` in your `node_modules`:\n\n- _\"How do I use computed stores?\"_\n- _\"Show me the docs for persistentAtom\"_\n\n### 3. Runtime Monitoring (Optional)\n\nRequires logger integration in your app. See [Runtime Monitoring](#runtime-monitoring) below.\n\n- _\"Which stores update most frequently?\"_\n- _\"Show me recent activity for $user\"_\n- _\"Give me an overall health report\"_\n\n### Verify Your Setup\n\nRun these four tools in order to confirm everything is working:\n\n```\nnanostores_ping              → should return server status and logger bridge state\nnanostores_scan_project      → should list your stores and subscribers\nnanostores_docs_search       → should return documentation results (requires nanostores in node_modules)\nnanostores_runtime_overview  → should return overview (or \"no runtime data\" if logger is disabled — that's fine)\n```\n\nIf `nanostores_scan_project` returns zero stores, check that `NANOSTORES_MCP_ROOT` points to the correct project directory.\n\n## MCP Interface\n\n### MCP Resources\n\n| Resource                      | Description                              |\n| ----------------------------- | ---------------------------------------- |\n| `nanostores://graph`          | Full dependency graph (text + Mermaid)   |\n| `nanostores://store/{key}`    | Store details by name or id              |\n| `nanostores://docs`           | Documentation index — all pages and tags |\n| `nanostores://docs/page/{id}` | Full content of a documentation page     |\n\n### MCP Tools\n\n**Static Analysis**\n\n| Tool                         | Description                                                       |\n| ---------------------------- | ----------------------------------------------------------------- |\n| `nanostores_scan_project`    | Scan project for all stores, subscribers, and dependencies        |\n| `nanostores_store_summary`   | Detailed summary of a specific store                              |\n| `nanostores_project_outline` | High-level overview: store kinds, top directories, hub stores     |\n| `nanostores_store_subgraph`  | BFS-expanded dependency neighborhood of a store                   |\n| `nanostores_store_impact`    | Downstream causal chain — what recomputes/re-renders if X changes |\n\n**Runtime Monitoring**\n\n| Tool                           | Description                                                        |\n| ------------------------------ | ------------------------------------------------------------------ |\n| `nanostores_runtime_overview`  | Overall health report with statistics for all stores               |\n| `nanostores_store_activity`    | Activity timeline for a specific store (filterable by kind/action) |\n| `nanostores_find_noisy_stores` | Identify stores with high change frequency or error rates          |\n| `nanostores_runtime_coverage`  | Compare static graph with runtime events to find coverage gaps     |\n\n**Documentation**\n\n| Tool                     | Description                                                                                                                                  |\n| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------- |\n| `nanostores_docs_search` | Search docs by `query` (full-text), `storeKind` (atom, map, computed, persistentAtom, etc.), or both. Optional: `limit` (default 10), `tags` |\n\nUse `nanostores://docs/page/{id}` resource to read the full content of pages returned by search.\n\n**Utilities**\n\n| Tool                     | Description                                  |\n| ------------------------ | -------------------------------------------- |\n| `nanostores_ping`        | Server health check and logger bridge status |\n| `nanostores_clear_cache` | Clear project index cache to force rescan    |\n\n### MCP Prompts\n\n| Prompt                   | Parameters                | Description                                                                                                               |\n| ------------------------ | ------------------------- | ------------------------------------------------------------------------------------------------------------------------- |\n| `explain-project`        | `focus` _(optional)_      | AI-guided explanation of your project's store architecture. `focus` narrows to a feature/domain (e.g. `\"cart\"`, `\"auth\"`) |\n| `explain-store`          | `store_name` _(required)_ | Deep dive into a specific store's implementation and usage                                                                |\n| `debug-store`            | `store_name` _(required)_ | Comprehensive analysis combining static + runtime data                                                                    |\n| `debug-project-activity` | —                         | Project-wide performance analysis and optimization                                                                        |\n| `docs-how-to`            | `task` _(required)_       | Step-by-step guidance for a Nanostores task, backed by docs (e.g. `\"How do I sync a map store to localStorage?\"`)         |\n\n### Advanced Tool Arguments\n\nMost tools accept these optional arguments that significantly change their behavior:\n\n| Argument      | Type                         | Used in                                                   | Description                                                                                                                                                                                    |\n| ------------- | ---------------------------- | --------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `storeId`     | `string`                     | `store_summary`, `store_subgraph`, `store_impact`         | Exact store identifier — format: `store:src/stores.ts#$counterName`. Takes priority over `name` when both are provided.                                                                        |\n| `name`        | `string`                     | `store_summary`, `store_subgraph`, `store_impact`         | Store name (e.g. `\"$user\"`). Used when `storeId` is not provided.                                                                                                                              |\n| `radius`      | `number` (0–10, default `2`) | `nanostores_store_subgraph`                               | BFS hops around the store. `1` = direct deps only; `2` = deps of deps. **Warning:** on highly-connected hub stores (hub score > 5) radius ≥ 2 may return most of the project — start with `1`. |\n| `projectRoot` | `string`                     | most tools                                                | Which project root to analyze in multi-root setups. Omit to use the first configured root. Always specify this in multi-root projects.                                                         |\n| `windowMs`    | `number`                     | `store_activity`, `find_noisy_stores`, `runtime_overview` | Look-back window in milliseconds (e.g. `60000` = last 60 s). Filters events to that time range.                                                                                                |\n| `kinds`       | `string[]`                   | `nanostores_store_activity`                               | Filter events by type. Values: `\"mount\"`, `\"unmount\"`, `\"change\"`, `\"action-start\"`, `\"action-end\"`, `\"action-error\"`.                                                                         |\n| `actionName`  | `string`                     | `nanostores_store_activity`                               | Filter events to a specific action (e.g. `\"increment\"`).                                                                                                                                       |\n| `compact`     | `boolean`                    | `scan_project`, `find_noisy_stores`, `runtime_overview`   | Return a compressed token-efficient table instead of full text. Useful for large projects to reduce context usage.                                                                             |\n\n## Runtime Monitoring\n\nFor runtime analysis, integrate the MCP Logger client into your application.\n\n**1. Install in your app and enable the logger bridge:**\n\n```bash\nnpm install nanostores-mcp\n```\n\nThe logger bridge starts automatically — no extra config needed. To disable it, set `NANOSTORES_MCP_LOGGER_ENABLED=false` in your MCP server config.\n\n**2. Define stores with logger attached** (`src/stores.ts`):\n\n```typescript\nimport { atom, map, computed } from \"nanostores\";\nimport { initMcpLogger, attachMcpLogger } from \"nanostores-mcp/mcpLogger\";\n\n// Automatically disabled in production (checks NODE_ENV / import.meta.env.DEV)\ninitMcpLogger();\n\n// Stores\nexport const $count = atom(0);\nexport const $user = map({ name: \"\", role: \"guest\" });\nexport const $greeting = computed($user, user => `Hello, ${user.name}`);\n\n// Attach logger — each call returns a cleanup function\nattachMcpLogger($count, \"$count\");\nattachMcpLogger($user, \"$user\");\nattachMcpLogger($greeting, \"$greeting\");\n```\n\n**3. Use stores normally** — events (mount, unmount, change, actions) are captured automatically and batched to the MCP server every second.\n\n**4. Ask your AI assistant:**\n\n- _\"Which stores change most frequently?\"_ → `nanostores_find_noisy_stores`\n- _\"Show me recent activity for $user\"_ → `nanostores_store_activity`\n- _\"Give me an overall health report\"_ → `nanostores_runtime_overview`\n\n### Logger Options\n\n```typescript\ninitMcpLogger({\n\turl: \"http://127.0.0.1:3999/nanostores-logger\", // default; change if using a custom port\n\tbatchMs: 1000, // default; lower for faster delivery (e.g. 200)\n\tprojectRoot: \"/absolute/path/to/project\", // link runtime events with static analysis\n\n\t// Mask sensitive data — return null to skip event entirely\n\tmaskEvent: event => {\n\t\tif (event.storeName === \"authToken\") return null;\n\t\treturn event;\n\t},\n});\n```\n\n### Flush Before Shutdown\n\n```typescript\nimport { getMcpLogger } from \"nanostores-mcp/mcpLogger\";\n\nwindow.addEventListener(\"beforeunload\", async () => {\n\tawait getMcpLogger()?.forceFlush();\n});\n```\n\n### Reading Results\n\n**`nanostores_runtime_overview` health summary**\n\nThe overview groups stores into three categories:\n\n- **Top active stores** — sorted by total event count (changes + actions). A store that appears here with hundreds of changes in seconds may be a performance concern.\n- **Error-prone stores** — stores with `action-error` events. High error counts indicate failing async actions.\n- **Unmounted stores** — stores seen at mount but never unmounted. May indicate memory leaks.\n\n**`nanostores_runtime_coverage`**\n\nCompares your static store graph against observed runtime events:\n\n| Term                 | Meaning                                                                                                                                                 |\n| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **static-only**      | Store found by AST scan but **no runtime events** observed. Possible dead code, deferred initialization, or missing `attachMcpLogger` call.             |\n| **runtime-only**     | Events received for a store **not found by the scanner**. Common for dynamically-created stores, factory patterns, or stores in `node_modules`.         |\n| **Coverage by kind** | E.g. `atom: 3/5 (60%)` — 3 out of 5 atom stores received runtime events. 0% for a kind usually means `attachMcpLogger` was not called for those stores. |\n\n**`nanostores_find_noisy_stores`**\n\nReturns stores ranked by total activity (changes + actions combined) within the `windowMs` period. A store is considered \"noisy\" when its change frequency is disproportionately high relative to visible UI updates — use this to find re-render hotspots or thrashing computed chains.\n\n### Privacy & Security\n\nThe runtime logger is designed to stay on your local machine:\n\n- **Loopback-only binding** — the HTTP bridge accepts connections exclusively from `127.0.0.1`, `localhost`, or `::1`. Binding to `0.0.0.0` is explicitly blocked. Data never leaves your machine.\n- **What is transmitted** — from your app to the MCP server over localhost: store name, timestamp, event kind, and optionally value snapshots (truncated to 200 characters). Nothing is sent to Anthropic or any third party.\n- **Nothing is persisted** — events are held in a ring buffer (5 000 events max) in process memory and discarded when the server restarts.\n- **Mask sensitive data** — use `maskEvent` to filter or redact events client-side before they are batched and sent:\n\n```typescript\ninitMcpLogger({\n\tmaskEvent: event => {\n\t\tif (event.storeName === \"$authToken\") return null; // drop entirely\n\t\tif (event.storeName === \"$paymentInfo\") return { ...event, newValue: undefined }; // strip value\n\t\treturn event;\n\t},\n});\n```\n\n- **CORS** — the bridge rejects cross-origin requests from non-loopback origins.\n\n## Example Queries\n\nAsk your AI assistant natural language questions:\n\n**Static Analysis:**\n\n- _\"Analyze my store architecture for potential issues\"_\n- _\"What happens when $user changes? Show subscribers and derived stores\"_\n\n**Runtime Debugging:**\n\n- _\"Which stores update most frequently?\"_\n- _\"Are there stores declared in code but never used at runtime?\"_\n- _\"Debug the $user store — combine static analysis with runtime behavior\"_\n\n**With [Playwright MCP](https://github.com/microsoft/playwright-mcp):**\n\n- _\"Open my app in the browser, interact with it, and analyze which stores cause the most recalculations\"_\n\n**Documentation:**\n\n- _\"How do I use computed stores?\"_\n- _\"Show me best practices for persistent stores\"_\n\n## Architecture\n\n```\n┌──────────────────────┐\n│   Your Application   │\n│                      │\n│  @nanostores/logger  │\n│        events        │\n└──────────┬───────────┘\n           │ HTTP POST (localhost:3999)\n           ▼\n┌──────────────────────┐\n│   nanostores-mcp     │\n│                      │\n│   ┌──────────────┐   │\n│   │ Logger Bridge │   │ ← HTTP server for runtime events\n│   └──────┬───────┘   │\n│          ▼           │\n│   ┌──────────────┐   │\n│   │ Event Store  │   │ ← Ring buffer (5000 events) + stats\n│   └──────┬───────┘   │\n│          │           │\n│   ┌──────┴───────┐   │\n│   │  AST Scanner │   │ ← ts-morph static analysis\n│   └──────┬───────┘   │\n│          │           │\n│   ┌──────┴───────┐   │\n│   │  Docs Index  │   │ ← Auto-detected from node_modules\n│   └──────┬───────┘   │\n│          │           │\n│   ┌──────┴───────┐   │\n│   │ MCP Interface│   │ ← Resources, Tools, Prompts\n│   └──────────────┘   │\n└──────────┬───────────┘\n           │ MCP Protocol (stdio)\n           ▼\n┌──────────────────────┐\n│    LLM Client        │\n│ (Claude, VS Code, …) │\n└──────────────────────┘\n```\n\n## Limitations & Caveats\n\n**Multi-root: same store name in multiple projects**\n\nIn multi-root mode a store named `$user` can exist in two different projects. The runtime event store uses a composite key (`projectRoot + storeName`) to keep them separate, but summary views may show the same name twice with no project label. Always specify `projectRoot` when querying tools in a multi-root setup to get unambiguous results.\n\n**Static analysis only covers discovered files**\n\nThe AST scanner follows TypeScript/JavaScript imports from your project root. Stores created dynamically at runtime, generated by factories, or living in `node_modules` will not appear in static results — they may show up as \"runtime-only\" in coverage reports.\n\n**Vue and Svelte parsing requires optional dependencies**\n\nIf `@vue/compiler-sfc` or `svelte` are not installed, `.vue` / `.svelte` files are silently skipped during scanning. Install them as dev dependencies if you want full coverage for those file types.\n\n**Event ring buffer is capped at 5 000 events**\n\nOlder events are dropped when the buffer is full. For high-frequency stores use `windowMs` to narrow your queries to recent data, or lower `batchMs` in `initMcpLogger` to deliver events more frequently and reduce the chance of buffer overflow during bursts.\n\n**`radius` on hub stores can be very large**\n\nStores with many dependencies (hub score > 5) can return most of the project graph at `radius=2`. Start with `radius=1` and increase only if you need broader context.\n\n## Development\n\n```bash\ngit clone https://github.com/Valyay/nanostores-mcp.git\ncd nanostores-mcp\npnpm install\n\npnpm dev          # Run dev server\npnpm build        # TypeScript compile\npnpm test         # Run vitest\npnpm lint         # ESLint\npnpm check        # All checks: lint + format + test + build\n\n# Test with MCP Inspector\nnpx @modelcontextprotocol/inspector pnpm run dev\n```\n\n## Troubleshooting\n\n**Logger not receiving events:**\n\n1. Use the `ping` tool to verify logger bridge is enabled and running\n2. Check browser console for `[nanostores-mcp]` warnings about connection issues\n3. Confirm the port matches between server (`NANOSTORES_MCP_LOGGER_PORT`) and client URL\n4. Test with a simple atom store to verify events flow\n\n**Port conflicts:**\n\n```bash\n# Change server port\nNANOSTORES_MCP_LOGGER_PORT=4000 npx nanostores-mcp\n\n# Update client\ninitMcpLogger({ url: \"http://127.0.0.1:4000/nanostores-logger\" });\n```\n\n**TypeScript errors:**\n\n```typescript\n// Import from the mcpLogger subpath export\nimport { initMcpLogger, attachMcpLogger } from \"nanostores-mcp/mcpLogger\";\n```\n\n**Documentation not found:**\n\n- The server auto-detects docs from `nanostores` in your `node_modules`\n- Make sure `nanostores` is installed: `npm install nanostores`\n- Or set `NANOSTORES_DOCS_ROOT` to point at a docs directory manually\n\n## Related Projects\n\n**Nanostores ecosystem:**\n\n- [nanostores](https://github.com/nanostores/nanostores) — Tiny state manager (atom, map, computed, batched, deepMap)\n- [@nanostores/logger](https://github.com/nanostores/logger) — Logger and action system\n- [@nanostores/persistent](https://github.com/nanostores/persistent) — Persistent stores (localStorage, sessionStorage)\n- [@nanostores/router](https://github.com/nanostores/router) — SPA router\n- [@nanostores/i18n](https://github.com/nanostores/i18n) — Internationalization\n- [@nanostores/react](https://github.com/nanostores/react), [@nanostores/vue](https://github.com/nanostores/vue), [@nanostores/preact](https://github.com/nanostores/preact), [@nanostores/solid](https://github.com/nanostores/solid), [@nanostores/lit](https://github.com/nanostores/lit) — Framework bindings\n\n**MCP:**\n\n- [Model Context Protocol](https://modelcontextprotocol.io/) — MCP specification\n- [Playwright MCP](https://github.com/microsoft/playwright-mcp) — Browser automation (works with nanostores-mcp for runtime analysis)\n\n## License\n\nMIT\n\n## Contributing\n\nContributions are welcome! Please open an issue or PR.\n",
  "bytes": 28202,
  "sha": "4bdcab753ac4d69677f4f713d60030744774321067314a3821229e3c31e7925e",
  "repo_slug": "valyay/nanostores-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_valyay_nanostores_mcp_dda0b78a/readme"
}