Connecting a LINE Official Account to an AI Agent with MCP
LINE published an official MCP server for its Messaging API, which means an AI agent can now drive a LINE Official Account directly — sending messages, broadcasting promotions, and pushing Flex Message cards without writing any API code. I set it up with Codex and worked through every capability the server exposes, from creating a fresh account to delivering a message to a real phone. This guide…
LINE has released an official MCP (Messaging Control Protocol) server for its Messaging API, allowing AI agents to directly control LINE Official Accounts. This eliminates the need for writing any API code to send messages, broadcast promotions, and push Flex Message cards. The author tested the setup using Codex and explored all the capabilities offered by the server.
The guide walks readers through a complete setup process and highlights three areas where the documentation differs from reality. First, the MCP server is agent-agnostic, meaning it can work with various AI agents such as Codex, Claude Desktop, and Cline. The only difference lies in the configuration file format, as the JSON format used by Claude Desktop requires a different TOML format for Codex setups.
Second, it's important to note that a verified account and an API-capable account are not the same. While a free account can access the Messaging API, certain functions like getting follower IDs require a verified account or a premium plan.
The guide also addresses potential conflicts between LINE's security recommendations and its own features. An example of this is the example configuration file, which disables npm install scripts. This, in turn, prevents the installation of the headless browser required for the rich menu tool. The author found that explicitly naming the tool in the prompt worked better when using Codex, as the AI agent tends to write Node scripts on its own.
Another key point is that broadcasts cannot be recalled once sent. To prevent automatic sends, the config file should have default_tools_approval_mode = false. Throughout the guide, all screenshots and error messages are actual snapshots from the working setup.
The article is available in both English and Thai and can be found at devlycan.com.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.