Skip to main content
This guide shows you how to use the Writer MCP server to orchestrate multiple Writer API calls through AI assistants like Claude Desktop and Cursor, or your own custom MCP client. The Model Context Protocol (MCP) is an open standard that enables AI assistants to interact with external tools and data sources. After completing these steps, you can chain together multi-step workflows without hardcoding API calls.

Install and configure the MCP server

Set up your Writer API key

The MCP server requires your Writer API key as an environment variable. If you don’t have an API key, you can create one. Store your API key in a .env file with the name WRITER_API_KEY. For example:
Then source the environment file in your shell:
The MCP server will show a fatal error if the WRITER_API_KEY environment variable is missing or empty. Make sure to set this environment variable before running the MCP server.

Install and run the MCP server

You can install and run the Writer MCP server using npx. Set the WRITER_API_KEY environment variable before running the MCP server. The following command installs and runs the latest version of the Writer MCP server:
You can also install the MCP server globally and run it anytime.

Configure your MCP client

Add the Writer MCP server to your MCP client configuration, such as claude_desktop_config.json for Claude Desktop or mcp.json for Cursor. For example, here’s how to configure the MCP server for Claude Desktop:
Add to your claude_desktop_config.json:
claude_desktop_config.json

Interact with the MCP server in an AI client

After you’ve added your MCP server to your client configuration, you can interact with it by sending requests to the MCP server. Each client has a different way to interact with the MCP server. For conversational AI assistants like Claude Desktop and Cursor, you can interact with the MCP server by sending messages to the assistant. For example, to upload a file to Writer, you can send a message like “Upload this image to Writer” and the assistant can use the MCP server to accomplish the task.

Build custom MCP clients

You can also create your own MCP client using any MCP-compatible package like Strands, LangChain, or other MCP libraries. The Writer MCP server follows the standard MCP protocol, so you can integrate it with any client that implements the protocol. The following example shows how to create a custom MCP client using the Strands SDK.

Set up the Strands SDK

First, install the Strands SDK, the Writer dependency, and the Strands Agent Tools package:

Create a custom MCP client

Next, create a custom MCP client that uses the Writer MCP server to respond to user requests. The example first creates an MCPClient using Strands Tools to connect to the Writer MCP server, then sets up the Writer model to be used by the agent for handling requests. The writer_mcp_client.list_tools_sync() method retrieves the list of available tools from the Writer MCP server. The agent then uses these tools to respond to user requests related to content workflow automation.
content_workflow_client.py

Troubleshoot common issues

MCP server shows fatal error about missing API key: verify your API key is set correctly:
If the environment variable is not set, run:
MCP client fails to initialize with “Connection closed” error: this usually means the MCP server couldn’t start due to a missing API key. When using Strands SDK, make sure to pass the environment variable to the MCP server:
Tools not appearing: check that the MCP server is properly configured in your client and restart the client application. Permission errors: ensure your API key has the necessary permissions for the operations you want to perform.

Next steps

Now that you’ve set up the MCP server, you can use it to build complex workflows without writing custom integration code. Next, you can explore the following resources to help you get the most out of the MCP server: