English | 日本語
Model Context Protocol (MCP) server for LINE messaging integration with AI assistants.
LINE MCP Server is a Model Context Protocol server that integrates LINE messaging services with AI assistants like Claude Desktop. It enables AI assistants to authenticate, manage contacts, and send messages through LINE accounts.
- LINE Login: LINE authentication using environment variables
- Contact Management: Contact retrieval with search and token optimization features
- Message Sending: Send messages to LINE users (via MID)
- Smart Search: Response optimization with token limits
- Login State Management: Authentication state and error handling
Perfect for those who want to use LINE messaging features with Claude Desktop. AI assistants can help with:
- Searching and managing LINE contacts
- Sending messages to specific people
- Retrieving and organizing contact information
This server enables AI assistants to:
- Login to LINE accounts
- Search and filter contact lists
- Send messages to specified contacts
- Check and manage login status
Description: Login to LINE using command line arguments
Parameters: None
Description: Get contacts with optional search filter and token limits
Parameters:
search
(optional, string): Search filter by contact namemaxTokens
(optional, number): Token limit for response
Description: Send message to specified user
Parameters:
to
(required, string): Recipient's MIDmessage
(required, string): Message to send
The LINE MCP server requires three command line arguments:
- EMAIL: Your LINE account email address
- PASSWORD: Your LINE account password
- STORAGE_PATH: Directory path where authentication tokens will be stored
Syntax: npx line-mcp <email> <password> <storage_path>
Example: npx line-mcp user@example.com mypassword ./line_storage
Important: The storage directory must exist before starting the server. If the specified path does not exist or is not accessible, the server will fail to start.
Add the following configuration to your claude_desktop_config.json
file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"line-mcp": {
"command": "npx",
"args": ["line-mcp", "your_line_email@example.com", "your_line_password", "/path/to/storage/directory"]
}
}
}
You can also specify a working directory (cwd
) for the MCP server. This is useful when using relative paths or when you want to set a specific base directory for the server's operations:
{
"mcpServers": {
"line-mcp": {
"command": "npx",
"args": [
"line-mcp@latest",
"your_line_email@example.com",
"your_line_password",
"./line_auth_storage"
],
"cwd": "/path/to/your/project/directory"
}
}
}
Configuration Options:
command
: The command to execute (usuallynpx
)args
: Array of command line arguments including package name, email, password, and storage pathcwd
(optional): Working directory for the MCP server execution. When specified, relative paths in the arguments will be resolved relative to this directory.
Important:
- Replace
your_line_email@example.com
andyour_line_password
with your actual LINE account credentials. - Replace the storage path with the directory or file where authentication tokens will be stored.
- The storage directory must exist: If the specified storage path does not exist, the server will fail to start with an error.
- When using
cwd
, you can use relative paths like./line_auth_storage
for the storage path, which will be resolved relative to the specified working directory.
Main dependencies:
@evex/linejs
: LINE client library@modelcontextprotocol/sdk
: MCP server development kittiktoken
: Token countingzod
: Schema validationdotenv
: Environment variable management
- This server provides full access to your LINE account
- Use only in trusted environments
- Regularly check your LINE account login history
Symptoms: Error occurs with login
tool
Solutions:
- Check if command line arguments (email and password) are correctly set in Claude Desktop configuration
- Verify LINE account is valid and using correct credentials
- Consider using app password if 2FA is enabled
Symptoms: get_contacts
tool returns empty results
Solutions:
- First check login status with
status_login
- If not logged in, run
login
tool - Check if contacts are synced in LINE app
Symptoms: Error occurs with send_message
tool
Solutions:
- Verify recipient's MID is correct (can be obtained via
get_contacts
) - Check login status
- Verify LINE account is not under message sending restrictions
Symptoms: Server fails to initialize or start Solutions:
- Verify the storage directory path exists and is accessible
- Check directory permissions (read/write access required)
- Ensure all three command line arguments are properly specified in Claude Desktop configuration
- Create the storage directory manually if it doesn't exist
- Currently supports only text message sending (images, files etc. not supported)
- Group chat functionality not implemented
- Use in accordance with LINE's terms of service and API limitations
MIT License
Pull requests and issue reports are welcome.
If you encounter issues, please check:
- Command line arguments configuration in Claude Desktop
- LINE account status
- Network connection
- Claude Desktop configuration
For additional support, please create an issue.