Crescendo Lab Docs Deploy
English
Sign up

LINE OA MCP tools

The ten LINE OA MCP tools, setup and a typical run: Claude Code, Codex or Cursor create a LINE connection, follow each step and message, with no credentials.

Last updated

Server URL#

LINE OA MCP lives under the project you run and uses Streamable HTTP:

text
https://line-oa-mcp--<organization>.hosting.agentlab.run/mcp

To run it, see Run LINE OA MCP on Agent Lab.

Connect#

Every request needs Authorization: Bearer <agent token>. Sign in to the panel with Google, create the token on the Agent tokens page (/tokens), and put it in an environment variable rather than a file or the chat:

bash
export LINE_AGENT_SDK_TOKEN='<your agent token>'

For Claude Code, add this to the project's .mcp.json (${LINE_AGENT_SDK_TOKEN} is expanded from the environment at startup):

.mcp.json
{
  "mcpServers": {
    "line-oa-mcp": {
      "type": "http",
      "url": "https://line-oa-mcp--<organization>.hosting.agentlab.run/mcp",
      "headers": { "Authorization": "Bearer ${LINE_AGENT_SDK_TOKEN}" }
    }
  }
}

Any other MCP client that supports Streamable HTTP works with the same URL and the Authorization header.

Tools#

ToolPurpose
line_connect_accountCreate a connection to an existing LINE Official Account. Returns the setupUrl to give the person, who enters the Channel ID and Channel Secret there.
line_get_connectionRead a connection's state: whose turn each step is and how it is detected as done. Reading also checks whether the person has finished a step in LINE.
line_list_connectionsList every connection with its state.
line_send_messagePush a text message to the paired test user. Works once the connection is live; push messages use the account's monthly quota.
line_start_sandboxWithout an Official Account, get a join code for the shared sandbox.
line_get_sandboxRead a sandbox binding; live is true once the first message has arrived.
line_configure_botSet how the AI agent answers: its role, what it knows, its tone and what it must not do (up to 4,000 characters), turn AI replies on or off, or narrow who it answers back to test users. Applies to the next message.
line_request_go_liveThe AI agent answers only the paired test user by default. This asks the person to let it answer every friend; nothing changes until they approve on approveUrl, signed in. Only for live connections whose mode is direct.
line_get_messagesRead recent events, newest first: what the test user wrote and how each event was handled. For other friends only a masked user ID and the handling are kept, never the message text.
line_new_account_stepsThe steps to create an Official Account and enable the Messaging API, which LINE leaves to a person.

Each tool answers with one sentence saying what to tell the person, followed by the full JSON, which matches the HTTP API connection object.

A typical run#

  1. Create the connection Call line_connect_account and give the person the returned setupUrl.
  2. Wait for the person Call line_get_connection every few seconds. "Waiting for the person" means tell them that step's instructions and link, then keep reading; the step completes on its own, so don't ask whether they are done.
  3. Operator steps "The service's operator is handling" means tell the person it is in progress.
  4. Live "Live" means the first LINE message has reached the person's phone. Use line_send_message from then on.

To try without an Official Account, use line_start_sandbox, give the person addFriendUrl and joinText, and wait with line_get_sandbox.

Keep the token and credentials out of the chat

The AI tool needs only the URL and the agent token from the environment. The Channel Secret is entered only on the panel's page; the AI tool never asks for it and never receives it.

Errors#

SituationResponseWhat to do
Missing, wrong or revoked tokenHTTP 401Check the environment variable and the Authorization header; create a new token on /tokens if needed.
The service isn't configured or is still loadingHTTP 503 with the reason in errorTry again later; if a variable is missing, the person running the service adds it.
Unknown connection, not live yet, invalid inputThe tool returns isError with the reasonFollow the reason; if it isn't live, continue with the next step.