# MonkeyLearn MCP

> MonkeyLearn analyzes raw text data via custom machine learning models. It classifies sentiment (positive, negative, mixed), pulls structured entities like names, dates, and organizations, and executes multi-step NLP workflows on user feedback or support tickets.

## Overview
- **Category:** customer-support
- **Price:** Free
- **Tags:** text-classification, entity-extraction, sentiment-analysis, nlp, machine-learning, data-labeling

## Description

Yo, listen up. This server connects your agent straight to MonkeyLearn's deep text analysis engine. You don't just get simple tags; you run custom machine learning models on raw user feedback or support tickets. It handles serious Natural Language Processing (NLP) tasks right through conversation.

**Classify Text Sentiment & Topic:** To figure out the vibe of a chunk of text, you use `classify_text`, which classifies it by determining its sentiment, topic, or intent using your custom models. You can check what classification types are available by calling `list_classifiers`. If you wanna know more about any specific classifier model you're running, `get_classifier_details` gives you the whole rundown. Wanna see what tags are attached to those classifiers? Use `list_classifier_tags`.

**Pull Structured Entities:** Need names, dates, or company logos pulled out of a messy paragraph? You use `extract_text_entities`. This tool pulls structured data—like people's names, organizations, and addresses—and spits it back to you in JSON format. To see which types of entity pullers you got, run `list_extractors`. If you wanna check the specs on a specific extractor, `get_extractor_details` gives you the full usage guide. You can also peep available tags for extractors with `list_extractor_tags`.

**Execute Complex Workflows:** Don't want to call five different tools? Use `run_workflow`. This tool executes pre-defined, multi-step NLP pipelines—like first classifying a topic and then pulling all the names mentioned—all in one shot. You can see what complex processes you built up with `list_nlp_workflows`.

**System Management & Status:** Before you start running anything, you gotta make sure your connection's good. Use `get_api_status` to confirm your MonkeyLearn account connectivity is live. To keep track of how models perform, `list_model_versions` lets you check historical versions for any specific model, so you can test older settings if the new ones are giving you trouble. Need details on a specific text classification or entity extraction tool? You've already seen `get_classifier_details` and `get_extractor_details`. This stack gives you everything you need to analyze raw data.

## Tools

### classify_text
Classifies a given piece of text by determining its sentiment, topic, or intent against your custom models.

### extract_text_entities
Pulls structured data like names, organizations, and dates from unstructured text input.

### get_api_status
Checks the current status of your MonkeyLearn account to confirm API connectivity is active.

### get_classifier_details
Retrieves detailed information about a specific text classification model you own or use.

### get_extractor_details
Gets the full specifications and usage guide for a particular entity extraction tool.

### list_classifier_tags
Lists all available tags or labels associated with your text classification models.

### list_classifiers
Returns a list of all the sentiment, topic, and intent classifiers you have access to.

### list_extractor_tags
Shows available tags for your entity extraction models.

### list_extractors
Returns a list of all the entity extractors, like person or address pullers.

### list_model_versions
Retrieves historical versions for specific models, allowing you to test older performance settings.

### list_nlp_workflows
Lists the custom multi-step NLP pipelines (Workflows) you have built in MonkeyLearn Studio.

### run_workflow
Executes a pre-defined, complex NLP workflow using multiple steps and tools on new text data.

## Prompt Examples

**Prompt:** 
```
Classify this customer review: 'The product is amazing but delivery was slow.'
```

**Response:** 
```
Classification (Classifier: cl_pi3C7nuL): Tag: 'Mixed' (Confidence: 0.82). Sub-tags: 'Product Quality' → Positive (0.95), 'Delivery' → Negative (0.88). Full text analyzed successfully.
```

**Prompt:** 
```
Extract entities from: 'John Smith from Apple Inc. visited our NYC office on March 15.'
```

**Response:** 
```
Extraction (Extractor: ex_YCya9nrn): Person: 'John Smith' (Confidence: 0.97). Organization: 'Apple Inc.' (0.95). Location: 'NYC' (0.92). Date: 'March 15' (0.99). Total entities found: 4.
```

**Prompt:** 
```
List all my classifiers and extractors.
```

**Response:** 
```
Classifiers: 3. 1) 'Sentiment' (cl_pi3C7nuL, Custom, 500 samples). 2) 'Topic Detection' (cl_abc123, Pre-built). 3) 'Intent' (cl_xyz789, Custom, 1200 samples). Extractors: 2. 1) 'Entity Extractor' (ex_YCya9nrn, Pre-built). 2) 'Keyword Extractor' (ex_def456, Custom). Workflows: 1.
```

## Capabilities

### Classify Text Sentiment & Topic
Determine the emotional tone or subject matter of a block of text using trained classifiers.

