Skip to content

MCP server

facet mcp <dir> runs a Model Context Protocol server over standard input and output for the workspace folder. An agent can then find nodes, change them, check the plan and read its dates, without reading or rewriting the Markdown itself.

Each call reads the files again, so the tools see changes made in the editor or by another tool meanwhile. The server checks at start that the folder can be read (exit 2 if not), sends its diagnostics to standard error, and exits 0 when the client closes the connection.

Install the facet command first (Install). For Claude Code, add the server to the project’s .mcp.json, with the folder that holds your plans relative to the project:

{
"mcpServers": {
"facet": {
"command": "facet",
"args": ["mcp", "plans/"]
}
}
}

Other MCP clients take the same command and arguments in their own configuration. Without a global install, let npx fetch the package:

{
"mcpServers": {
"facet": {
"command": "npx",
"args": ["-y", "@foreachexists/facet", "mcp", "plans/"]
}
}
}

To pin the day every call uses, add "--today", "2027-01-15" to args; this helps in tests and demos.

Every tool takes an optional today (YYYY-MM-DD) for scheduling and lateness. Without it, the day given to facet mcp --today applies, else the local date at the time of each call.

The facet query filters as fields: ref, under, type, state, owner, text, dueBefore, dueAfter and late. type and state are lists of names; an empty list is no filter. It returns the same JSON array of nodes as facet query.

{ "type": ["task"], "state": ["todo", "doing"], "owner": "odile" }

ops (one op or an array of them, as for facet edit) and an optional dryRun. It returns the same output as facet edit, and is marked as an error when an op is refused or a file cannot be written; then nothing (or, for a failed write, only the files before it) was written.

{
"ops": [
{ "op": "id", "node": "trade-fair/plan.md:32" },
{ "op": "state", "node": "!stand-signed", "state": "done" }
],
"dryRun": true
}

No fields besides today. It returns the lint results as a JSON array of { severity, id, message, path, line, column }, with 1-based line and column; an empty array when the workspace is clean.

[
{
"severity": "warning",
"id": "late",
"message": "ends 2027-04-22, after its due date 2027-04-15",
"path": "trade-fair/index.md",
"line": 10,
"column": 3
}
]

No fields besides today. It returns, in tree order, every node with dates, a next occurrence or a reason it has none:

Field Holds
ref, path, line, title which node, and where its title starts
start, end local times YYYY-MM-DDTHH:mm; end is exclusive
next the next occurrence of a repeating task
undated why it has none: no-anchor, error, cycle, predecessor
milestone, box whether it is a milestone, or a box around its children
critical whether it is on its file’s critical path
late whether it ends after its due::

Unlike the text output of facet schedule, end here is exclusive: a two-week task from 1 February ends at 2027-02-15T00:00.

A call that cannot run returns an error result with a message: a bad today, a folder that cannot be read, an unknown filter value (type: unknown type "tsk" (…)) or a ref that does not resolve. Messages use the tool’s field names (dueBefore, not --due-before).