🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

llng-mcp

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

llng-mcp

MCP Server for Lemonldap-NG

latest
npmnpm
Version
0.2.0
Version published
Weekly downloads
24
-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

llng-mcp

MCP Server for Lemonldap-NG

Manage your Lemonldap-NG web SSO instances from Claude, Cursor, or any MCP-compatible AI assistant. 44 tools covering configuration, sessions, OIDC, SAML, 2FA, and more.

Quick Start

1. Add to Claude Code

claude mcp add llng-mcp -- npx llng-mcp

Or add to Claude Desktop (~/.claude/desktop_config.json):

{
  "mcpServers": {
    "llng": {
      "command": "npx",
      "args": ["llng-mcp"]
    }
  }
}

2. Configure your SSO instances

Create ~/.llng-mcp.json:

{
  "instances": {
    "prod": {
      "mode": "ssh",
      "ssh": { "host": "sso.example.com", "user": "root" }
    },
    "staging": {
      "mode": "ssh",
      "ssh": { "host": "sso-staging.example.com", "user": "root" }
    }
  },
  "default": "prod"
}

All tools accept an optional instance parameter to target a specific instance. See Configuration below for SSH, API, Kubernetes, and Docker modes.

3. Start using

Just ask Claude in natural language:

  • "Show me the current SSO configuration"
  • "How many active sessions are there?"
  • "List all OIDC relying parties"
  • "Add a new OIDC RP for my-app with redirect URI https://my-app.example.com/callback"
  • "Delete all sessions for user jdoe"
  • "What 2FA devices does user alice have?"
  • "Rotate the OIDC signing keys"
  • "Export the full configuration as backup"

What You Can Do

CapabilityDescription
ConfigurationRead, update, export, import, merge, and rollback SSO configuration. Test email settings.
SessionsSearch, inspect, modify, and delete user sessions. Backup all sessions. Manage offline/refresh tokens.
OIDC Relying PartiesEnable the OIDC issuer, list/add/update/delete relying parties with sensible defaults.
OIDC TestingFull OIDC flow testing: discovery, authorization with PKCE, token exchange, userinfo, introspection.
SAML FederationDownload IdP metadata, import SAML federations.
Two-Factor AuthList and manage users' 2FA devices (TOTP, U2F, WebAuthn).
User ConsentsList and revoke OIDC consents per user.
User DirectoryLook up user attributes from the configured backend.
Cache & MaintenancePurge central and local caches, rotate OIDC keys, delete sessions by UID pattern.
Multi-InstanceManage multiple SSO instances (prod, staging, dev) from a single server.
DocumentationSemantic search across LemonLDAP::NG documentation (requires Ollama).

Installation

Requires Node.js 20 or higher.

npm install llng-mcp
npm run build

Configuration

The MCP server reads configuration from ~/.llng-mcp.json with support for environment variable overrides. Two operation modes are available.

SSH/CLI Mode (Default)

Execute commands via SSH or locally using Lemonldap-NG CLI tools.

{
  "mode": "ssh",
  "ssh": {
    "binPrefix": "/usr/share/lemonldap-ng/bin"
  }
}

For remote SSH connections:

{
  "mode": "ssh",
  "ssh": {
    "host": "llng.example.com",
    "user": "root",
    "port": 22,
    "sudo": "root",
    "binPrefix": "/usr/share/lemonldap-ng/bin"
  }
}

remoteCommand - Execute via Docker, LXC, etc.

The remoteCommand field inserts a command between SSH/sudo and the LLNG CLI binary. This allows running commands inside containers or through other wrappers:

{
  "mode": "ssh",
  "ssh": {
    "host": "server.example.com",
    "remoteCommand": "docker exec sso-auth-1",
    "binPrefix": "/usr/share/lemonldap-ng/bin"
  }
}

This produces: ssh server.example.com docker exec sso-auth-1 /usr/share/lemonldap-ng/bin/lemonldap-ng-cli ...