### Pull Structured Entities
Extract specific data points (names, locations, dates) from raw text into structured JSON format.

### Execute Complex Workflows
Run multi-step NLP pipelines—for example, first classifying the topic, then extracting relevant entities—all in one call.

### Manage Model Metadata
Retrieve details on available classifiers, extractors, and model versions to understand your data capabilities.

## Use Cases

### Triage Incoming Support Tickets
A support team gets 50 tickets in an hour. Instead of having agents manually read each one, the agent sends all text to `classify_text`. It immediately filters the list, telling you which are 'Billing' (Topic) and 'Angry' (Sentiment), allowing priority dispatching.

### Processing Survey Data at Scale
Marketing receives 10,000 survey responses. Instead of a spreadsheet analysis, the agent loops through them, using `extract_text_entities` to pull out every mentioned competitor's name and product SKU, giving immediate competitive intelligence.

### Automating Research Summaries
A researcher needs to analyze multiple articles. The agent uses a custom workflow (`run_workflow`) that first summarizes the text, then runs `classify_text` on the summary for 'Bias', and finally extracts key figures using `extract_text_entities`.

### Auditing API Functionality
A developer needs to ensure their agent can run a complex pipeline. They first use `list_nlp_workflows` to see what's available, then call `get_api_status` to confirm the server connection is active before testing.

## Benefits

- **Analyze Feedback Instantly:** Instead of manually reading hundreds of support tickets, use `classify_text` to get an immediate breakdown of sentiment (Positive/Negative) and the core topic. You'll know which issue needs attention before a human even looks at it.
- **Structure Messy Data:** Stop treating key details like names or account numbers as messy text blobs. Use `extract_text_entities` to pull them into clean, structured JSON objects, ready for database insertion.
- **Build Complex Logic in One Call:** Don't chain 5 different API calls. With `run_workflow`, you define a multi-step process—like 'Check Topic -> Extract Key Names -> Classify Urgency'—and get the final result in one go.
- **Audit Your Tools Easily:** Before writing anything, use `list_classifiers` and `get_extractor_details`. This gives your agent the necessary context to know exactly which models exist for the job, preventing failed calls.
- **Keep Track of Changes:** Use `list_model_versions` when a classifier updates. You can test older versions side-by-side with new ones, ensuring a model change doesn't break your core business logic.

## How It Works

The bottom line is: you feed it raw text, and it gives you clean, actionable insights.

1. Subscribe to the server and input your MonkeyLearn API Key.
2. Your AI client sends text and a required tool call (e.g., `classify_text`) to the MCP Server.
3. The server runs the model, processes the data, and returns structured findings (tags, entities, or classifications) directly to your agent.

## Frequently Asked Questions

**How do I check if the MonkeyLearn MCP Server is connected?**
You call `get_api_status`. This tool quickly verifies your API key and connection status, confirming that the server can actually talk to your account before you run any heavy analysis.

**Should I use classify_text or run_workflow for topic detection?**
If topic detection is one of several steps in a larger process (e.g., Topic -> Entity Extraction -> Sentiment), use `run_workflow`. If it's the only thing you need, `classify_text` is simpler and faster.

**What if I want to pull names from an address block?**
Use `extract_text_entities`. This tool is designed specifically to isolate structured data like Persons, Organizations, or Locations even when they appear mixed into a paragraph of text.

**How do I see what classifiers are available?**
You call `list_classifiers`. This gives you an index of all the topic and sentiment models you can use without having to guess which one is correct or active.

**What does the `get_api_status` tool confirm about my account access?**
It verifies that your API key is active and correctly connected. This check confirms general service connectivity before you run intensive jobs, ensuring a quick diagnosis if there are authentication issues.

**If I need to revert or debug, how does `list_model_versions` help me find an older classifier or extractor?**
This tool retrieves all historical and current versions of your models. It's essential for debugging when a new deployment breaks analysis because you can pinpoint and select the last known working version ID.

**What is the operational difference between calling `classify_text` versus using `run_workflow`?**
`classify_text` executes a single, defined model check (like sentiment analysis). In contrast, `run_workflow` triggers complex pipelines built in Studio, allowing data to pass through multiple sequential actions automatically.

**How do I see all predefined tags using the `list_classifier_tags` tool?**
The tool retrieves every available tag associated with a specific classifier model. This lets you confirm exactly what labels your trained model recognizes, which is useful before initiating any text analysis jobs.

**Can I classify text by sentiment or topic?**
Yes. Point to any classifier model ID and pass text to get classification results with confidence scores.

**How does MonkeyLearn authentication work?**
MonkeyLearn uses `Authorization: Token {API_KEY}` header against `api.monkeylearn.com/v3`.

**Can I extract named entities from text?**
Yes. Use an extractor model to pull keywords, people names, organizations, locations, and more from raw text.