# Cody — how to use (mcp.ai)

Connect your Cody account and use 21 tools for AI assistants straight from your AI agent. Connect with your own API key. Cody is an AI-powered assistant that uses the magic of ChatGPT meets the expertise of a custom-made AI assistant trained on your specific business.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_cody?ms=1787291220000`
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. `cody_create_conversation`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/cody`
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/cody/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/cody/create/conversation` — Tool to create a new conversation with a specified bot. Use when starting a new conversation thread with optional focus mode to limit bot's knowledge base to specific documents.
  - body: { name: string, bot_id: string, document_ids?: string[] }
- `POST https://api.mcp.ai/api/cody/create/document` — Tool to create a new document with text or HTML content in Cody AI. Use when you need to add documents to Cody's knowledge base with up to 768 KB of content.
  - body: { name: string, content: string, folder_id: string }
- `POST https://api.mcp.ai/api/cody/create/document/from/file` — Tool to create a document by uploading a file (up to 100 MB). Supports txt, md, rtf, pdf, ppt, pptx, pptm, doc, docx, docm formats. Use when you need to add file-based documents to Cody's knowledge ba
  - body: { key: string, folder_id: string }
- `POST https://api.mcp.ai/api/cody/create/document/from/webpage` — Tool to create a document from a publicly accessible webpage URL. Use when you need to import content from a webpage into Cody AI. The webpage must be accessible without login. If request fails, ensur
  - body: { url: string, folder_id: string }
- `POST https://api.mcp.ai/api/cody/create/folder` — Tool to create a new folder in Cody AI for organizing content. Use when you need to create a folder to organize documents or conversations.
  - body: { name: string }
- `POST https://api.mcp.ai/api/cody/delete/conversation` — Tool to delete a conversation by its ID. Use when you need to permanently remove a conversation from the system.
  - body: { id: string }
- `POST https://api.mcp.ai/api/cody/delete/document` — Tool to delete a document by id. Use when removing a document that is no longer needed.
  - body: { id: string }
- `POST https://api.mcp.ai/api/cody/get/conversation` — Tool to fetch a conversation by its ID from Cody AI. Use when you need to retrieve details about a specific conversation. Supports optional includes parameter to filter response to list document IDs.
  - body: { id: string, includes?: string }
- `POST https://api.mcp.ai/api/cody/get/document` — Tool to retrieve a specific document by its identifier from Cody AI. Use when you need to get details about a particular document including its status, content URL, and metadata.
  - body: { id: string }
- `POST https://api.mcp.ai/api/cody/get/folder` — Tool to retrieve a specific folder by its identifier. Use when you need to get details about a folder.
  - body: { id: string }
- `POST https://api.mcp.ai/api/cody/get/message` — Tool to fetch a specific message by its ID from Cody AI. Use when you need to retrieve details about a particular message, with optional includes for sources or usage metrics.
  - body: { id: string, includes?: string }
- `POST https://api.mcp.ai/api/cody/get/uploads/signed/url` — Tool to get an AWS S3 signed upload URL for file uploads. Use when you need to obtain a signed URL to upload a file to Cody's storage.
  - body: { file_name: string, content_type: string }
- `POST https://api.mcp.ai/api/cody/list/bots` — Tool to get all bots with optional keyword filtering. Use when you need to retrieve the list of available bots in a Cody account.
  - body: { page?: integer, keyword?: string, per_page?: integer }
- `POST https://api.mcp.ai/api/cody/list/conversations` — Tool to get all conversations with optional filtering by bot, keyword, or includes. Use when you need to retrieve conversation history, filter by bot, search by name, or get document associations.
  - body: { page?: integer, bot_id?: string, keyword?: string, includes?: string, per_page?: integer }
- `POST https://api.mcp.ai/api/cody/list/documents` — Tool to retrieve all documents from Cody AI account with optional filtering. Use when you need to list documents by folder, conversation, or search by keyword. Returns document details including learn
  - body: { page?: integer, keyword?: string, per_page?: integer, folder_id?: string, conversation_id?: string }
- `POST https://api.mcp.ai/api/cody/list/folders` — Tool to retrieve all folders with optional keyword filtering. Use when you need to list or search for folders in the account.
  - body: { page?: integer, keyword?: string, per_page?: integer }
- `POST https://api.mcp.ai/api/cody/list/messages` — Tool to retrieve a paginated list of messages from Cody, optionally filtered by conversation. Use when you need to list messages, with optional filtering by conversation_id and extra attributes (sourc
  - body: { page?: integer, includes?: string, per_page?: integer, conversation_id?: string }
- `POST https://api.mcp.ai/api/cody/send/message` — Tool to send a message to Cody AI and receive an AI-generated response. Use when you need to send a user message to a conversation and get the AI's reply.
  - body: { content: string, conversation_id: string }
- `POST https://api.mcp.ai/api/cody/send/message/for/stream` — Tool to send a message to Cody AI and receive a Server-Sent Events (SSE) stream URL for the AI response. Use when you need streaming responses instead of waiting for the complete message. The response
  - body: { content: string, redirect?: boolean, conversation_id: string }
- `POST https://api.mcp.ai/api/cody/update/conversation` — Tool to update a conversation by its ID including name, bot_id, and document_ids. Use when you need to modify an existing conversation's properties.
  - body: { id: string, name: string, bot_id: string, document_ids?: string[] }
- `POST https://api.mcp.ai/api/cody/update/folder` — Tool to update a folder by its ID. Use when you need to modify an existing folder's name.
  - body: { id: string, name: string }

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

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