Headless Anytype Client for Server-Based Automation

,

WHAT DO YOU RECOMMEND?

A headless version of the Anytype client that can run in a server or containerized environment. This version would operate as an always-on service, exposing the local API and MCP server to external automation tools. The goal is to empower users and developers to manage shared spaces remotely, trigger automated workflows, and integrate Anytype into server-side infrastructures—without requiring the desktop client.

The headless client should only access specific shared spaces. So it joins like a regular user. This means it can manage a single shared space, but not the full internal structure of Anytype.

HOW COULD IT BE DONE?

Develop a dedicated headless client that includes core Anytype functionality without the graphical user interface. This could be implemented by extending the current Anytype client to support a --headless flag—similar to how Chrome can run in the background without a UI. This headless client would run in environments like Docker and be fully configurable via environment variables and command-line arguments.

Example docker compose:

´´´
sevices:
anytype-headless:
image: anytype/headless:latest
environment:
- ANYTYPE_SPACE_LINK=https://space.anytype.io/invite/xyz123
- API_PORT=8080
- MCP_PORT=8081
ports:
- “8080:8080” # API
- “8081:8081” # MCP Server
´´´

REAL WORLD USE CASES

A headless client would enable a variety of practical, automated scenarios:

  • HR systems could automate workspace generation and onboarding flows using employee data.
  • Content teams could sync external sources via scheduled scrapers, pushing updates into Anytype without manual input.
  • Integration with CRM and project management tools could trigger cross-platform updates or real-time notifications in shared spaces.
  • n8n automations using MCP can crawl information and summarize it directly into Anytype.

These workflows require continuous background operation and secure API access, which a headless service would provide.

RECOMMENDED ALTERNATIVES

Current workarounds involve keeping the desktop client running alongside local scripts, which limits reliability and flexibility. An official headless client would close this gap and provide a stable foundation for advanced automation without rewriting much. I hope so.

Official’s Self-Host AnyType seems to fit your needs perfectly, Let’s see if there’s a relevant update to follow

hey @juliankropp @qusay, self-hosting serves a different purpose. we’ve received that request of ‘headless instance’ frequently since the api release, and therefore gonna provide a solution of course:)

i’m currently working on anytype-cli, which allows running the anytype core, specifically anytype-heart, in headless mode. this will allow, for example, continuous exposure of the api on the server side for the use cases you mentioned.

i’ll share more information on that soon!

jojojo - go for it! That’s exactly the groundwork needed. And then you can turn towards the headless containerized option @JulianKropp mentions. BTW: Julian’s have fantastic ideas^^ The name implies it. Here is another Julian^^
I’m currently working my way through the MCP server, taking a stab at upgrading the tools and wrapping my head around the API specs etc. - work in progress, just started.
I’m especially looking into the use-cases Julian outlined. I use N8N extensively, thus want to connect Anytype to my RAG, etc. etc. And yes - HR…that’s a lovely use-case with potential selling character :slight_smile:

Hmmm Julian… Sorry but I’ve to say it.

Definitely check out Julienhimself on yt.

I’m dreaming of a lot of use cases with n8n and the headless Anytype.

@jannis Is there already a rough ETA when this would be possible? :slight_smile:

Any update on this?

I’ll continue on the nagging, any ETA? :heart:

hey everyone, thanks for your patience - we haven’t forgotten about this!

there was a slight delay due to authentication changes, but we’re merging those on protocol side. i’ll open the repository and share a build to test in the coming days:)

:ship: Good news everyone - the wait is over!

The first version of anytype-cli is finally out, enabling the server-side and automation workflows discussed here. You’ll find installation, Quickstart, and further Notes in the README.md - check it out to get up and running!

One key concept: the headless middleware uses a dedicated bot account, created via anytype auth create. This generates an account key for authentication (you don’t use your existing mnemonic there). The bot only accesses spaces it explicitly joins, and you can revoke its access anytime from the desktop app.

If you encounter issues on specific platforms or have early feedback, please let us know so we can polish things before the broader announcement - it’s very much appreciated!

Cheers, Jannis:)

Thanks a lot for this - a much-appreciated contribution!

is it christmas already? thank you, I will try this out asap :smiley:

edit:

some questions come to mind:

  • only works in local networks via P2P or can I make this reachable globally?
    • you mention reverse proxies and remote access in the readme so I’m curious how my desktop client could sync with it remotely via a reverse proxy if it doesn’t know about it’s existence…
  • CLI becomes a bot account, that gets added to my space?
    • so I could in theory add this bot to multiple anytype accounts (like my partner and me)
      • but when I have API access to that CLI client I would have access to objects of both I guess - so I could, but I should not
        • is it then be possible to have two headless CLI clients running, on different ports, for different accounts, on the same machine?
  • how are files handled? get all the files synchronized as well?
  • can this be used in a self hosted network?
    • well, I guess so if it only works P2P, the network shouldn’t play a role here, right?

@krst Almost haha;) Let me know how it goes! I recorded a quick walkthrough video that takes you from installation to creating an API key, which you can then use to interact with the API:

To clear up a few of your open questions:

  • anytype-cli behaves like a full client in terms of sync and networking - just without the head (e.g. desktop frontend client). It syncs over the Anytype network exactly as the desktop app does.
  • The main use case is running it continuously on a remote/home server for API access. When we talk about making it available through a proxy, we mean exposing the API endpoint (127.0.0.1:31012)
  • Your bot can join as many spaces as a regular account. Through the API, it can access objects in any space it has joined. It’s easy to revoke its access from all spaces if your server or account key is ever compromised.
  • The initial release supports accounts created and synced within the Anytype network. Full support for self-hosted networks will require some additional adjustments. If you wish, you can open an issue in the repo to track the request.

Hope that helps:)

thank you for clearing some things up.
now you need to tell us about your terminal emulator that I don’t know about :wink:
edit: it’s Warp it seems, fancy :glowing_star:

you’re welcome. and yep hehe, it’s warp with starship on top :sparkles:

so it is nut much of use if I would like to use it as a full backup that is always fully synced (including files)?
would other clients see it in a local network for P2P purposes or is it just of use for API access?

I think that has been addressed earlier:

The only remaining catastrophic scenario, as far as I understand, is if AnyType servers go down. Then it should be possible to synchronize via LAN. This may or may not be possible, depending on where the backup instance is. If it is at physically accessible location, then fine. If it is in the cloud somewhere, then it is effectively unusable. Export via API calls, or something along those lines, would work. This is something we should polish, eventually.

because this headless client runs on other ports than the full client, I wonder if P2P works automatically or if it only works via an API where the endpoint (IP+Port) is specifically defined.

From my (limited) understanding of p2p communication, the ports don’t really matter. An instance is technically not a server but a peer. Peers advertise their abilities (offer) to a signaling server of some sort, or use a broadcast (mDNS) on a local network. So, this instance will simply announce that it is available at that alternative port/protocol/ip address, whatever. Should not make any difference in practical terms.