Annotai.MCP (Annotai v0.1.0)

Copy Markdown View Source

Minimal MCP (JSON-RPC 2.0) handler that exposes annotations to an AI agent.

Register it with your agent (replace the port with your dev server's):

claude mcp add --transport http annotai http://localhost:4000/annotai/mcp

The tools fall into three groups:

  • reads — annotai_get_pending, annotai_get_annotation
  • lifecycle — annotai_acknowledge, annotai_resolve, annotai_dismiss, annotai_reply
  • annotai_watch_annotations — a hands-free loop that waits for new annotations

Lifecycle transitions are guarded by Annotai.Store.transition/3, so an annotation cannot be resolved or dismissed twice.

Summary

Functions

Handle one decoded JSON-RPC request map.

The JSON-RPC response for an unparseable request body.

Functions

handle(arg1)

@spec handle(map()) :: map() | :noreply

Handle one decoded JSON-RPC request map.

Returns a response map ready to encode, or :noreply for notifications (which expect no response body).

parse_error()

@spec parse_error() :: map()

The JSON-RPC response for an unparseable request body.