Anchorly MCP Server
**π Language / Dil:** English | [TΓΌrkΓ§e](README.tr.md)
# Anchorly MCP server
[](https://github.com/berkaycinar-dev/anchorly-mcp/actions/workflows/ci.yml)



A [Model Context Protocol](https://modelcontextprotocol.io) server for [Anchorly](https://github.com/berkaycinar-dev/Anchorly), a task and habit dashboard. It lets Claude Code, or any other MCP client, read and add tasks, complete them, and read projects, daily routines and the calendar of an Anchorly account. It talks to the [Anchorly API](https://github.com/berkaycinar-dev/anchorly-api) with a personal access token and runs locally over stdio.
---
## Tools
| Tool | What it does | API call | Scope |
| --------------- | --------------------------------------------------------------------------------------------- | ------------------------------------------------- | ----------------------------- |
| `list_tasks` | Tasks filtered by date range, status (`open`, `completed`, `all`) and project | `GET /tasks` | `tasks:read` |
| `get_today` | The Today page: tasks for the day, open tasks from earlier days, routines with today's checks | `GET /tasks`, `GET /routines`, `/routines/checks` | `tasks:read`, `routines:read` |
| `get_calendar` | Dated tasks grouped by day for up to 62 days (Anchorly's calendar is built from task dates) | `GET /tasks` | `tasks:read` |
| `create_task` | Add a task with title, date, time, category, project, description, importance and steps | `POST /tasks` | `tasks:write` |
| `update_task` | Change some fields of a task; `null` clears the date, time or project | `PATCH /tasks/{id}` | `tasks:write` |
| `complete_task` | Mark a task as done, or open it again | `GET /tasks`, `PATCH /tasks/{id}` | `tasks:read`, `tasks:write` |
| `list_projects` | Projects with their ids | `GET /projects` | `projects:read` |
| `list_routines` | Daily routines and whether each is checked on a day | `GET /routines`, `GET /routines/checks` | `routines:read` |
Project names are added to task results when the token has `projects:read`; without it, task tools still work. Every input is validated with Zod before a request is sent.
There is **no delete tool**. Deleting stays in the app, so a model cannot remove data by mistake.
---
## Requirements
- Node.js 22 or newer
- An Anchorly account
---
## Quick setup: Connect to Claude
1. Sign in to Anchorly and open **Settings > Access tokens**.
2. Select **Connect to Claude**. Anchorly creates a token named `Claude` with the scopes these tools use and shows a ready command with the token in it:
```bash
claude mcp add anchorly -s user -e ANCHORLY_TOKEN=anc_your_token -- npx -y github:berkaycinar-dev/anchorly-mcp
```
3. Paste the command into a terminal. The **Claude Desktop** tab shows the same setup as an `mcpServers` block for `claude_desktop_config.json`.
The command is shown only once, and it contains the token: keep it private. If a `Claude` token already exists, the button offers to create it again and revokes the old one.
## Manual setup
### 1. Create a token
1. In **Settings > Access tokens**, enter a name (for example `Claude Code`), keep the scopes you need and choose a lifetime.
2. Select **Create token** and copy the token. It starts with `anc_` and is shown only once; Anchorly keeps only its hash.
A token can be revoked on the same page at any time. It cannot change the account, password, sessions or settings, and it cannot create other tokens.
### 2. Add the server to Claude Code
Straight from GitHub with `npx` (the package is not published to npm; there is no build step):
```bash
claude mcp add anchorly -s user \
-e ANCHORLY_TOKEN=anc_your_token \
-- npx -y github:berkaycinar-dev/anchorly-mcp
```
Or from a clone:
```bash
git clone https://github.com/berkaycinar-dev/anchorly-mcp.git
cd anchorly-mcp
npm install --omit=dev
claude mcp add anchorly -s user \
-e ANCHORLY_TOKEN=anc_your_token \
-- node /path/to/anchorly-mcp/src/index.js
```
On Windows, start `npx` through `cmd`: `-- cmd /c npx -y github:berkaycinar-dev/anchorly-mcp`.
`-s user` makes the server available in every project; leave it out to add it only to the current one. Check the connection with `claude mcp list`, or `/mcp` inside Claude Code. Then ask, for example: "What is on my Anchorly list today?" or "Add a task to call the dentist tomorrow at 9:15".
### Claude Desktop
Add this to `claude_desktop_config.json` (Settings > Developer > Edit Config) and restart the app:
```json
{
"mcpServers": {
"anchorly": {
"command": "npx",
"args": ["-y", "github:berkaycinar-dev/anchorly-mcp"],
"env": { "ANCHORLY_TOKEN": "anc_your_token" }
}
}
}
```
The token is stored in the client's MCP configuration. Treat that file like a password, and revoke the token in Anchorly if it leaks.
---
## Configuration
| Variable | Required | Description |
| --------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------- |
| `ANCHORLY_TOKEN` | Yes | Personal access token that starts with `anc_` |
| `ANCHORLY_API_URL` | No | Only for a self-hosted Anchorly API, for example `https://your-anchorly-api.example.com`. Default: Anchorly's live API |
| `ANCHORLY_TIMEOUT_MS` | No | Time to wait for one API answer, 1000 to 300000. Default `90000` (90 seconds) |
See `.env.example`. The server reads only the environment; it does not load a `.env` file.
---
## Behaviour
- **Slow first request:** an API on a free hosting plan can sleep and take up to a minute to answer the first request. The server waits up to 90 seconds and tries once more after a timeout, a network error or a `502`, `503` or `504`. Repeating a request is safe: new tasks carry an id generated here, so a repeated create returns the same task, and updates set absolute values.
- **Today:** the local date of the machine running the server, unless a tool gets a `date`.
- **Same rules as the app:** new tasks are ordered by creation time, `get_today` shows what the Today page shows, and completing a task records the task's date (or today for undated tasks) as its completion date. Write requests send `X-Client-Time`, so the API's last-write-wins rule compares them with edits from the app.
- **Clear errors:** an invalid or revoked token, a missing scope, a missing task, a rate limit or an unreachable API each produce a short message that says what to do. The token never appears in messages; stdout carries only the MCP protocol and status lines go to stderr.
- **Repeating tasks:** `create_task` creates one-off tasks. Repeating tasks are set up in the app.
---
## Development
```bash
npm install
npm test # Vitest; every tool is checked against a mocked fetch
npm run lint
npm run format:check
```
Tests connect a real MCP client to the server in memory and check the HTTP requests each tool sends.
```text
src/
βββ index.js entry point: reads the environment, starts the stdio transport
βββ server.js creates the MCP server
βββ tools.js tool definitions and input schemas
βββ apiClient.js HTTP client: token, timeout, one retry, readable errors
βββ tasks.js filtering, sorting and the Today rule
βββ config.js environment variables
test/ tests and helpers
```
---
## License
[MIT](LICENSE)
TDQS
Scored across 8 tools
Most tools have clearly distinct purposes: reads (list_projects, list_routines, list_tasks), aggregate views (get_today, get_calendar), and writes (create_task, update_task, complete_task). The explicit cross-reference that complete_task handles completion while update_task handles field edits resolves the one obvious overlap. Minor residual overlap remains between list_tasks and the get_today/get_calendar views, but descriptions make the intended use of each reasonably clear.
All eight tools follow a strict verb_noun snake_case pattern: complete_task, list_projects, list_routines, list_tasks, get_today, get_calendar, create_task, update_task. The verbs are used consistently by intent (list_ for enumerations, get_ for composed views), with no mixed conventions.
Eight tools is well within the ideal 3-15 range and each earns its place: three list reads, two page-style aggregate reads, and three task mutations. No obviously redundant or trivial tool is included for the scope of a task-management server.
Task lifecycle is partly covered (create, update, complete) but there is no delete_task, leaving a real dead end for removing tasks. Projects and routines are read-only with no create/update or routine check/uncheck operation, so agents cannot manage those entities even though the server surfaces them.