Skip to main content
Glama

LocalSend MCP Server (localsend-mcp)

License: MIT Runtime: Node.js 22+ Protocol: LocalSend v2.1

A high-performance, zero-external-dependency Model Context Protocol (MCP) server that connects AI assistants (Google Antigravity, Claude Desktop, Cursor) directly to physical devices across your local Wi-Fi / LAN using the LocalSend protocol.


⚡ Key Capabilities

  • Bidirectional Local P2P Sharing:

    • Outbound (AI Agent $\rightarrow$ Device): Deliver generated artifacts, code files, research papers, and images directly to smartphones, tablets, and laptops.

    • Inbound (Device $\rightarrow$ AI Agent): Send photos, voice memos, logs, or documents from your phone directly into the agent's download folder.

  • Recursive Folder Hierarchy Preservation: Automatically maps and retains directory trees using normalized relative paths (e.g. Folder/sub/file.mp4), enabling destination devices (like Android and iOS) to recreate and nest the full folder structure upon receipt.

  • Direct Text & Clipboard Push: Send code snippets, terminal commands, or notes straight to target devices without writing temporary files to disk.

  • LAN Auto-Discovery: Finds active LocalSend peers via UDP multicast (224.0.0.167:53317) and catches HTTP registration handshakes.

  • Desktop App Co-existence: Runs a persistent background listener on port 53318 so both the official LocalSend desktop application (53317) and this MCP server run seamlessly together on the same machine.

  • Clean LocalSend Favoriting: Actively responds to POST /api/localsend/v2/register with 200 OK, allowing mobile and desktop LocalSend apps to favorite/star the agent without connection errors.

  • In-Process X.509 Cryptography: Generates TLS keys and ASN.1 DER certificates purely in-memory using Node.js crypto—no external openssl binary required on Windows, Linux, or macOS.


Related MCP server: filesystem-mcp

🛠️ MCP Tools Exposed

Tool

Parameters

Description

localsend_devices

timeoutSeconds (opt)

Scans the Wi-Fi/LAN for online LocalSend peers, returning their alias, IP, port, and device model.

localsend_send

to (req), files (opt), text (opt), pin (opt)

Sends files, directories, or direct text snippets to a peer by alias or IP.

localsend_status

none

Displays local network IPs, active listening port, fingerprint, and inbox statistics.

localsend_history

none

Lists files received into the agent's download directory.

localsend_setup

alias (opt), downloadDir (opt)

Configures the broadcast alias, auto-save directory, and transport protocol.


🚀 Installation & Build

cd F:\Aaradhya-Dev-Tamrakar\localsend-mcp

# Install dependencies
npm install

# Compile TypeScript to dist/
npm run build

🔄 Automated Git Synchronization (sync.ps1)

The repository includes a dedicated PowerShell synchronization script that enforces pre-commit secret scans, automatically recompiles TypeScript when source files change, and formats conventional commits:

# Routine build, commit, and push
.\sync.ps1

# Custom commit message
.\sync.ps1 -m "feat(localsend): add automatic clipboard sync"

# Safe rebase pull only
.\sync.ps1 -PullOnly

# Dry-run mode (preview without changing git state)
.\sync.ps1 -WhatIf

⚙️ Configuration

Antigravity (mcp_servers configuration)

Add localsend-mcp to your Antigravity MCP settings:

{
  "mcpServers": {
    "localsend": {
      "command": "node",
      "args": ["F:\\Aaradhya-Dev-Tamrakar\\localsend-mcp\\dist\\index.js"]
    }
  }
}

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "localsend": {
      "command": "node",
      "args": ["F:\\Aaradhya-Dev-Tamrakar\\localsend-mcp\\dist\\index.js"]
    }
  }
}

🧪 Usage Examples

1. Discover Devices on LAN

{
  "name": "localsend_devices",
  "arguments": {
    "timeoutSeconds": 3
  }
}

2. Send an Artifact or Report to Your Phone

{
  "name": "localsend_send",
  "arguments": {
    "to": "V2029",
    "files": ["F:\\Aaradhya-Dev-Tamrakar\\brainstorm\\report\\main.pdf"]
  }
}

3. Push a Code Snippet Directly to Clipboard

{
  "name": "localsend_send",
  "arguments": {
    "to": "SFG16",
    "text": "Get-Process localsend_app | Select-Object Id, ProcessName",
    "textFileName": "inspect.ps1"
  }
}

4. Check Inbox for Files Sent From Mobile

{
  "name": "localsend_history",
  "arguments": {}
}

🔒 Security & Privacy

  • 100% Local: No internet connection, cloud servers, or third-party relays are used. All network packets stay strictly within your local subnet.

  • Mutual TLS (mTLS): All transfers use TLS encryption with client certificate presentation matching the LocalSend v2 specification.

  • Path Traversal Protection: Remote file names are sanitized to prevent directory traversal attacks.


📄 License

MIT © Aaradhya Dev Tamrakar

Available Tools

5 tools
localsend_devicesA

Scan the local Wi-Fi/LAN for active LocalSend devices and list their aliases, IPs, and models.

Inputs: timeoutSeconds.

localsend_historyA

List incoming files received by the LocalSend MCP server inbox.

Inputs: no named parameters.

localsend_sendA

Send files, folders, or direct text/clipboard snippets to a LocalSend device on LAN by alias or IP.

Inputs: to (required), pin, port, text, +4 more.

localsend_setupC

Update LocalSend MCP server configuration (alias, download directory, or transport).

Inputs: alias, downloadDir.

localsend_statusA

Inspect local network addresses, active MCP listening port, certificate fingerprint, and inbox status.

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool targets a distinct concern: device discovery, sending, server status, receiving history, and configuration. There is no overlap or ambiguity between tools.

    Naming Consistency4/5

    Names consistently use a localsend_ prefix and snake_case. However, not all follow a strict verb_noun pattern—devices, status, and history are nouns while send and setup are verbs—so it is mostly consistent with minor deviation.

    Tool Count5/5

    Five tools is well-scoped for a focused LocalSend integration. Each tool covers a necessary capability without redundancy or bloat.

    Completeness5/5

    The set covers the full local workflow: discovering devices, sending content, checking server status, reviewing received files, and updating configuration. No major gaps are apparent for the stated purpose.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers