# Writer — how to use (mcp.ai)

Connect your Writer account and use 23 tools for artificial intelligence straight from your AI agent. Connect with your own API key. Writer is a full-stack generative AI platform for enterprises, offering tools to build and deploy AI applications integrated with their suite of LLMs, graph-based RAG tools, and AI guardrails.

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

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

### Endpoints
- `POST https://api.mcp.ai/api/writer/add/file/to/graph` — Tool to add a file to a knowledge graph for indexing and retrieval. Use when you need to add an uploaded file to an existing knowledge graph for RAG applications.
  - body: { file_id: string, graph_id: string }
- `POST https://api.mcp.ai/api/writer/analyze/images` — Tool to analyze images using Writer's vision capabilities. Use when you need image understanding, text extraction from images, or visual question answering. Images must be uploaded via POST /v1/files 
  - body: { model: string, prompt: string, variables: object[] }
- `POST https://api.mcp.ai/api/writer/ask/question/to/knowledge/graph` — Tool to send a question to the knowledge graph and retrieve the answer. Use after defining your question and optional context.
  - body: { context?: object[], question: string, graph_ids: string[] }
- `POST https://api.mcp.ai/api/writer/chat/completion` — Tool to generate chat-based completions. Use when you need conversational AI responses; call after assembling system and user messages.
  - body: { n?: integer, stop?: string|string[], model?: string, top_p?: number, stream?: boolean, messages: object[], max_tokens?: integer, temperature?: number, presence_penalty?: number, frequency_penalty?: number }
- `POST https://api.mcp.ai/api/writer/create/knowledge/graph` — Tool to create a new knowledge graph. Use when you need to create an empty graph that files can be added to.
  - body: { name: string, description?: string }
- `POST https://api.mcp.ai/api/writer/delete/file` — Tool to delete a file by its ID. Use when you need to permanently remove a file from Writer with no recovery option available.
  - body: { file_id: string }
- `POST https://api.mcp.ai/api/writer/delete/graph` — Tool to delete a knowledge graph by its ID. Use when you need to remove a graph after confirming its identifier.
  - body: { graph_id: string }
- `POST https://api.mcp.ai/api/writer/detect/ai/content` — Tool to detect whether content was generated by AI. Returns a classification label and confidence score indicating the likelihood of AI-generated content. Use when you need to verify content authentic
  - body: { input: string }
- `POST https://api.mcp.ai/api/writer/download/file` — Tool to download the binary content of a file. Use when you need to retrieve file data from the Writer platform. The response contains the file in its original format.
  - body: { file_id: string }
- `POST https://api.mcp.ai/api/writer/get/file` — Tool to retrieve detailed information about a specific file by its ID. Use when you need to check a file's metadata, processing status, or associated knowledge graphs.
  - body: { file_id: string }
- `POST https://api.mcp.ai/api/writer/list/applications` — Tool to list all no-code agent applications. Use when you need to retrieve all registered applications.
  - body: { after?: string, limit?: integer }
- `POST https://api.mcp.ai/api/writer/list/files` — Tool to list all uploaded files. Use when you need to retrieve a paginated set of user files, optionally filtered by status, graph, or type. Use after uploading files to inspect available files.
  - body: { after?: string, limit?: integer, order?: string, before?: string, status?: string, graph_id?: string, file_types?: string }
- `POST https://api.mcp.ai/api/writer/list/graphs` — Tool to retrieve a list of knowledge graphs. Use when you need an overview of existing graphs.
  - body: { after?: string, limit?: integer, order?: string, before?: string }
- `POST https://api.mcp.ai/api/writer/list/models` — Tool to list all available language models. Use when you need to discover which models can be used for completions.
- `POST https://api.mcp.ai/api/writer/medical/comprehend` — Tool to extract medical entities and concepts from unstructured clinical text. Use when you need to label medical text with standardized codes such as SNOMED CT.
  - body: { text: string }
- `POST https://api.mcp.ai/api/writer/parse/pdf` — Tool to parse and extract text content from a previously uploaded PDF file. Use when you need to convert PDF documents to text or markdown format for further processing.
  - body: { format: string, file_id: string }
- `POST https://api.mcp.ai/api/writer/remove/file/from/graph` — Tool to remove a file from a Knowledge Graph. Use when you need to unlink a specific file from a graph by providing both graph and file identifiers.
  - body: { file_id: string, graph_id: string }
- `POST https://api.mcp.ai/api/writer/retrieve/graph` — Tool to retrieve a knowledge graph by its ID. Use when you need details of an existing graph.
  - body: { graph_id: string }
- `POST https://api.mcp.ai/api/writer/text/generation` — Tool to generate text based on a given prompt. Use when you need model-driven completions after crafting a prompt.
  - body: { stop?: string[], model: string, top_p?: number, prompt: string, max_tokens?: integer, temperature?: number }
- `POST https://api.mcp.ai/api/writer/translate/text` — Tool to translate text from one language to another with support for formality, length control, and profanity masking. Use when you need to convert text between different languages.
  - body: { text: string, model: string, formality: boolean, length_control: boolean, mask_profanity: boolean, source_language_code: string, target_language_code: string }
- `POST https://api.mcp.ai/api/writer/update/graph` — Tool to update an existing knowledge graph. Use after confirming the graph_id. Specify at least one of name or description to modify.
  - body: { name?: string, graph_id: string, description?: string }
- `POST https://api.mcp.ai/api/writer/upload/file` — Tool to upload a file to Writer. Use when you need to add files for Knowledge Graphs, PDF parsing, or other file-based operations. Files can be associated with Knowledge Graphs for RAG applications.
  - body: { file: object }
- `POST https://api.mcp.ai/api/writer/web/search` — Tool to perform a web search. Use when you need relevant web page results for a given query.
  - body: { query: string, topic?: string, time_range?: string, max_results?: integer, search_depth?: string, include_answer?: boolean, exclude_domains?: string[], include_domains?: string[] }

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

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