binPrefix - Custom binary location

The binPrefix field (default: /usr/share/lemonldap-ng/bin) sets the base directory for all LLNG CLI tools. Individual paths (cliPath, sessionsPath, configEditorPath) can still override specific binaries.

SSH Mode Limitations: The following operations require API mode:

  • llng_2fa_list - List 2FA devices
  • llng_2fa_delete - Remove 2FA devices
  • llng_2fa_delType - Remove all devices of type
  • llng_consent_list - List user consents
  • llng_consent_delete - Revoke consents

API Mode

Call REST endpoints on LLNG manager with optional HTTP Basic authentication.

{
  "mode": "api",
  "api": {
    "baseUrl": "https://manager.example.com/api/v1",
    "basicAuth": {
      "username": "admin",
      "password": "secret"
    },
    "verifySsl": true
  }
}

Kubernetes Mode

Execute commands inside Kubernetes pods using kubectl exec. The server automatically resolves a pod from a Deployment using label selectors.

{
  "mode": "k8s",
  "k8s": {
    "context": "prod-cluster",
    "namespace": "auth",
    "deployment": "lemonldap-ng",
    "container": "sso"
  }
}
  • context (optional) - kubectl context to use
  • namespace (required) - Kubernetes namespace
  • deployment (required) - Deployment name (used to derive the default pod selector app.kubernetes.io/name=DEPLOYMENT)
  • container (optional) - Container name within the pod (omit if single container)
  • podSelector (optional) - Override the label selector for pod resolution (default: app.kubernetes.io/name=DEPLOYMENT)
  • binPrefix (optional) - Path to LLNG binaries inside the pod (default: /usr/share/lemonldap-ng/bin)

K8s mode has the same limitations as SSH mode (2FA and consents require API mode).

OIDC Configuration (Optional)

For OIDC testing tools:

{
  "oidc": {
    "issuer": "https://auth.example.com",
    "clientId": "my-app",
    "clientSecret": "secret",
    "redirectUri": "http://localhost:8080/callback",
    "scope": "openid profile email"
  }
}

Multi-Instance Configuration

To manage multiple LLNG instances from a single MCP server, use the instances format:

{
  "instances": {
    "prod": {
      "mode": "api",
      "api": {
        "baseUrl": "https://manager-prod.example.com/api/v1",
        "basicAuth": { "username": "admin", "password": "secret" }
      }
    },
    "staging": {
      "mode": "ssh",
      "ssh": {
        "host": "staging.example.com",
        "user": "root"
      }
    },
    "local": {
      "mode": "ssh"
    }
  },
  "default": "prod"
}
  • instances - Named LLNG instance configurations, each with its own mode, ssh, api, and oidc settings
  • default - Name of the instance used when the instance parameter is omitted (defaults to the first instance if not specified)
  • All tools accept an optional instance parameter to target a specific instance
  • The legacy flat format (without instances) is fully supported and treated as a single "default" instance
  • Environment variables (LLNG_*) apply to the default instance only

Environment Variables

Configuration can be overridden via environment variables:

Mode

  • LLNG_MODE - Set to "ssh" or "api"

SSH Configuration

  • LLNG_SSH_HOST - Hostname for SSH connection
  • LLNG_SSH_USER - SSH username
  • LLNG_SSH_PORT - SSH port (default: 22)
  • LLNG_SSH_SUDO - User to sudo to
  • LLNG_SSH_REMOTE_COMMAND - Command inserted between SSH/sudo and LLNG binaries (e.g., docker exec container-name)
  • LLNG_SSH_BIN_PREFIX - Base directory for LLNG CLI tools (default: /usr/share/lemonldap-ng/bin)
  • LLNG_SSH_CLI_PATH - Path to lemonldap-ng-cli (overrides binPrefix)
  • LLNG_SSH_SESSIONS_PATH - Path to lemonldap-ng-sessions (overrides binPrefix)
  • LLNG_SSH_CONFIG_EDITOR_PATH - Path to lmConfigEditor (overrides binPrefix)

