# Sentiment Analysis MCP - Emotion, Intent & Batch Analysis (`ntriqpro/sentiment-analysis-mcp`) Actor

Real MCP server for Claude Desktop. Analyze text sentiment with 6 emotion dimensions, classify intent with urgency, and batch process multiple texts. Local AI, zero API costs. Connect via Standby URL.

- **URL**: https://apify.com/ntriqpro/sentiment-analysis-mcp.md
- **Developed by:** [daehwan kim](https://apify.com/ntriqpro) (community)
- **Categories:** MCP servers, AI, Developer tools
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event + usage

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Sentiment Analysis MCP

Real MCP server for Claude Desktop. Analyze text sentiment with 6 emotion dimensions, classify intent with urgency, and batch process multiple texts. Local AI, zero API costs. Connect via Standby URL.

### Features

- **Sentiment Analysis**: Detect text sentiment (positive, negative, neutral) with confidence score and 6 emotion dimensions (joy, anger, sadness, fear, surprise, disgust)
- **Intent Classification**: Classify text intent with urgency level (inquiry, complaint, request, feedback, purchase, cancel, support, etc.)
- **Batch Processing**: Analyze sentiment for multiple texts at once with individual results plus overall summary
- **MCP Protocol**: Fully compatible with Claude Desktop via HTTP+SSE
- **Zero API Costs**: Uses local AI server (Qwen 3.5)
- **Pay-Per-Event**: Charged only for actual usage

### Prerequisites

- Node.js 18.0+
- Apify CLI: `npm install -g apify-cli`
- ntriq Local AI Server running at `https://ai.ntriq.co.kr` (or `NTRIQ_AI_URL` env var)

### Installation

```bash
## Install dependencies
npm install

## Run locally
npm start

## Deploy to Apify
apify push
````

### Tools

#### 1. analyze\_sentiment

Analyze text sentiment with confidence score and 6 emotion dimensions.

**Input:**

- `text` (string, required): Text to analyze
- `language` (string, optional): Text language code (default: en)
- `max_tokens` (number, optional): Max tokens for response (default: 100)

**Output:**

```json
{
  "sentiment": "positive",
  "confidence": 0.92,
  "emotions": {
    "joy": 0.85,
    "anger": 0.05,
    "sadness": 0.02,
    "fear": 0.01,
    "surprise": 0.04,
    "disgust": 0.03
  }
}
```

#### 2. classify\_intent

Classify text intent with urgency level.

**Input:**

- `text` (string, required): Text to classify
- `language` (string, optional): Text language code (default: en)
- `max_tokens` (number, optional): Max tokens for response (default: 100)

**Output:**

```json
{
  "primary_intent": "complaint",
  "urgency": "high",
  "sub_intents": ["service_issue", "billing_error"]
}
```

**Intent Categories:**

- inquiry (질문)
- complaint (불만)
- request (요청)
- feedback (피드백)
- purchase (구매)
- cancel (취소)
- support (지원)
- other (기타)

**Urgency Levels:**

- low
- medium
- high
- critical

#### 3. batch\_sentiment

Analyze sentiment for multiple texts at once.

**Input:**

- `texts` (array of strings, required): Array of texts to analyze
- `language` (string, optional): Language code for all texts (default: en)
- `max_tokens` (number, optional): Max tokens for response (default: 100)

**Output:**

```json
{
  "results": [
    {
      "text": "I love this product!",
      "sentiment": "positive",
      "confidence": 0.95,
      "emotions": {
        "joy": 0.9,
        "anger": 0.01,
        "sadness": 0.01,
        "fear": 0.01,
        "surprise": 0.05,
        "disgust": 0.02
      }
    },
    {
      "text": "This is terrible",
      "sentiment": "negative",
      "confidence": 0.88,
      "emotions": {
        "joy": 0.02,
        "anger": 0.7,
        "sadness": 0.15,
        "fear": 0.05,
        "surprise": 0.02,
        "disgust": 0.06
      }
    }
  ],
  "summary": {
    "total_texts": 2,
    "positive": 1,
    "neutral": 0,
    "negative": 1,
    "average_confidence": 0.915,
    "dominant_emotions": {
      "joy": 0.46,
      "anger": 0.355,
      "sadness": 0.08,
      "fear": 0.03,
      "surprise": 0.035,
      "disgust": 0.04
    }
  }
}
```

### Emotion Dimensions

| Emotion | Description |
|---------|-------------|
| **Joy** | Positive feelings, happiness, satisfaction |
| **Anger** | Frustration, irritation, displeasure |
| **Sadness** | Disappointment, unhappiness, dissatisfaction |
| **Fear** | Anxiety, worry, apprehension |
| **Surprise** | Unexpected reactions, novelty |
| **Disgust** | Aversion, distaste, repulsion |

### Claude Desktop Configuration

Add to your Claude Desktop config file (`~/.claude/profiles/{profile}/config.json`):

```json
{
  "mcpServers": {
    "sentiment-analysis": {
      "command": "npx",
      "args": ["run", "start"],
      "cwd": "/path/to/sentiment-analysis-mcp",
      "env": {
        "NTRIQ_AI_URL": "https://ai.ntriq.co.kr",
        "PORT": "5000"
      }
    }
  }
}
```

Or use Standby URL for cloud-deployed Actor:

```json
{
  "mcpServers": {
    "sentiment-analysis": {
      "url": "https://ntriqpro--sentiment-analysis-mcp.apify.actor/mcp?token={YOUR_APIFY_TOKEN}"
    }
  }
}
```

### Pricing

| Tool | Price | Notes |
|------|-------|-------|
| analyze\_sentiment | $0.05 | Per text analyzed |
| classify\_intent | $0.05 | Per text classified |
| batch\_sentiment | $0.15 | Per batch (multiple texts) |

Pricing follows Apify's Pay-Per-Event model. You're only charged for successful API calls.

### Example Usage

#### In Claude Desktop

```
I need to analyze the sentiment of these customer reviews:
1. "Absolutely love this product, exceeded all my expectations!"
2. "Terrible experience, worst purchase ever"
3. "It's okay, nothing special"

Use the batch_sentiment tool to analyze them and classify the intent of each.
```

#### Direct API Call

```bash
curl -X POST http://localhost:5000/mcp \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "analyze_sentiment",
      "arguments": {
        "text": "I absolutely love this!",
        "language": "en"
      }
    }
  }'
