Skip to main content
Glama
Logto MCP Server

Logto MCP Server

by kdunin

Logto MCP Server

A Model Context Protocol server that exposes the Logto Management API to MCP clients (Cursor, Claude Desktop, etc.).

Built with:

Prerequisites

  1. A Logto instance (self-hosted OSS or Cloud)

  2. A Machine-to-machine application in Console → Applications

  3. An M2M role that includes Logto Management API permissions (all)

See Interact with Management API for details.

Related MCP server: openserverless-mcp

Setup

npm install
npm run build

Environment variables

Variable

Required

Description

LOGTO_APP_ID / LOGTO_CLIENT_ID

Yes

M2M application ID

LOGTO_APP_SECRET / LOGTO_CLIENT_SECRET

Yes

M2M application secret

LOGTO_ENDPOINT / LOGTO_BASE_URL

OSS

Self-hosted Logto base URL

LOGTO_TENANT_ID

Cloud

Cloud tenant ID (OSS defaults to default)

LOGTO_API_INDICATOR

No

OSS default: https://default.logto.app/api

Copy .env.example as a reference. For MCP clients, pass variables in the env block (below).

Self-hosted / OSS

LOGTO_ENDPOINT=https://your.logto.endpoint
LOGTO_APP_ID=...
LOGTO_APP_SECRET=...
# Optional: LOGTO_TENANT_ID=default
# Optional: LOGTO_API_INDICATOR=https://default.logto.app/api

Logto Cloud

LOGTO_TENANT_ID=your-tenant-id
LOGTO_APP_ID=...
LOGTO_APP_SECRET=...

Cursor / Claude Desktop / MetaMCP config

Local build:

{
  "mcpServers": {
    "logto": {
      "command": "node",
      "args": ["C:/Users/rascal/projects/logto-mcp/build/index.js"],
      "env": {
        "LOGTO_ENDPOINT": "https://your.logto.endpoint",
        "LOGTO_APP_ID": "your-m2m-app-id",
        "LOGTO_APP_SECRET": "your-m2m-app-secret"
      }
    }
  }
}

From GitHub repo (no package registry auth):

{
  "mcpServers": {
    "logto": {
      "command": "npx",
      "args": ["-y", "github:KDunin/logto-mcp"],
      "env": {
        "LOGTO_ENDPOINT": "https://your.logto.endpoint",
        "LOGTO_APP_ID": "your-m2m-app-id",
        "LOGTO_APP_SECRET": "your-m2m-app-secret"
      }
    }
  }
}

From GitHub Packages (after a release is published):

# once in ~/.npmrc (needs a PAT with read:packages)
echo "@kdunin:registry=https://npm.pkg.github.com" >> ~/.npmrc
echo "//npm.pkg.github.com/:_authToken=YOUR_GH_PAT" >> ~/.npmrc
{
  "mcpServers": {
    "logto": {
      "command": "npx",
      "args": ["-y", "@kdunin/logto-mcp"],
      "env": {
        "LOGTO_ENDPOINT": "https://your.logto.endpoint",
        "LOGTO_APP_ID": "your-m2m-app-id",
        "LOGTO_APP_SECRET": "your-m2m-app-secret"
      }
    }
  }
}

Use an absolute path to build/index.js for local runs. After changing env or rebuilding, restart the MCP client.

Tools

Tool

Description

logto_health

Verify M2M credentials

list_users / get_user / create_user / update_user / delete_user

Users

list_applications / get_application / create_application / update_application / delete_application

Applications (update_application also sets refresh/ID token settings)

list_organizations / get_organization / create_organization / update_organization / delete_organization

Organizations

list_organization_members / add_organization_members / remove_organization_member

Organization members

list_roles / get_role / create_role / update_role / delete_role

Roles

list_user_roles / assign_user_roles

User ↔ role assignment

list_resources / get_resource / create_resource / update_resource / delete_resource

API resources

list_resource_scopes / create_resource_scope / delete_resource_scope

API resource permissions

assign_role_scopes

Role ↔ permission assignment

Development

npm run build   # compile TypeScript to build/
npm start       # run stdio server (expects MCP client on stdin)
npm run dev     # tsc --watch

Logging goes to stderr only so stdout stays reserved for MCP JSON-RPC.

Releasing

Releases are automated by .github/workflows/release.yml when you push a version tag.

  1. Bump version in package.json (must match the tag without the v prefix).

  2. Commit, then tag and push:

git tag v1.0.1
git push origin v1.0.1

The workflow will:

  • Build the package

  • Create a GitHub Release with notes and the .tgz artifact

  • Publish to GitHub Packages as @kdunin/logto-mcp (stable tags only; uses GITHUB_TOKEN, no npmjs login)

ENEEDAUTH against registry.npmjs.org means you were targeting the public npm registry. This project publishes to https://npm.pkg.github.com instead.

Prerelease tags like v1.0.1-beta.1 create a GitHub prerelease and skip package publish.

License

