# Langbase — how to use (mcp.ai)

Connect your Langbase account and use 20 tools for AI agents straight from your AI agent. Connect with your own API key. Langbase is a serverless AI developer platform that enables developers to build, collaborate, and deploy AI agents and applications with composable AI infrastructure.

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

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

### Endpoints
- `POST https://api.mcp.ai/api/langbase/append/thread/messages` — Tool to add new messages to an existing conversation thread. Use when continuing a chat session or adding context to a thread.
  - body: { messages: object[], threadId: string }
- `POST https://api.mcp.ai/api/langbase/check/health` — Tool to check the health status of the Langbase API service. Use when you need to verify API availability.
- `POST https://api.mcp.ai/api/langbase/chunker/split/content` — Tool to split content into smaller chunks. Use when processing large text segments to fit downstream limits.
  - body: { content: string, overlap?: integer, chunk_size?: integer, chunker_type?: string }
- `POST https://api.mcp.ai/api/langbase/create/thread` — Tool to create a new conversation thread. Use when starting a fresh chat session or grouping messages into a distinct thread.
  - body: { messages?: object[], metadata?: object, threadId?: string }
- `POST https://api.mcp.ai/api/langbase/delete/thread` — Tool to delete a thread that is no longer needed to manage conversation history. Use when you need to permanently remove a thread by its ID.
  - body: { threadId: string }
- `POST https://api.mcp.ai/api/langbase/delete/thread/message` — Tool to delete a specific message from a conversation thread. Use when you need to remove a message from a thread by its ID.
  - body: { threadId: string, messageId: string }
- `POST https://api.mcp.ai/api/langbase/document/list` — Tool to list documents in a specific memory. Use when you need to fetch document metadata (and optionally vectors) from a memory after confirming its name. Supports pagination via limit and startAfter
  - body: { limit?: integer, memoryName: string, startAfter?: string, includeVectors?: boolean }
- `POST https://api.mcp.ai/api/langbase/get/pipe` — Tool to retrieve details of a specific pipe by owner and name. Use when you need to fetch configuration and settings of a particular pipe.
  - body: { pipe_name: string, owner_login: string }
- `POST https://api.mcp.ai/api/langbase/get/thread` — Tool to retrieve details of a specific conversation thread. Use when you need the full thread details by its ID after confirming its existence.
  - body: { threadId: string }
- `POST https://api.mcp.ai/api/langbase/list/models` — Tool to get available AI models supported by Langbase. Use to discover text and image generation models from various providers.
- `POST https://api.mcp.ai/api/langbase/list/thread/messages` — Tool to list all messages in a conversation thread. Use after obtaining the thread ID to fetch its messages.
  - body: { limit?: integer, before?: string, threadId: string }
- `POST https://api.mcp.ai/api/langbase/list/traces` — Tool to get execution traces for debugging and monitoring pipe runs. Use when you need to retrieve trace logs for a specific primitive.
  - body: { limit?: integer, order?: string, offset?: integer, primitiveId: string, primitiveName: string }
- `POST https://api.mcp.ai/api/langbase/memory/create` — Tool to create a new memory. Use when storing a new memory record in Langbase after confirming memory details.
  - body: { name: string, top_k?: integer, chunk_size?: integer, description?: string, chunk_overlap?: integer, embedding_model?: string }
- `POST https://api.mcp.ai/api/langbase/memory/delete` — Tool to delete a specific memory. Use when you need to permanently remove a stored memory by its name.
  - body: { memory_name: string }
- `POST https://api.mcp.ai/api/langbase/memory/list` — Tool to list all memory objects. Use when you need to fetch stored memories for context retrieval.
- `POST https://api.mcp.ai/api/langbase/pipe/create` — Tool to create a new pipe. Use after configuring pipe parameters. Returns an array of pipe objects, each including API key and URL.
  - body: { json?: boolean, name: string, stop?: string[], model?: string, store?: boolean, top_p?: number, status?: string, stream?: boolean, upsert?: boolean, moderate?: boolean, max_tokens?: integer, description?: string, temperature?: number, tool_choice?: string, presence_penalty?: number, frequency_penalty?: number, parallel_tool_calls?: boolean }
- `POST https://api.mcp.ai/api/langbase/pipe/list` — Tool to list all pipes. Use after authentication to retrieve the complete list of pipes. Returns an array of pipe objects; callers must handle list iteration.
- `POST https://api.mcp.ai/api/langbase/update/pipe` — Tool to update an existing pipe's configuration on Langbase. Use when modifying model settings, parameters, prompts, tools, or memory. The pipe must already exist.
  - body: { json?: boolean, name?: string, stop?: string[], model?: string, store?: boolean, tools?: object[], top_p?: number, memory?: object[], status?: string, stream?: boolean, messages?: object[], moderate?: boolean, pipe_name: string, variables?: object[]|object, max_tokens?: integer, description?: string, temperature?: number, tool_choice?: string|object, presence_penalty?: number, regenerateApiKey?: boolean, frequency_penalty?: number, parallel_tool_calls?: boolean }
- `POST https://api.mcp.ai/api/langbase/update/thread` — Tool to update an existing thread's metadata. Use when you need to modify metadata fields for managing and organizing conversation threads.
  - body: { metadata?: object, threadId: string }
- `POST https://api.mcp.ai/api/langbase/update/thread/message` — Tool to update an existing message in a conversation thread. Use when you need to modify the content or metadata of a specific message.
  - body: { content?: string, metadata?: object, threadId: string, messageId: string }

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

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