English
MCP server
On Android, Moodiary can run a local Model Context Protocol (MCP) server over Streamable HTTP so external MCP clients can read, search, and edit your diaries.
Android only
The local MCP server is currently available on Android and is turned off by default.
Turn it on
- Open Settings → Features → MCP server and turn on the switch.
- Copy the endpoint address, or tap Copy client config to copy an example
mcpServersJSON snippet. - Add it to an MCP client that supports Streamable HTTP: clients that use the
mcpServersformat can paste the snippet directly, while clients using another schema (such as VS Code'sservers) should enter the endpoint URL andAuthorization: Bearer <token>header in their own format.
The endpoint has the form http://<host>:<port>/mcp (default port 8765; configurable between 1024 and 65535). Every request — including loopback requests — must include an Authorization: Bearer <token> header.
json
{
"mcpServers": {
"moodiary": {
"url": "http://127.0.0.1:8765/mcp",
"headers": {
"Authorization": "Bearer <your-token>"
}
}
}
}Access modes and security
- This phone only (
127.0.0.1, default): only clients running on the same device can connect. - LAN access: lets another device on the same Wi-Fi connect using your phone's LAN IP. When enabled, tapping Copy client config lets you pick either the local or LAN address.
- Token management: tap Token to view, copy, or regenerate the access token. Regenerating a token invalidates the previous one immediately, so connected clients will need the new one.
- App lock: App Lock protects only the app interface; while the MCP server is running, authenticated clients keep access even when the app is locked. Turn the server off when not in use.
LAN traffic is unencrypted
LAN access uses plain HTTP, meaning others on the same network may be able to see the token and diary content in transit. Only enable LAN access on a trusted network, and treat your token carefully — anyone holding it can read and edit your diaries.
Background running
The server stays available while the app process is alive. While running, Moodiary shows an Android foreground-service notification (with a Stop button) to help keep the server active.
You can check Background running on the MCP settings page to grant notification permission and disable battery optimization if Android stops the server too quickly.
Available tools and prompts
The MCP server exposes the same shared diary tools used by the in-app assistant, plus media tools and prompts:
- Diaries:
get_diary,create_diary,update_diary,delete_diary,search_diaries,get_diary_links,list_tags - Categories:
list_categories,create_category,update_category,delete_category - Statistics:
get_stats - Media:
list_diary_media,read_diary_media(images only),add_diary_image,add_diary_attachment - Prompts:
daily_review,summarize_period,find_connections
Good to know
delete_diarymoves entries to the recycle bin; permanent deletion is always done inside the app.search_diariessupports keyword, semantic (meaning), and combined (auto) modes; semantic search depends on the local embedding model being downloaded and falls back to keyword search when unavailable.- Tags are case-sensitive and are matched via the tag filter in
search_diariesrather than full-text search. - If an MCP client and an open in-app editor save the same entry around the same time, the later save wins.