MIT

Available Tools

35 tools
add_organization_membersC

Add users as members of a Logto organization.

Inputs: id (required), userIds (required).

assign_role_scopesB

Add API resource permissions (scopes) to an existing role.

Inputs: id (required), scopeIds (required).

assign_user_rolesB

Assign API resource roles to a user (adds to existing roles).

Inputs: userId (required), roleIds (required).

create_applicationC

Create a Logto application.

Inputs: name (required), type (required), description, isThirdParty, +2 more.

create_organizationC

Create a Logto organization.

Inputs: name (required), customData, description, isMfaRequired.

create_resourceB

Create a Logto API resource. The indicator is the audience (aud) of its access tokens.

Inputs: name (required), indicator (required), accessTokenTtl.

create_resource_scopeC

Create a permission (scope) on a Logto API resource.

Inputs: name (required), resourceId (required), description.

create_roleC

Create a Logto API resource role.

Inputs: name (required), description (required), type, scopeIds, +1 more.

create_userB

Create a Logto user. At least one of username, primaryEmail, or primaryPhone is typically required.

Inputs: name, avatar, password, username, +3 more.

delete_applicationC

Delete a Logto application by ID.

Inputs: id (required).

delete_organizationC

Delete a Logto organization by ID.

Inputs: id (required).

delete_resourceB

Delete a Logto API resource by ID, with its permissions.

Inputs: id (required).

delete_resource_scopeC

Delete a permission (scope) from a Logto API resource.

Inputs: scopeId (required), resourceId (required).

delete_roleC

Delete a Logto role by ID.

Inputs: id (required).

delete_userC

Delete a Logto user by ID.

Inputs: userId (required).

get_applicationB

Get a Logto application by ID.

Inputs: id (required).

get_organizationC

Get a Logto organization by ID.

Inputs: id (required).

get_resourceC

Get a Logto API resource by ID.

Inputs: id (required).

get_roleC

Get a Logto role by ID.

Inputs: id (required).

get_userA

Get a Logto user by ID.

Inputs: userId (required).

list_applicationsB

List Logto applications with optional type filter and pagination.

Inputs: page, types, search, page_size.

list_organization_membersC

List user members of a Logto organization.

Inputs: id (required), page, page_size.

list_organizationsB

List Logto organizations with optional query and pagination.

Inputs: q, page, page_size, showFeatured.

list_resourcesC

List Logto API resources with optional pagination.

Inputs: page, page_size.

list_resource_scopesC

List the permissions (scopes) of a Logto API resource.

Inputs: resourceId (required), page, search, page_size.

list_rolesC

List Logto API resource roles with optional filters and pagination.

Inputs: page, type, search, page_size.

list_user_rolesC

List API resource roles assigned to a user.

Inputs: userId (required), page, page_size.

list_usersB

List Logto users with optional search and pagination. Search uses Logto advanced user search query syntax.

Inputs: page, search, page_size.

logto_healthA

Verify Logto Management API credentials by listing one user page.

Inputs: no named parameters.

remove_organization_memberC

Remove a user from a Logto organization.

Inputs: id (required), userId (required).

update_applicationC

Update a Logto application by ID (partial update). Token settings are merged into the current custom client metadata.

Inputs: id (required), name, idTokenTtl, description, +7 more.

update_organizationC

Update a Logto organization by ID (partial update).

Inputs: id (required), name, customData, description, +1 more.

update_resourceA

Update a Logto API resource by ID (partial update). The indicator cannot be changed.

Inputs: id (required), name, accessTokenTtl.

update_roleC

Update a Logto role by ID (partial update).

Inputs: id (required), name, isDefault, description.

update_userC

Update a Logto user by ID (partial update).

Inputs: userId (required), name, avatar, username, +3 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.9/5.0

    Scored across 35 tools

    Disambiguation4/5

    Most tools are clearly scoped to a distinct resource and action, such as user, organization, role, resource, and application CRUD. The main ambiguity is in the role/scope cluster: list_roles vs. list_user_roles vs. list_resource_scopes, and assign_user_roles vs. assign_role_scopes can require careful reading, though the descriptions do distinguish them.

    Naming Consistency4/5

    The set overwhelmingly follows a snake_case verb_noun pattern (list_users, create_role, delete_resource_scope, etc.), which is easy to predict. Minor deviations include logto_health, the inconsistent add vs. assign verbs for membership/role assignment, and singular remove_organization_member amidst plural member tools.

    Tool Count2/5

    At 35 tools, the surface is large and exceeds the typical heavy range, even for a multi-resource management API. Several operations could likely be consolidated or grouped more tightly, making the set feel sprawling rather than well-scoped.

    Completeness3/5

    Core CRUD is covered for users, organizations, roles, resources, and applications, and member management includes add/remove. However, there are notable lifecycle gaps: no unassign_user_roles, no remove_role_scopes/list_role_scopes, and no organization-role assignment management, which leaves common authorization workflows incomplete.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers