line-mcp
v0.2.4
Published
Model Context Protocol (MCP) server for LINE messaging integration with AI assistants.
Readme
LINE MCP Server
English | 日本語
Model Context Protocol (MCP) server for LINE messaging integration with AI assistants.
Overview
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.
Key Features
- 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
Target Users
For General Users
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
For AI Assistant Users
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
Technical Specifications
Available Tools
1. login
Description: Login to LINE using command line arguments
Parameters: None
2. get_contacts
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
3. send_message
Description: Send message to specified user
Parameters:
to(required, string): Recipient's MIDmessage(required, string): Message to send
Setup
Command Line Arguments
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 [email protected] 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.
Claude Desktop Configuration
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
Basic Configuration
{
"mcpServers": {
"line-mcp": {
"command": "npx",
"args": ["line-mcp", "[email protected]", "your_line_password", "/path/to/storage/directory"]
}
}
}Configuration Options:
command: The command to execute (usuallynpx)args: Array of command line arguments including package name, email, password, and storage path
Important:
- Replace
[email protected]andyour_line_passwordwith your actual LINE account credentials. - Replace the storage path with the directory or file where authentication tokens will be stored.
Dependencies
Main dependencies:
@evex/linejs: LINE client library@modelcontextprotocol/sdk: MCP server development kittiktoken: Token countingzod: Schema validationdotenv: Environment variable management
Security Considerations
Access Control
- This server provides full access to your LINE account
- Use only in trusted environments
- Regularly check your LINE account login history
Troubleshooting
Common Issues
1. Cannot Login
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
2. Cannot Get Contacts
Symptoms: get_contacts tool returns empty results
Solutions:
- First check login status with
status_login - If not logged in, run
logintool - Check if contacts are synced in LINE app
3. Cannot Send Messages
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
4. Server Fails to Start
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
Limitations
- 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
License
MIT License
Contributing
Pull requests and issue reports are welcome.
Support
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.
