# Humanloop MCP

> Humanloop (LLM Prompt Management API) MCP. Manage your entire prompt lifecycle—versioning, deployment, and monitoring—directly from any AI agent interface. You can track model generations, set active versions for staging or production, and audit prompt history without leaving your editor. It's the control plane you need for reliable LLMOps.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Tags:** prompt-engineering, llmops, prompt-management, ai-deployment, version-control

## Description

This MCP lets you manage all your core prompts in one place. When you build an application using large language models, prompts are critical; they define how the AI behaves. Instead of relying on scattered files or remembering which prompt version is live, this connector gives you a central system to control them all. You can list every prompt in your organization and check its full history. Need to test a new approach? Update a version's metadata or even delete obsolete copies to keep things clean. Once you find the right setup, you deploy it—setting specific versions as active for environments like staging or production with a simple command. Plus, you can record model generations for later evaluation and monitor settings to ensure your LLM pipeline is healthy. Vinkius makes connecting this control layer easy; just plug into your preferred AI client.

## Tools

### call_prompt_stream
Executes a specified prompt and streams the generated text response back to the user's client.

### delete_prompt_version
Permanently removes an identified version of a stored prompt from the library.

### deploy_prompt
Sets a specific, targeted prompt version as the active configuration for one or more designated environments.

### get_prompt
Retrieves all detailed information about a single prompt using its unique ID.

### list_prompt_environments
Lists all existing environments and shows which version of each prompt is currently active in those spots.

### list_prompt_versions
Gathers a complete list of every saved historical version associated with one specific prompt.

### list_prompts
Retrieves a full directory listing of all prompts currently stored in the organization's library.

### log_to_prompt
Creates a record (a log) detailing model outputs for a specific prompt ID, useful for auditing.

### remove_deployment
Deactivates and removes a previously deployed version from a specified environment.

### update_monitoring
Activates or deactivates monitoring evaluators for logs associated with a prompt.

### update_prompt_version
Changes the descriptive name or metadata of an existing, specific prompt version.

### upsert_prompt
Creates a brand new prompt configuration or updates an existing one with new content.

## Prompt Examples

**Prompt:** 
```
List all prompts in my Humanloop organization.
```

**Response:** 
```
I've retrieved your prompts. You have 3 active prompts: 'customer-support-reply' (ID: pr_1), 'code-refactor-bot' (ID: pr_2), and 'marketing-copy-gen' (ID: pr_3).
```

**Prompt:** 
```
Get the details for prompt ID pr_12345.
```

**Response:** 
```
Fetching details for 'pr_12345'... This prompt is named 'Summarizer', using model 'gpt-4', with a template focused on technical documentation. It currently has 5 versions.
```

**Prompt:** 
```
Deploy version v_987 of prompt pr_123 to the production environment.
```

**Response:** 
```
Deployment successful. Version 'v_987' of prompt 'pr_123' is now live in the 'production' environment.
```

## Capabilities

### List all prompts
Retrieves a complete inventory of every prompt stored in the organization.

### View and update versions
Accesses version history for specific prompts, allowing you to modify metadata or remove outdated copies.

### Deploy active prompt versions
Sets a targeted prompt version as the live configuration for defined environments like production or staging.

### Execute and stream prompts
Runs a prompt and streams the resulting text back to your agent client in real-time.

### Log model generations
Records detailed logs for any model generation run against a specific prompt, aiding evaluation.

### Manage deployment settings
Adds or removes version deployments from specific environments and updates monitoring rules.

## Use Cases

### The QA team needs to audit the 'Support Bot' performance.
Instead of pulling logs from three different services, the agent runs `list_prompts` to find the ID. It then calls `log_to_prompt` repeatedly with specific inputs to capture model generations for a full quality review.

### The DevOps team needs to roll out an urgent fix.
They use `get_prompt` to verify the current structure, then call `update_prompt_version` to stage the fix. Finally, they execute `deploy_prompt` to make it live in production instantly.

### A PM needs to see what's running everywhere.
The agent calls `list_prompt_environments`. This immediately shows which specific prompt version is active across staging, the development sandbox, and the main client environment.

## Benefits

- You never lose track of a prompt change. Use `list_prompt_versions` to see the full history, so you always know exactly which version is running in production.
- Testing new prompts doesn't require manual deployment steps. You can use `upsert_prompt` and then test it via `call_prompt_stream` right away.
- When a prompt breaks, don't panic. Use `remove_deployment` to instantly deactivate the bad version and roll back to a known good state.
- Keep your models accountable by using `log_to_prompt`. This records every run, letting you audit performance later for quality assurance.
- Manage complex environments easily. Run `list_prompt_environments` to see what's active across staging, production, and other targets at a glance.

## How It Works

The bottom line is, your AI agent treats prompt management like it's built-in—you just talk to it instead of clicking through dashboards.

1. Subscribe to this MCP and enter your Humanloop API Key.
2. Your agent client connects, giving you read/write access to the prompt library.
3. You can then call functions like `list_prompts` or `deploy_prompt` directly from a conversation thread.

## Frequently Asked Questions

**Can I see the full version history of a specific prompt?**
Yes! Use the `list_prompt_versions` tool with the Prompt ID. It will return all historical versions, allowing you to track changes and metadata over time.

**How do I deploy a prompt version to a specific environment like production?**
You can use the `deploy_prompt` tool. Provide the Prompt ID and the Environment ID to set that specific version as the active deployment for that environment.

**Is it possible to record model outputs for later evaluation?**
Absolutely. Use the `log_to_prompt` tool to record a generation, including the prompt path, messages, and output, which can then be used for evaluation in Humanloop.

**How do I list all prompts using `list_prompts` if my organization has many entries?**
The `list_prompts` tool returns all available prompt IDs and basic names. If you have thousands of prompts, you might need to implement pagination in your agent logic to ensure you retrieve every single entry.

**What is the best way to update a prompt's name using `update_prompt_version`?**
You must use `update_prompt_version` and provide both the version ID and the new desired metadata. This prevents accidental changes, so always confirm you have the correct unique version identifier first.

**If I need to remove an old prompt using `delete_prompt_version`, are there any dependencies?**
Deleting a prompt version is irreversible. Before running `delete_prompt_version`, verify that no active deployments or critical logs still reference that specific version ID.

**Can I check the status of all environments and their deployed versions using `list_prompt_environments`?**
Yes, `list_prompt_environments` gives a clear overview. It shows every configured environment (like staging or production) alongside which prompt version is currently active in that location.

**Is there a way to create a new prompt configuration using `upsert_prompt` if I don't have an ID?**
The `upsert_prompt` tool handles creation or updating. If no unique identifier is provided, the API will generate one for you and save the entire configuration set.