npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@millstone/synapse-context-mcp

v0.7.0

Published

MCP server for Synapse framework - provides context management, code structure extraction, and Claude Code integration

Readme

Context MCP Server

A Model Context Protocol (MCP) server providing intelligent context management and code structure extraction for AI assistants like Claude.

Features

  • FTS5 Full-Text Search - BM25-ranked search (220x faster than grep!)
  • Tree-Sitter Code Structure - Extract signatures from 40+ languages
  • File Search - Path pattern search with .gitignore support
  • Selection Management - Track which files are in context
  • Token Counting - GPT-4 tokenization with tiktoken
  • File Reading - Full files or specific line ranges
  • Workspace Context - Comprehensive snapshots of selected content

Installation

# Clone the repository
git clone <your-repo>
cd context-mcp-server

# Install dependencies
npm install

# Build
npm run build

Note: You'll see TypeScript warnings from Continue's node_modules during build - these are expected and safe to ignore. See Build Guide for details.

Usage with Claude Desktop

Add to your Claude Desktop config at:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "context": {
      "command": "node",
      "args": ["/absolute/path/to/context-mcp-server/dist/index.js"],
      "env": {
        "WORKSPACE_DIR": "/absolute/path/to/your/project"
      }
    }
  }
}

Usage with Claude Code


  "mcpServers": {
    "context-helper-code": {
      "command": "node",
      "args": [
        "/absolute/path/to/context-helper-mcp/dist/index.js"
      ],
      "env": {
        "WORKSPACE_DIR": "/path/to/workspace/millstonehq/cc-templates/"
      }
    },
    "context-helper-docs": {
      "command": "node",
      "args": [
        "/absolute/path/to/context-helper-mcp/dist/index.js"
      ],
      "env": {
        "WORKSPACE_DIR": "/path/to/workspace/millstonehq/synapse/"
      }
    }
  },

Important:

  • Use absolute paths! Relative paths will not work.
  • After updating the config, restart Claude Desktop completely (quit and reopen)

Quick Start

  1. Search for files: Use file_search tool
  2. Add to selection: Use manage_selection with op: "add"
  3. Review selection: Use manage_selection with op: "get"
  4. Preview before sending: Use manage_selection with op: "preview"
  5. Get context: Use workspace_context tool

Available Tools

1. file_search

Search files by path pattern or content.

Example:

{
  "pattern": "SelectionManager",
  "mode": "content",
  "filter": {
    "extensions": ["ts"]
  }
}

2. get_file_tree

Get workspace file structure.

3. read_file

Read file contents with optional line ranges.

4. manage_selection

Manage context selection - the KEY feature for context management!

Operations:

  • get - Get current selection
  • add - Add files to selection
  • remove - Remove files from selection
  • set - Replace entire selection
  • clear - Clear all selections
  • preview - Preview what would be sent to LLM
  • promote - Upgrade codemap_only to full content
  • demote - Downgrade full to codemap_only

5. get_code_structure

Extract code structure using tree-sitter.

6. workspace_context

Get comprehensive workspace context including selection, code structures, files, and token counts.

Development

# Watch mode
npm run dev

# Build
npm run build

# Test
npm test

Documentation

Architecture

Uses esbuild bundling to integrate Continue's advanced features:

  • Bundles Continue's FTS5 and tree-sitter modules automatically
  • Polyfills __dirname for ESM compatibility
  • Externalizes native modules (sqlite3, tree-sitter)
  • Zero manual maintenance - just run npm run build

See Bundling Solution for technical details.

Performance

| Operation | Traditional (Grep) | FTS5 Search | Improvement | |-----------|-----------|-----------|-------------| | Content search (1000 files) | ~2s | ~9ms | 220x faster | | Code structure extraction | N/A | ~5ms | New feature |

Troubleshooting

"MCP server not found"

  • Ensure you used absolute paths in config
  • Check that dist/index.js exists after building
  • Restart Claude Desktop completely

"Permission denied"

chmod +x dist/index.js

"Module not found"

rm -rf dist node_modules
npm install
npm run build

Debug logging

The server logs to stderr. To see logs:

WORKSPACE_DIR=/path/to/project node dist/index.js

Comparison to Other Tools

vs RepoPrompt

  • ✅ Integrates directly with Claude via MCP (no copy/paste)
  • 220x faster search with FTS5 instead of grep
  • ✅ Selection tracking with token budgeting
  • ✅ Tree-sitter code structure for 40+ languages

vs Continue Extension

  • ✅ Works with Claude Desktop (not just VS Code)
  • ✅ Uses Continue's FTS5 and tree-sitter via bundling
  • ✅ Focused on context management (not autocomplete)
  • ✅ Simpler setup - just one MCP server

License

MIT

Credits