Kubernetes Configuration

  • LLNG_K8S_CONTEXT - kubectl context
  • LLNG_K8S_NAMESPACE - Kubernetes namespace
  • LLNG_K8S_DEPLOYMENT - Deployment name
  • LLNG_K8S_CONTAINER - Container name (optional)
  • LLNG_K8S_POD_SELECTOR - Label selector override
  • LLNG_K8S_BIN_PREFIX - Path to LLNG binaries inside the pod

API Configuration

  • LLNG_API_URL - API base URL
  • LLNG_API_BASIC_USER - HTTP Basic Auth username
  • LLNG_API_BASIC_PASSWORD - HTTP Basic Auth password
  • LLNG_API_VERIFY_SSL - Set to "false" to skip SSL verification

OIDC Configuration

  • LLNG_OIDC_ISSUER - OIDC issuer URL
  • LLNG_OIDC_CLIENT_ID - OIDC client ID
  • LLNG_OIDC_CLIENT_SECRET - OIDC client secret
  • LLNG_OIDC_REDIRECT_URI - OIDC redirect URI
  • LLNG_OIDC_SCOPE - OIDC scopes

Note: When using multi-instance configuration, environment variables override the default instance only.

Usage with Claude Desktop

Add this to your Claude Desktop configuration (~/.claude/desktop_config.json):

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

If you have configuration in ~/.llng-mcp.json, it will be automatically loaded. You can also override via environment variables:

{
  "mcpServers": {
    "llng": {
      "command": "node",
      "args": ["/path/to/llng-mcp/dist/index.js"],
      "env": {
        "LLNG_MODE": "api",
        "LLNG_API_URL": "https://manager.example.com/api/v1"
      }
    }
  }
}

Usage with Other MCP Clients

Inspect Tool with npx

Test the server using the official MCP inspector:

npx @modelcontextprotocol/inspector node dist/index.js

This opens an interactive inspector where you can call tools and see results.

Configuration

Configure your MCP client to connect to the stdio server. For example, with cline:

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

Tools Reference

Note: All tools accept an optional instance parameter (string) to target a specific LLNG instance. When omitted, the default instance is used.

Configuration Management

ToolDescriptionParametersMode
llng_config_infoGet config metadataNoneBoth
llng_config_getFetch config valueskeys (string[])Both
llng_config_setUpdate config valueskeys (object), log (string)Both
llng_config_addKeyAdd composite keykey, subkey, valueBoth
llng_config_delKeyDelete composite keykey, subkeyBoth
llng_config_exportExport as JSONNoneBoth
llng_config_importImport from JSONjson (string)Both
llng_config_mergeMerge JSONjson (string)Both
llng_config_rollbackRevert previousNoneBoth
llng_config_update_cacheForce cache refreshNoneBoth
llng_config_test_emailSend test emaildestination (string)SSH/K8s

Session Management

ToolDescriptionParametersMode
llng_session_getGet sessionid, backend, persistent, hash, refreshTokensBoth
llng_session_searchSearch sessionswhere, select, backend, count, kind, persistent, hash, idOnly, refreshTokensBoth
llng_session_deleteDelete sessionsids (optional), where, kind, backend, persistent, hash, refreshTokensBoth
llng_session_setKeyModify sessionid, keys, backend, persistent, hash, refreshTokensBoth
llng_session_delKeyRemove attributesid, keys, backend, persistent, hash, refreshTokensBoth
llng_session_backupExport sessionsbackend, persistent, refreshTokensBoth

Two-Factor Authentication

ToolDescriptionParametersMode
llng_2fa_listList devicesuser (string)API Only
llng_2fa_deleteRemove devicesuser, ids (string[])API Only
llng_2fa_delTypeRemove by typeuser, type (string)API Only

User Consents

