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

backend-explorer-mcp

v1.0.4

Published

A Model Context Protocol (MCP) server for exploring backend systems through ERD, Swagger API docs, and MongoDB data to integrate with AI assistants

Downloads

10

Readme

backend-explorer-mcp

The Backend Insight Gateway is a Model Context Protocol (MCP) server designed to help frontend developers understand backend code implementations using Cursor AI. This server provides tools to explore ERD, Swagger API documentation, and MongoDB databases.

Available Tools

1. get_erd

Retrieves Entity-Relationship Diagram (ERD) information to understand backend database schema and relationships.

// Usage example
{
  "options": {
    "format": "markdown" // or "json"
  }
}

2. get_swagger

Retrieves Swagger API documentation to explore backend API endpoints, parameters, response schemas, and more.

// Usage example
{
  "options": {
    "format": "markdown", // or "json"
    "path": "/api/users" // Optional: filter for specific path only
  }
}

3. mongodb_explorer

Explore MongoDB database information including collections, schemas, and sample data.

// List collections
{
  "action": "listCollections",
  "options": {
    "format": "markdown" // or "json"
  }
}

// Describe collection schema
{
  "action": "describeCollection",
  "collection": "users",
  "options": {
    "format": "markdown" // or "json"
  }
}

// View sample data
{
  "action": "sampleData",
  "collection": "users",
  "options": {
    "format": "markdown", // or "json"
    "limit": 5 // Number of sample documents to retrieve (default: 10)
  }
}

// Run query
{
  "action": "query",
  "collection": "users",
  "query": "{\"username\": \"johndoe\"}",
  "options": {
    "format": "markdown", // or "json"
    "limit": 5 // Limit results (default: 10)
  }
}

Quick Start

# Install dependencies
pnpm install

# Set up environment variables
cp .env.example .env
# Edit .env with your specific URLs and credentials

# Build the project
pnpm run build

# Start the server
pnpm start

Environment Variables

Create a .env file in the project root with the following variables:

# Backend API URLs
ERD_API_URL=https://your-api.example.com/erd
SWAGGER_API_URL=https://your-api.example.com/swaggerJson

# MongoDB Configuration
MONGODB_API_URL=https://your-api.example.com/api/mongodb
# MONGODB_CONNECTION_STRING=mongodb://username:password@host:port/database

# Server Configuration
PORT=8080
# Set to "sse" or "http" to use HTTP transport instead of stdio
# TRANSPORT_TYPE=sse
# CORS_ALLOWED_ORIGIN=*

Project Structure

backend-explorer-mcp/
├── src/
│   ├── tools/        # MCP tools
│   │   ├── ERDTool.ts
│   │   ├── SwaggerTool.ts
│   │   ├── MongoDBTool.ts
│   │   └── ExampleTool.ts
│   └── index.ts      # Server entry point
├── package.json
└── tsconfig.json

Usage with Cursor

Add the MCP server in Cursor settings:

  1. Launch Cursor and go to Preferences
  2. Select the MCP tab
  3. Click "Add new global MCP server"
  4. Configure as follows:
{
  "command": "node",
  "args": ["/absolute/path/to/backend-explorer-mcp/dist/index.js"]
}

Usage with Claude Desktop

Development Environment

Add the following configuration to your Claude Desktop config file:

MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "backend-explorer-mcp": {
      "command": "node",
      "args":["/absolute/path/to/backend-explorer-mcp/dist/index.js", "--stdio"]
    }
  }
}

After Deployment

After publishing the package to npm, you can configure it as follows:

{
  "mcpServers": {
    "backend-explorer-mcp": {
      "command": "npx",
      "args": ["backend-explorer-mcp", "--stdio"]
    }
  }
}

Passing Configuration Parameters

To provide database connection details and other settings, you can pass them as command line arguments:

{
  "mcpServers": {
    "backend-explorer-mcp": {
      "command": "npx",
      "args": [
        "backend-explorer-mcp",
        "--stdio",
        "--mongodb-uri=mongodb://username:password@host:port/database",
        "--erd-api-url=https://your-api.example.com/erd",
        "--swagger-api-url=https://your-api.example.com/swaggerJson"
      ]
    }
  }
}

Alternatively, you can use the env section to provide environment variables:

{
  "mcpServers": {
    "backend-explorer-mcp": {
      "command": "npx",
      "args": ["backend-explorer-mcp", "--stdio"],
      "env": {
        "MONGODB_URI": "mongodb://username:password@host:port/database",
        "ERD_API_URL": "https://your-api.example.com/erd",
        "SWAGGER_API_URL": "https://your-api.example.com/swaggerJson"
      }
    }
  }
}

Building and Testing

  1. Modify the tools
  2. Run pnpm run build to compile
  3. The server will automatically load the tools

Publishing to npm

To publish the package to npm:

# Update version in package.json
pnpm version [patch|minor|major]

# Build the project
pnpm run build

# Publish to npm
pnpm publish

Make sure to set the appropriate access level in your package.json:

{
  "name": "backend-explorer-mcp",
  "publishConfig": {
    "access": "public" // or "restricted" for private packages
  }
}

Learn More