Socket
Book a DemoInstallSign in
Socket

@stellarwp/mcp-node-config

Package Overview
Dependencies
Maintainers
3
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stellarwp/mcp-node-config

An MCP configuration library for Node.js

0.1.2
latest
Source
npmnpm
Version published
Weekly downloads
39
-77.59%
Maintainers
3
Weekly downloads
 
Created
Source

⚙️ Node Config (@stellarwp/mcp-node-config)

A lightweight configuration management library for CLI MCP servers with WordPress integration support.

📦 What is this?

This package provides a simple, type-safe way to manage environment-based configuration for MCP servers, with built-in WordPress-specific configuration validation and error handling.

✨ Features

  • 🛡️ Type Safety: Full TypeScript support with strict typing
  • ⚡ Environment Variables: Automatic environment variable loading with dotenvx
  • ✅ Validation: Built-in configuration validation and missing config detection
  • 🚫 Silent Operation: Designed to work silently in MCP server environments

🚀 Getting Started

Prerequisites

  • Node.js 18+ or Bun 1.2.20+
  • Environment variables for WordPress configuration

Installation

# Install the package
bun add @stellarwp/mcp-node-config

# Or with npm
npm install @stellarwp/mcp-node-config

Environment Setup

Copy the .env.example file in your project root and fill out the correct values for your environment:

WP_REST_URL=https://your-site.com/wp-json/wp/v2/
WP_USERNAME=your_username
WP_APP_PASSWORD=your_application_password

# Uncomment to disable SSL certificate verification for local server development. Should not be enabled on production!
# NODE_TLS_REJECT_UNAUTHORIZED=0

💡 Local Development Tip: When developing on a local environment where SSL certificates wouldn't validate (e.g., localhost with self-signed certs), you can set NODE_TLS_REJECT_UNAUTHORIZED=0 in your environment variables. This is particularly important when using the API Fetch package to connect to local WordPress installations. Note: This should only be used in development environments, never in production.

🔧 Usage

Basic Configuration

#!/usr/bin/env node

// Import env first to load environment variables
import '@stellarwp/mcp-node-config/env';

import { config } from '@stellarwp/mcp-node-config';

// Check if configuration is valid
if (!config.isValid()) {
    const missing = config.getMissingConfig();
    throw new Error(`Missing required env vars: ${missing.join(', ')}`);
}

// Access configuration values
console.log('WordPress REST URL:', config.wpRestUrl);
console.log('Username:', config.wpUsername);

📚 API Reference

Configuration Object

The config object provides the following properties and methods:

Properties

  • wpRestUrl: string - WordPress REST API base URL
  • wpUsername: string - WordPress username for authentication
  • wpAppPassword: string - WordPress application password

Methods

  • getMissingConfig(): string[] - Returns array of missing environment variable names
  • isValid(): boolean - Returns true if all required configuration is present

Environment Variables

VariableDescriptionRequired
WP_REST_URLWordPress REST API base URLYes
WP_USERNAMEWordPress usernameYes
WP_APP_PASSWORDWordPress application passwordYes
NODE_TLS_REJECT_UNAUTHORIZEDSet to 0 for local development with invalid SSL certsNo

FAQs

Package last updated on 22 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.