mcp

v1.3.0
@emotionlogic/mcp Checked 3 hours ago Published 7 days ago

Official EmotionLogic MCP server for AppTone and FeelGPT

@emotionlogic/mcp Official Model Context Protocol server for the EmotionLogic API. It exposes AppTone and FeelGPT operations to MCP clients such as Cursor and Claude Desktop. Package version 1.2.0 documents the live callback contract, bounds HTTP and file access, and sanitizes provider errors. It does not add HMAC callback signatures; those remain a future gateway change. Get API credentials The server authenticates with HTTP Basic Auth. Use an API username and password from EmotionLogic Hub — not the email of your Hub login. 1. Create an EmotionLogic Hub account at app.emotionlogic.ai. 2.

Summary extracted from the README.

@emotionlogic/mcp

Official Model Context Protocol server for the EmotionLogic API. It exposes AppTone and FeelGPT operations to MCP clients such as Cursor and Claude Desktop.

Package version 1.2.0 documents the live callback contract, bounds HTTP and file access, and sanitizes provider errors. It does not add HMAC callback signatures; those remain a future gateway change.

Get API credentials

The server authenticates with HTTP Basic Auth. Use an API username and password from EmotionLogic Hub — not the email of your Hub login.

  1. Create an EmotionLogic Hub account at app.emotionlogic.ai.
  2. Sign in and open Analyze Now API Keys.
  3. Create an API user: give it a name and set a password.
  4. Copy the generated username (a UUID) and the password you set.
  5. Set them as EMOTIONLOGIC_API_USERNAME and EMOTIONLOGIC_API_PASSWORD.

The API user needs apptone_read for AppTone tools and feelgpt_app_usage for FeelGPT tools. Dedicated sandbox credentials are issued through an approved secret mechanism, not chat.

An API user belongs to one Hub organization. Report IDs resolve in that organization. They are correlation values, not a cross-tenant capability token.

Install

npm install -g @emotionlogic/mcp

Or run without a global install:

npx @emotionlogic/mcp

After install, verify the published artifact:

npm test
npm run check

Configuration

Variable Required Description
EMOTIONLOGIC_API_USERNAME Yes API username from EmotionLogic Hub
EMOTIONLOGIC_API_PASSWORD Yes API user password
EMOTIONLOGIC_API_BASE_URL No Defaults to https://api.emotionlogic.ai/apigateway-service. Must be HTTPS. HTTP is allowed only for loopback when EMOTIONLOGIC_ALLOW_INSECURE_HTTP=true. URLs must not contain credentials.
EMOTIONLOGIC_ALLOW_INSECURE_HTTP No Set to true to allow http://127.0.0.1 or http://localhost for tests. Never enable this in production.
EMOTIONLOGIC_REQUEST_TIMEOUT_MS No HTTP timeout in milliseconds. Default 30000. This bounds the API request, not long-running analysis after reportId is returned.
EMOTIONLOGIC_MAX_RESPONSE_BYTES No Maximum response size. Default 8388608 (8 MiB).
EMOTIONLOGIC_MAX_UPLOAD_BYTES No Maximum FeelGPT media file size. Default 67108864 (64 MiB).
EMOTIONLOGIC_MAX_CONCURRENT_REQUESTS No In-flight HTTP requests per process. Default 1.
EMOTIONLOGIC_ALLOWED_MEDIA_ROOTS No path.delimiter-separated absolute directories. When set, feelgpt_analyze resolves symlinks with realpath and rejects files outside these roots.

The HTTP client does not follow redirects, does not inherit an environment proxy, and does not retry side-effecting calls.

Cursor

Add the server to .cursor/mcp.json:

{
  "mcpServers": {
    "emotionlogic": {
      "command": "npx",
      "args": ["-y", "@emotionlogic/mcp"],
      "env": {
        "EMOTIONLOGIC_API_USERNAME": "your-api-username",
        "EMOTIONLOGIC_API_PASSWORD": "your-api-password"
      }
    }
  }
}

Claude Desktop

{
  "mcpServers": {
    "emotionlogic": {
      "command": "npx",
      "args": ["-y", "@emotionlogic/mcp"],
      "env": {
        "EMOTIONLOGIC_API_USERNAME": "your-api-username",
        "EMOTIONLOGIC_API_PASSWORD": "your-api-password"
      }
    }
  }
}

Local files vs hosted applications

feelgpt_analyze accepts a filePath because a local MCP client may select a file on disk. That is a local-process trust boundary, not tenant isolation.

Hosted or multi-tenant applications must:

  • authorize the media asset on the server
  • copy it into a private temporary file under EMOTIONLOGIC_ALLOWED_MEDIA_ROOTS
  • bound the copy size and delete it after the tool returns
  • never expose filePath on a browser route or to an unattended agent

If EMOTIONLOGIC_ALLOWED_MEDIA_ROOTS is unset, any regular file the process can read may be uploaded.

Callbacks

sendToCustomer, analyze, downloadPdf, and downloadAudio deliver results to statusCallbackUrl or statusCallbackEmail.

The live service posts JSON with User-Agent: Webhook-Service/1.0:

{
  "requestId": "gateway-request-id",
  "application": "apptone",
  "eventDate": "2026-09-15T09:00:00.000Z",
  "identifier": "optional-caller-id",
  "encrypted": false,
  "payload": {}
}

When encryptionKey is set, encrypted is true and payload is AES-256-ECB hex ciphertext. The key is UTF-8 padded or truncated to 32 bytes. There is no IV and no authentication tag.

There is no HMAC or signature header. Encryption is confidentiality of the payload, not proof of the sender. Authenticity today is TLS plus secrecy of the callback URL. Production callbacks must be HTTPS. Persist requestId and eventDate before returning HTTP 200 so duplicates are ignored.

A sample receiver is in examples/callback-receiver.js. Independent tamper or replay tests against a service signature cannot pass until the gateway adds one.

Idempotency and unknown outcomes

There is no idempotency key and no bulk-send endpoint. Each sendToCustomer call creates a new reportId. customerRequestId is a correlation string, not a duplicate-send or billing guard.

If a send, analyze, cancel, or download call times out or is canceled before an HTTP response, the MCP server returns code: "unknown_outcome" with retryable: false. Do not send another invitation. Reconcile with the reportId you already have, or with apptone_get_analysis_result.

sendToCustomer is phone-based. Use E.164 numbers such as +15551234567. Do not pass email addresses.

Tools

AppTone

  • apptone_list_questionnaires
  • apptone_send_to_customer
  • apptone_get_analysis_result
  • apptone_cancel_report
  • apptone_download_pdf
  • apptone_download_audio

FeelGPT

  • feelgpt_list_advisors
  • feelgpt_analyze

Documentation

  • emotionlogic_get_api_reference — OpenAPI contract or a single operation. No credentials required.

The server also exposes the OpenAPI document as the resource emotionlogic://api/openapi.json.

MCP annotations (readOnlyHint, destructiveHint, idempotentHint, openWorldHint) describe side effects to clients. They are not authorization controls. Keep application confirmation in front of send, cancel, and upload.

Errors

Tool failures return a bounded JSON object:

{
  "error": "EmotionLogic API request failed with HTTP 500.",
  "code": "http_error",
  "retryable": false,
  "status": 500
}

Codes: unknown_outcome, timeout, canceled, http_error, validation_error, config_error. Upstream response bodies, URLs, and filesystem paths are not included.