ToolDescriptionParametersMode
llng_consent_listList consentsuser (string)API Only
llng_consent_deleteRevoke consentsuser, ids (string[])API Only

Instance Discovery

ToolDescriptionParametersMode
llng_instancesList available instancesNoneBoth

OIDC Relying Party Management

ToolDescriptionParametersMode
llng_oidc_issuer_enableEnable OIDC issuerforce (optional bool)Both
llng_oidc_rp_listList OIDC RPsNoneBoth
llng_oidc_rp_getGet RP detailsconfKeyBoth
llng_oidc_rp_addAdd new RPconfKey, clientId, redirectUris, clientSecret, displayName, exportedVars, extraClaims, optionsBoth
llng_oidc_rp_deleteDelete RPconfKeyBoth

CLI Utilities

ToolDescriptionParametersMode
llng_download_saml_metadataDownload SAML metadataurl, outputFile, noCheck, verboseSSH/K8s
llng_import_metadataImport SAML federationurl, spPrefix, idpPrefix, ignoreSp, ignoreIdp, remove, noCheck, verboseSSH/K8s
llng_delete_sessionDelete sessions by UIDuid, force, debugSSH/K8s
llng_user_attributesLook up user attributesusername, fieldSSH/K8s
llng_purge_central_cachePurge central cachedebug, force, jsonSSH/K8s
llng_purge_local_cachePurge local cachedebugSSH/K8s
llng_rotate_oidc_keysRotate OIDC signing keysdebugSSH/K8s

OIDC Testing

ToolDescriptionParametersRequires Config
llng_oidc_metadataFetch discoveryNoneOIDC config
llng_oidc_authorizeGet auth URLscope (optional)OIDC config
llng_oidc_tokensExchange codecode, code_verifierOIDC config
llng_oidc_userinfoGet user infoaccess_token (string)OIDC config
llng_oidc_introspectInspect tokentoken (string)OIDC config
llng_oidc_refreshRefresh tokenrefresh_token (string)OIDC config
llng_oidc_whoamiDecode ID tokenid_token (string)OIDC config
llng_oidc_check_authTest protectedurl, access_tokenOIDC config

Documentation

ToolDescriptionParametersRequires
llng_doc_searchSemantic search in LLNG docsquery (string), limit (int)Ollama

Development

Build

npm run build

Watch Mode

npm run dev

Unit Tests

npm test

Integration Tests

Requires Docker Compose for running Lemonldap-NG instance:

npm run test:integration

The test stack includes a full Lemonldap-NG instance accessible at http://localhost:19876.

View test configuration in docker-compose.test.yml.

Architecture

llng-mcp uses an abstraction layer (ILlngTransport) with two implementations:

  • SshTransport - Executes CLI commands via SSH or locally using child_process
  • K8sTransport - Executes CLI commands inside Kubernetes pods via kubectl exec
  • ApiTransport - Makes HTTP requests to LLNG REST API

A TransportRegistry manages transport instances per named configuration, enabling multi-instance support. All tools resolve their transport through the registry, allowing seamless switching between modes and instances.

A bundled Brotli-compressed documentation index (data/index.json.br) enables semantic search via Ollama embeddings without requiring the original RST sources.

Limitations

SSH Mode

2FA management and user consent operations require the REST API. The CLI tools (lemonldap-ng-cli and lemonldap-ng-sessions) provide read-only or delete-only capabilities for these features.

API Mode

Ensure the LLNG manager is properly configured with REST endpoints enabled and authentication credentials provided.

OIDC Tools

OIDC testing tools are optional. Omit OIDC configuration if not needed.

  • llng-assistant — Interactive CLI assistant for LLNG powered by a local LLM (Ollama). Uses llng-mcp to manage multiple instances via natural language.
  • LemonLDAP::NG — The web SSO and access management platform.

License

AGPL-3.0

Copyright: 2026 LINAGORA

FAQs

Package last updated on 30 Mar 2026

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