Skip to main content

MCP server for the Nerve Sparks authentication API

Project description

nsai-auth

MCP server generated from API documentation

Generated by MCP Server Generator (simple style).

Installation

Prerequisites

  • Python 3.10+

Run with uvx (no install)

Once published to PyPI, the server can be launched directly:

uvx nsai-auth

Pass env via your shell or your MCP client config (see below).

Install from PyPI

pip install nsai-auth
nsai-auth                 # console script
python -m nsai_auth       # equivalent

Local development

pip install -e ".[dev]"
cp .env.example .env      # set BASE_URL and API_KEY
nsai-auth                 # or: python -m nsai_auth

The server uses stdio transport (no HTTP). Connect your MCP client to this process.

Connecting to MCP Clients

Claude Desktop / Cursor / any MCP client (recommended: uvx)

Add to your MCP config (e.g. claude_desktop_config.json or Cursor's MCP settings):

{
  "mcpServers": {
    "nsai-auth": {
      "command": "uvx",
      "args": ["nsai-auth"],
      "env": {
        "BASE_URL": "https://auth.nervesparks.com",
        "API_KEY": "Bearer your_token_here"
      }
    }
  }
}

A ready-to-edit copy of this config lives at mcp.json.

Windows: make sure uvx is on PATH (install via pipx install uv or winget install astral-sh.uv). On first launch uvx downloads the package; subsequent launches are cached.

Alternative: pinned version

{
  "mcpServers": {
    "nsai-auth": {
      "command": "uvx",
      "args": ["nsai-auth==0.1.0"],
      "env": { "BASE_URL": "...", "API_KEY": "..." }
    }
  }
}

Alternative: installed console script

{
  "mcpServers": {
    "nsai-auth": {
      "command": "nsai-auth",
      "env": { "BASE_URL": "...", "API_KEY": "..." }
    }
  }
}

Alternative: local development checkout

{
  "mcpServers": {
    "nsai-auth": {
      "command": "uv",
      "args": ["--directory", "C:\\path\\to\\nsai_auth", "run", "python", "-m", "nsai_auth"]
    }
  }
}

Configuration

Set in .env:

  • BASE_URL – Base URL of your API (e.g. https://api.example.com)
  • API_KEY – API token (sent as ?token=...)

Authentication & API Key Setup

This server connects to the Nerve Sparks API and requires a Bearer Token.

  1. Obtain your Bearer Token by signing up or logging into the Nerve Sparks platform.
  2. The Bearer Token is typically found in your account settings or developer dashboard.
  3. Ensure your token has the necessary permissions to access user authentication and management features.
  4. Add it to your .env file:
BASE_URL=https://auth.nervesparks.com
AUTH_TOKEN=Bearer xxxxxxxxxxxxxxxxxxxx

⚠️ Never commit your .env file to version control. Add .env to your .gitignore.


Available Tools

register_user

Registers a new user.

Parameter Type Required Description
email string Yes The email address of the user.
password string Yes The password for the user.
display_name string Yes The display name for the user.
tenant_id string Yes The ID of the tenant.

login_user

Logs in a user.

Parameter Type Required Description
email string Yes The email address of the user.
password string Yes The password for the user.
tenant_id string Yes The ID of the tenant.

refresh_token

Refreshes the access token.

Parameter Type Required Description
refresh_token string Yes The refresh token to be used.

logout_user

Logs out a user.

Parameter Type Required Description
refresh_token string Yes The refresh token to log out.

get_current_user

Retrieves the current user's information.

Parameter Type Required Description
This tool takes no parameters.

forgot_password

Initiates a password reset.

Parameter Type Required Description
email string Yes The email address of the user.
tenant_id string Yes The ID of the tenant.

get_user_claims

Retrieves claims for a specific user.

Parameter Type Required Description
uid string Yes The unique ID of the user.
tenant_id string Yes The ID of the tenant.

update_user_claims

Updates claims for a user identified by email.

Parameter Type Required Description
email string Yes The email address of the user.
tenant_id string Yes The ID of the tenant.
role string Yes The role to be assigned.

whitelist_api_key

Creates a partner API key.

Parameter Type Required Description
name string Yes The name for the API key.
expires_in_days integer Yes The number of days until expiration.

verify_partner_token

Verifies a whitelist API key.

Parameter Type Required Description
This tool takes no parameters.

Publishing to PyPI (for maintainers)

  1. Bump version in pyproject.toml and nsai_auth/__init__.py.

  2. Clean and build:

    rm -rf dist build *.egg-info
    uv build           # or: python -m build
    
  3. Sanity-check the wheel runs as uvx:

    uvx --from ./dist/nsai_auth-0.1.0-py3-none-any.whl nsai-auth
    
  4. Upload (test first, then prod):

    twine upload --repository testpypi dist/*
    uvx --index-url https://test.pypi.org/simple/ nsai-auth   # smoke test
    twine upload dist/*
    
  5. After release, anyone can run:

    uvx nsai-auth
    

Make sure your PyPI token is configured in ~/.pypirc or via TWINE_USERNAME=__token__ / TWINE_PASSWORD=pypi-....


Generated by MCP Server Generator

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nsai_auth-0.1.1.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nsai_auth-0.1.1-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file nsai_auth-0.1.1.tar.gz.

File metadata

  • Download URL: nsai_auth-0.1.1.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for nsai_auth-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c4d90724fc7b8e6ef4730a70314e2276fd1218a03542cce19b0d37bd416b43df
MD5 b2c8d4e5aab8f8bcaae2cb3f7ff25580
BLAKE2b-256 8196edf90aadaa2a1ba3f55be481fd7b28ce90d83dbe34f207e64252643bb7a8

See more details on using hashes here.

File details

Details for the file nsai_auth-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: nsai_auth-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for nsai_auth-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 297201867db9be64fb46fe4b73b2942ce089e4aec0c15710cc8ade775ea9f1a0
MD5 8bc599363055982fa8f82e10a5b2c198
BLAKE2b-256 124fa8ebfceb193ee755510d258efdc4975c929d1913eab88001402b3d8a4c1d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page