MCP server talking to Bark notification server for iOS
Project description
bark-mcp
A Model Context Protocol (MCP) server that connects to Bark, a notification server for iOS. This allows LLM applications to send notifications to iOS devices through the MCP standard.
Features
- Simple MCP server implementation using FastMCP
- Single tool:
notifyto send notifications to iOS devices - Configurable via environment variables
- Easy to use command-line interface
Installation
# Install from PyPI
pip install bark-mcp
# Or install from source
git clone https://github.com/yourusername/bark-mcp.git
cd bark-mcp
pip install -e .
Configuration
The server requires the following environment variables:
BARK_SERVER_URL: URL of the Bark server (e.g.,https://api.day.app)BARK_API_KEY: Your Bark API key/device key
You can set these variables in your environment or create a .env file:
BARK_SERVER_URL=https://api.day.app
BARK_API_KEY=your_api_key_here
Bark API Format
The server uses the Bark API with the following URL formats:
GET /{bark-key}/{title}/{content}?url={url}(when title and URL are provided)GET /{bark-key}/{title}/{content}(when only title is provided)GET /{bark-key}/{content}(when only content is provided)
Usage
Command Line
Start the MCP server using either of these commands:
# Using the standard command (after installing the package)
bark-mcp
# Using uvx (runs without installing the package)
uvx bark-mcp
Both commands support the same options:
# Specify a .env file
bark-mcp --env-file /path/to/.env
# or
uvx bark-mcp --env-file /path/to/.env
# Enable debug logging
bark-mcp --debug
# or
uvx bark-mcp --debug
Note:
uvxis a command from theuvpackage manager that runs Python tools in temporary, isolated environments without installing them permanently. Install it withpip install uv.
Using with MCP Clients
The server provides a single tool:
notify: Send a notification to an iOS device- Parameters:
title(optional): Title of the notificationcontent(required): Content of the notificationurl(optional): URL to open when the notification is tapped
- Parameters:
Example usage in an MCP client:
# This would be handled by the MCP client
result = await call_tool("notify", {
"title": "Hello from MCP",
"content": "This is a notification sent via MCP",
"url": "https://example.com"
})
Development
Prerequisites
- Python 3.8+
- FastMCP
- Requests
- Python-dotenv
Running Tests
# TODO: Add testing instructions
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bark_mcp-0.1.0.tar.gz.
File metadata
- Download URL: bark_mcp-0.1.0.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b5e05b79af59f39babf3ba7ad939ab68d642b9167dd81b14796c509a34f19a5
|
|
| MD5 |
530aa28dfc995933eb2ca07b55661ab4
|
|
| BLAKE2b-256 |
989ba243fe9338e26cf113fa47508cc03f19299dec872e7ae186a3c92601c692
|
File details
Details for the file bark_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: bark_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0501536d0cdbdefafc24e863017a5a04851bdb3c52cd430b8818c382af313d32
|
|
| MD5 |
dee18f66125a798fe9d18095d3c77a18
|
|
| BLAKE2b-256 |
9165f87165804d3d7b2ac740921324068e00f818984e50490cf3ef7e3ed7ab56
|