```

### Legal Disclaimer

**Analysis Notice**: This service provides AI-generated sentiment and intent analysis. Results are statistical estimates and should not be used as the sole basis for business decisions, employment actions, or legal proceedings. Accuracy may vary by language, context, and text length. Text is processed in real-time and is not stored, retained, or used for model training. This service does not constitute professional psychological, linguistic, or business analysis.

### Architecture

- **Base Model**: Qwen 3.5 (Apache 2.0 License)
- **AI Server**: ntriq Local AI (`https://ai.ntriq.co.kr`)
- **Protocol**: Model Context Protocol (MCP)
- **Transport**: HTTP + Server-Sent Events (SSE)
- **Deployment**: Apify Actor (Standby Mode)

### Environment Variables

| Variable | Default | Description |
|----------|---------|-------------|
| `NTRIQ_AI_URL` | https://ai.ntriq.co.kr | Base URL of sentiment analysis server |
| `PORT` | 5000 | Server port |

### License

Apache 2.0 (Qwen 3.5 Base Model)

### Support

For issues or questions, contact ntriq engineering team or check the Apify documentation.

***

Last Updated: 2026-03-28

# Actor input Schema

## Actor input object example

```json
{}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("ntriqpro/sentiment-analysis-mcp").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("ntriqpro/sentiment-analysis-mcp").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call ntriqpro/sentiment-analysis-mcp --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=ntriqpro/sentiment-analysis-mcp",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Sentiment Analysis MCP - Emotion, Intent & Batch Analysis",
        "description": "Real MCP server for Claude Desktop. Analyze text sentiment with 6 emotion dimensions, classify intent with urgency, and batch process multiple texts. Local AI, zero API costs. Connect via Standby URL.",
        "version": "1.0",
        "x-build-id": "K9YbEtdzp2okr6fkA"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/ntriqpro~sentiment-analysis-mcp/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-ntriqpro-sentiment-analysis-mcp",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/ntriqpro~sentiment-analysis-mcp/runs": {
            "post": {
                "operationId": "runs-sync-ntriqpro-sentiment-analysis-mcp",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/ntriqpro~sentiment-analysis-mcp/run-sync": {
            "post": {
                "operationId": "run-sync-ntriqpro-sentiment-analysis-mcp",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {}
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
