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

@2ndbrainlabs-ai/synapse-cli

v0.1.4-hotfix-1

Published

Agentic MCP server generator — the first piece of Synapse's Enterprise Context Engine

Readme

Enterprise Context Engine

Today: MCP Servers. Tomorrow: Every Context Surface Your Stack Needs.

Turn any codebase into a production-ready Model Context Protocol server — from your terminal, in seconds.

Homepage · Docs · Report an issue · Discussions

npm version node license downloads


What is Synapse?

Synapse is building the context layer enterprises need to make their internal systems agent-ready. Today, we're open-sourcing the first piece of that vision: an agentic MCP server generator that analyzes existing codebases and generates production-ready MCP servers.

Synapse is a CLI that reads your codebase and generates a runnable MCP server — the tool schemas, argument marshalling, and boilerplate are all handled for you. Point it at a project, describe what you want exposed, and drop the resulting server into Claude Desktop, Cursor, or any MCP-compatible client.

The CLI does source exploration client-side — nothing is uploaded. Generation runs on the Synapse backend so model routing, retries, and quota stay centrally managed.

Install

npm install -g @2ndbrainlabs-ai/synapse-cli

Requires Node.js 18+. Verify with synapse --version.

Quick start

cd my-project
synapse init                    # one-time: paste your API key
synapse analyze                 # scans code, writes .synapse/schema.json
synapse build                   # discovers use cases, prompts you to pick

The generated server lands at ./mcp_server.py. Copy the printed JSON snippet into your MCP client config and you're done.

Prefer to describe it yourself:

synapse build --query "Expose user auth and profile lookup as MCP tools"

Run locally with your own Anthropic key

Skip the hosted Synapse service entirely — codegen runs in-process using your Anthropic key. No quota, no code upload, no signup required.

export ANTHROPIC_API_KEY=sk-ant-…

cd my-project
synapse init --local            # writes mode: "local" to .synapse/config.json
synapse build                   # uses your Anthropic key, generates locally

Prefer a one-shot without changing the project's mode:

synapse build --local --anthropic-key sk-ant-…

The Anthropic key is never stored on disk — it's read from ANTHROPIC_API_KEY or the --anthropic-key flag on every invocation. Locally-generated servers don't count against any quota; analyze runs are unbounded.

Anonymous usage telemetry (no code, no prompts — just event names + counts) still flows to api.synaps3.ai so we can see adoption. Opt out with SYNAPSE_TELEMETRY=0.

Local-mode limits:

  • Python target only (TypeScript target follows).
  • Auto flow (--auto) requires the hosted service. Use --custom (the default in local mode).

Features

  • Zero boilerplate — tool schemas, argument validation, and MCP wire format handled for you.
  • Client-side exploration — grep, AST symbol lookup, and definition/usage tracing all run on your machine.
  • First-class Python + TypeScript — full symbol and navigation support. Go, Java, C#, Rust get grep-based fallback.
  • Streaming gRPC — bidirectional session with the agent so you can watch tool calls land in real time.
  • Deterministic surface extraction — tree-sitter parsers with a 64KB head-sniff make repeat runs cache-friendly.
  • Signed API keys — Ed25519 envelope keys, per-request quota, revocation in under 30 seconds.

Commands

| Command | Purpose | |---|---| | synapse init [--force] | Initialize Synapse in the current project. Prompts for API key. | | synapse analyze [-o <dir>] [-v] | Scan the codebase and build a symbol/schema map. | | synapse build [-q <query>] [-o <file>] [--no-validate] [--no-docs] [-g] | Generate an MCP server. Without -q, discovers candidate use cases. | | synapse config [--update] [--key <k>] [--global] | View or update config. | | synapse info | Show project state and account quota. | | synapse update | Update the CLI to the latest npm release. | | synapse uninstall | Remove global config and uninstall. |

Add --dev to any command to talk to a local backend on localhost:50051.

Configuration

Config is resolved in this order:

  1. Environment variables (SYNAPSE_API_KEY, SYNAPSE_BACKEND_URL, SYNAPSE_DEV=1)
  2. Project-local ./.synapse/config.json
  3. Global ~/.synapse/config.json

How build works

synapse build opens a bidirectional gRPC stream with the backend agent. The agent never sees your code — it asks the CLI for exactly what it needs:

  • read_file, find_files, grep — bounded reads over your working directory
  • list_symbols, find_definition, find_usages — AST navigation via tree-sitter
  • write_file, replace_file, insert_file — final artifact writes

Every tool call is scoped to process.cwd(). Only the specific bytes the agent asks for flow back over the wire.

Language support

| Language | Symbol extraction | Discovery | Generation | |---|---|---|---| | Python | ✅ | ✅ | ✅ | | TypeScript / JavaScript / TSX / JSX | ✅ | ✅ | ✅ | | Go, Java, C#, Rust | grep + patterns | partial | best-effort |

Troubleshooting

| Message | Fix | |---|---| | Not Initialized on build | Run synapse init | | Analysis Required | Run synapse analyze | | Quota Exceeded | Check synapse info | | Backend error mid-build | The CLI retries transient errors. Quote the Session: id when opening an issue. |

Documentation

Development

git clone https://github.com/2ndbrainlabs-ai/synapse-cli.git
cd synapse-cli
npm install
npm run dev -- <command>        # run against source
npm run build                   # produce dist/
npm test                        # vitest suite
npm run typecheck

Contributing

Contributions are welcome. See CONTRIBUTING.md for how to file issues, run the test suite, and open a PR. All participation is subject to our Code of Conduct.

Security

Please review our Security Policy before reporting vulnerabilities.

License

Licensed under the Apache License, Version 2.0. See NOTICE for attribution.


Built by 2nd Brain Inc.