Crescendo Lab Docs Deploy
English
Sign up

Run LINE OA MCP on Agent Lab

Deploy the open-source LINE Agent SDK as your Agent Lab project, set up Google sign-in, connect Claude Code, and link a LINE Official Account in one sentence.

Last updated

Before you start#

  • An Agent Lab organization.
  • A LINE Official Account you own, or try the sandbox first.
  • Claude Code, or another AI tool that speaks MCP.

1. Deploy#

The LINE Agent SDK source is at https://github.com/chatbotgang/line-agent-sdk, with a Dockerfile at the top. The quickest way is to ask Claude Code with the Agent Lab MCP server connected (see Deploy with an AI tool):

text
Deploy https://github.com/chatbotgang/line-agent-sdk to Agent Lab with the address label line-oa-mcp.

The code needs a database: the platform creates one and connects it on the first deploy. To go live on every push afterwards, connect the project to the repository, see Deploy from GitHub.

2. Set up Google sign-in#

Anyone can sign in with a Google account, and each person sees only the connections they created. In the Google Cloud console, create an OAuth client ID of type "Web application" with the project's address, for example https://line-oa-mcp--<organization>.hosting.agentlab.run, as an authorized JavaScript origin; set the OAuth consent screen to External and publish it, which needs no review for basic sign-in scopes. Then enter GOOGLE_CLIENT_ID under the project's Settings › Environment variables; the platform takes care of the rest, see Project settings:

NameWho provides itWhat it is
GOOGLE_CLIENT_IDYouThe Google OAuth client ID used to sign in to the panel. Not a secret.
ADMIN_GOOGLE_DOMAINYou, optionalYour operators' Google Workspace domain, for example example.com. Its accounts see every connection and the operator page; decided by the Workspace domain Google reports, never by the email's suffix.
ALLOWED_GOOGLE_DOMAINYou, optionalRestrict sign-in to one Google Workspace domain. Empty by default: anyone can sign in.
SESSION_SECRETGenerated by the platformThe source of the keys that sign sessions and encrypt stored Channel Secrets. Nobody needs to know it.
DATABASE_URLCreated by the platformThe PostgreSQL database created and connected on the first deploy.
AGENTLAB_GATEWAY_KEYYou, optionalA key from Agent Lab's AI Gateway. With it, the AI answers the test user's messages; without it, a fixed text does.

Save, then select Restart service on the project to apply it.

Before sign-in is set up

The service starts, but everything except LINE's webhook and the health check answers 503. It never runs open without sign-in.

3. Connect an AI tool#

Sign in to the panel with Google, create a token on the Agent tokens page (/tokens; it is shown once), put it in an environment variable, then add LINE OA MCP to the project's .mcp.json:

bash
export LINE_AGENT_SDK_TOKEN='<your agent token>'
.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}" }
    }
  }
}

For other clients, see LINE OA MCP tools.

4. Send the first message#

Tell Claude Code:

text
Connect my LINE Official Account and keep going until my phone receives the first message.

The AI creates the connection, gives you a panel URL for the Channel ID and Channel Secret, then walks you through each step:

  1. Read-only health check Account info, chat mode, webhook, quota and followers are read. Nothing is changed.
  2. Choose a mode Push only never touches the webhook; relay keeps sending other customers' messages to the existing system; direct is for an account nothing else is using.
  3. Turn on Use webhook Turn it on in the LINE Developers console. The service checks every 2 seconds, so there's nothing to come back and confirm.
  4. Pair Scan the QR code to add the account as a friend and send the pairing code. The agent answers with the first message right away.

Without an Official Account, ask the AI to walk you through creating one with line_new_account_steps, or try line_start_sandbox first.

Keep credentials out of the chat

The Channel ID and Channel Secret are entered only on the panel's page. The AI tool never asks for them and never receives them.