# Metatextai — how to use (mcp.ai)

Connect your Metatextai account and use 13 tools for artificial intelligence straight from your AI agent. Connect with your own API key. Metatext AI specializes in natural language processing and text generation, helping organizations automate writing tasks, sentiment analysis, or content moderation.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_metatextai?ms=1787291400000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `metatextai_chat_completions`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/metatextai`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/metatextai/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/metatextai/chat/completions` — Tool to generate chat completions. Use when you need OpenAI-compatible conversational responses.
  - body: { stop?: string, model: string, prompt?: string, project?: string, messages?: object[], max_tokens?: integer, temperature?: number }
- `POST https://api.mcp.ai/api/metatextai/classify` — Tool to classify text. Use when you need to obtain labels and confidence scores from a trained MetatextAI model for given text.
  - body: { text: string, model?: string, options?: object, project_id: string }
- `POST https://api.mcp.ai/api/metatextai/create/policy/guardrails` — Tool to create a policy guardrail. Use when you need to define automated guardrails for content in a specific application.
  - body: { id: string, rules: object[], target: string|string[], definition?: string, application_id: string, override_response?: string }
- `POST https://api.mcp.ai/api/metatextai/delete/policy/guardrails` — Tool to delete a guardrail policy. Use when you need to remove a policy by ID for a specific application after confirming valid application and policy IDs.
  - body: { policy_id: string, application_id: string }
- `POST https://api.mcp.ai/api/metatextai/evaluate` — Tool to evaluate LLM messages against policies/guardrails. Use after generating model output to get violation details or corrections.
  - body: { messages: object[], policies?: object[], fail_fast?: boolean, policy_ids?: string[], application?: string, override_response?: string, correction_enabled?: boolean }
- `POST https://api.mcp.ai/api/metatextai/extract` — Tool to run information extraction. Use when you need to extract structured data from text.
  - body: { text: string, model?: string, options?: object, project_id: string }
- `POST https://api.mcp.ai/api/metatextai/generate` — Tool to generate text for a project model. Use when you need LLM completions or chat responses. Supports both prompt and message-based inputs with temperature, stop-sequence, and token limits.
  - body: { stop?: string, model: string, prompt?: string, messages?: object[], max_tokens?: integer, project_id: string, temperature?: number }
- `POST https://api.mcp.ai/api/metatextai/list/applications` — Tool to retrieve a list of all existing applications. Use when you need to view application IDs, names, and descriptions.
  - body: { tag?: string, limit?: integer, offset?: integer, search?: string }
- `POST https://api.mcp.ai/api/metatextai/list/models` — Tool to retrieve a list of all available models and their supported tasks. Use when you need to choose an appropriate model for chat completions.
- `POST https://api.mcp.ai/api/metatextai/list/policies/guardrails` — Tool to list all guardrail policies for a specific application. Use after obtaining an application ID to inspect its configured policies.
  - body: { application_id: string }
- `POST https://api.mcp.ai/api/metatextai/list/red/team/test/probes` — Tool to list all available red team test probes. Use when you need to discover available probes for red teaming.
- `POST https://api.mcp.ai/api/metatextai/run/red/team/test/scan` — Tool to run a vulnerability red-team test scan. Use when you need to execute probes against an application.
  - body: { probes?: string[], application: string }
- `POST https://api.mcp.ai/api/metatextai/update/policy/guardrails` — Tool to update an existing policy's guardrails. Use when you need to modify a policy's rules after confirming it exists.
  - body: { id: string, rules: object[], target: string|string[], policy_id: string, definition?: string, application_id: string, override_response?: string }

## Example prompts
- "What can I do in Metatextai?"
- "Show me a summary of my Metatextai account"

## More
- Page: https://mcp.ai/metatextai
- Agent spec (llms.txt): https://mcp.ai/metatextai/llms.txt
- Postman collection: https://mcp.ai/metatextai/postman.json
