MCP
org-lsp mcp is a Model Context Protocol server: it gives an AI
assistant (Claude Code, Claude Desktop, Cursor and others) your agenda as
Org builds it, so it can answer "what is due this week" or "what is tagged
work" from your Org files rather than from searching their text, and
reads an entry whole, the clock report, org-roam's notes and org-journal's
entries. It only reads, unless you let it change TODO states, dates, tags,
properties and notes, capture, refile, archive and delete
(Changing files). Its prompts ask the assistant to plan
your day, review your week or go through your inbox, with the data that
takes (Prompts).
Setting it up#
The agenda files and options are those of the shared configuration file
(~/.config/org-lsp/config.toml, see Configuration): set
org_agenda_files there, and org-lsp config shows what is read. They are
read again at each call. With no org_agenda_files, the agenda is built
from the Org files under the directory the server runs in.
org_agenda_files = ["~/org"]The assistant runs org-lsp mcp over standard input and output. In Claude
Code:
claude mcp add org-lsp -- org-lsp mcpIn Claude Desktop, Cursor and the like, in their MCP settings:
{
"mcpServers": {
"org-lsp": { "command": "org-lsp", "args": ["mcp"] }
}
}Give the full path of org-lsp when it is not on the PATH the assistant
starts it with (where the editor plugins downloaded it, for example).
Tools#
Each view answers its text, as org-lsp agenda prints it and Org's
agenda shows it, and each entry's line ends with where its headline is:
its file and line, from 1.
Global list of TODO items of type: ALL
tasks: TODO Write the report :work: [tasks.org:12]The file goes by its name when no other agenda file has the same, else by
its path. It is what set_todo_state, refile and the other tools that
change an entry take.
agenda- the agenda of some days (
org-agenda-list);span(day,week, the default,fortnight,month,yearor a number of days),start(a day it includes,YYYY-MM-DD),log(what was closed and clocked). todo_list- the TODO entries not done (
org-todo-list), or those ofkeywords(NEXT|WAIT). tags_search- the entries a
matchstring selects (org-tags-view), only those with a TODO keyword withtodo_only. text_search- the entries whose text has the words of
query(org-search-view), only those with a TODO keyword not done withtodo_only. custom_agenda- a command of
org_agenda_custom_commands, by itskey. agenda_files- the files the agenda is built from.
capture_templates- the capture templates (
org_capture_templates): each one's key, description, type, target and template, and the questions it asks. refile_targets- the places an entry can be refiled to, as
org-refilefinds them (org_refile_targets, by default the top-level headlines of the entry's file) and names them in its prompt (org_refile_use_outline_path), each followed by where it is:Projects/Garden/ [projects.org:4], or[projects.org]for the top level of a file.fileis the file of the entry to refile: the targets of the current file are its headlines, and its own are named without their file, asorg-refileoffers them there; without it, those are the agenda files' headlines, and every target names its file, as from the agenda.filterkeeps the targets whose name has its text. It is there withmcp_editsoff too. entry- the whole text of an entry:
fileandlineare the[file:line]of a view, andheadline, as forset_todo_state, text the headline has. It answers where the entry is, its outline path, category, TODO keyword,SCHEDULED,DEADLINEandCLOSED, its tags and those it inherits (org_use_tag_inheritance,org_tags_exclude_from_inheritance), its properties and those it inherits (org_use_property_inheritance, marked(inherited)), the time clocked in its subtree and in the entry itself, and a clock running in it; then its subtree, or withsubtreefalsethe entry alone, up to its first child. It reads the agenda files, and org-journal's and org-roam's files when they are on. clock_report- the clock table
org-clock-reportwrites for the agenda files (:scope agenda), withorg_clock_clocktable_default_properties,org_clocktable_defaultsand the other clock table options: what is between its#+BEGIN:and#+END:lines, the caption and the table.spanis its:block(today,yesterday,thisweek,lastweek,thismonth,lastmonth,thisyear,lastyear, or a period such as2026-10,2026-W42or2026-10-21); orstartandendare days,endincluded (:tstart, and:tendthe day after); with none of them, all the time clocked.filemakes the table of one agenda file, asorg-clock-reportin it (:scope file);maxlevelis its:maxlevel. roam_find- org-roam's nodes as
org-roam-node-findoffers them, a line for each title and alias formatted withorg_roam_node_display_template, the files changed last first; then, for an alias, the node's title, its tags, its ID and where it is.querykeeps the lines that have all its words, in any case. roam_node- an org-roam node, by its title, an alias or its
ID(node): where it is, its aliases, tags and references, its text (the file for a file's node, else its subtree), then the sections of the org-roam buffer thatorg_roam_mode_sectionslists, as it shows them: Backlinks and Reflinks, each place with the outline path to it, where it is and the text around it, and Unlinked References, also withunlinked, each line that names the node. journal_entries- org-journal's entries of the day
date(by default today), or of the days fromstarttoend, each asorg-journal-read-entryfinds it, with its day and where it is: the headline of its date and its subtree, or the whole file of the day whenorg_journal_date_prefixmakes no headline.
roam_find and roam_node say that org-roam is not enabled unless
org_roam_enabled is on, and journal_entries the same of org-journal and
org_journal_enabled. They read the files on disk again at each call, as
org-roam-db-sync would, and keep no database.
What differs from the editor's agenda#
The tools build the agenda with the settings the server builds it with
(TODO keywords, priorities, tags, habits, the clock report, custom
commands, org-journal's files), but start no Emacs: a diary sexp that
calls other Lisp (%%(my-function)) shows nothing, and a %(…) in
org_agenda_prefix_format is left empty. Settings given only in the
editor (its own options rather than the configuration file) are not seen.
clock_report does not know the editor's clock, so the time of a clock
running counts only once it is stopped
(org_clock_report_include_clocking_task has nothing to count).
Changing files#
With mcp_edits on in the configuration file, the assistant also gets
tools that change files. They go through the code the editor's commands
go through, with the same settings, and say what Emacs says.
mcp_edits = trueset_todo_state- change the TODO state of an entry, as
org-tododoes.fileandlineare the[file:line]of a view (a path works too);stateis a keyword, or""for none;noteis the note of a state that asks for one (@inorg_todo_keywords, ororg_log_done"note");headlineis text the headline has, such as its title, and when the line no longer has it the file has changed and nothing is done. It logs asorg_log_done,org_log_into_drawerand the keywords'!and@say; a repeating entry gets its next date and stays not done; withorg_enforce_todo_dependencies, a blocked entry is refused with Org's message. It answers Org's message, if there is one, and the new headline. capture- file a new entry with one of the capture templates, as
org-capturedoes with:immediate-finish.templateis its key;textis what%iputs in, or, in a template without%i, what goes where%?is, as if typed in the capture buffer;answersanswers the template's questions (%^{Prompt},%^t,%^g,%^{NAME}p, andDate for tree entrywithtime_prompt), as an object from each prompt to its answer or a list in the order they are asked;linkanddescriptionare the link of%aand%l. A question left without an answer is refused, with the list of the questions, for the assistant to ask you. The target file is made when it is not there. It answers the file, the line and the text filed. refile- move an entry and its subtree under another headline, as
org-refiledoes: its levels change to fit there, and it goes last among the target's children, or first withorg_reverse_note_order.file,lineandheadlineare as forset_todo_state;targetis a namerefile_targetsgives (from the entry's file or without one), the[file:line]of a target, or a file alone for its top level when the files are targets (org_refile_use_outline_path"file","title"or"full-file-path"). Withcopythe entry stays where it is too (org-refile-copy). It logs asorg_log_refilesays: with"note", the note isnote, and without one it is refused. Withorg_refile_allow_creating_parent_nodes, a target, a/and a new headline make that headline under the target first ("confirm"wantscreatetoo). An entry refiled into itself or its own subtree is refused with Org's message. It answers Org's message (Refile to "Garden/" in file /home/me/org/projects.org: done) and where the entry is now: its file, line and headline. schedule,deadline- set the entry's
SCHEDULEDorDEADLINEdate, asorg-scheduleandorg-deadlinedo.dateis read as Org's date prompt reads what you type (org-read-date, withorg_read_date_prefer_futureand the otherorg_read_dateoptions):2026-11-03,2026-11-03 10:00,+2d,fri,10am, from the date the entry has. The old date's repeater is kept; adatewritten as a timestamp brings its own (<2026-11-03 +1w>), asorg-schedulecalled with a time string does.removetakes the date out (C-u C-c C-s). A date the entry had is logged asorg_log_rescheduleandorg_log_redeadlinesay (or#+STARTUP: logreschedule); when they ask for a note, it isnote, and without one the change is refused. It answers Org's message (Scheduled to <2026-11-03 Tue>). set_tags- replace the entry's tags with
tags, a list or a string of tags separated by colons, asorg-set-tags-commandsets what you type;[]removes them. They are aligned atorg_tags_column. set_property- set the property
nametovaluein the entry's property drawer, asorg-set-propertydoes (org_property_format). When the property has allowed values (NAME_ALL,org_global_properties), only one of them will do; an emptyvaluekeeps the value it has, as Org's prompt does.TODO,PRIORITY,SCHEDULEDandDEADLINEchange the keyword, the priority and the dates as Org does (the last two asscheduleanddeadline, an empty value taking the date out);noteis the note a TODO change asks for. delete_property- delete the property
nameof the entry, and its drawer when it is left empty (org-delete-property). A name the entry does not have is refused, as Org's prompt takes only the entry's. set_priority- set the entry's priority as
org-prioritydoes:priorityis a letter or a number in the range oforg_priority_highestandorg_priority_lowest(or the file's#+PRIORITIES), or""to remove it. Out of range, it is refused with Org's message. set_effort- set the entry's
Effortproperty, asorg-set-effortdoes:valueis a duration (0:30,2h,1d, the units oforg_duration_units), one of the allowed values (Effort_ALL) when there are some. add_note- add the note
noteto the entry, asorg-add-notedoes: with its heading oforg_log_note_headings, in the drawer oforg_log_into_draweror under the headline, first or last asorg_log_states_order_reversedsays. archive- archive the entry and its subtree.
methodsubtree, the default, moves it to its archive file asorg-archive-subtreedoes: whereorg_archive_location, the file's#+ARCHIVEor anARCHIVEproperty says, with whatorg_archive_save_context_infokeeps and as the otherorg_archiveoptions say; the archive file is made when it is not there.to_siblingmoves it under its parent'sArchivesibling (org-archive-to-archive-sibling,org_archive_sibling_heading), andtoggle_tagsets or takes out itsARCHIVEtag (org-toggle-archive-tag). It archives only from an agenda file. It answers Org's message (Subtree archived in file: /home/me/org/tasks.org_archive) and where the entry is now. delete_entry- delete the entry and its subtree, as
org-cut-subtreetakes it out: from its headline to the next headline of its level or above, with the blank lines before that one.headlineis required here, so that the entry deleted is the one meant. It deletes only in an agenda file. It answers Org's message (Cut: Subtree(s) with 51 characters) and the text deleted, which put back at the entry's line restores it.
These tools take the entry as set_todo_state does: file, line and
headline. They answer Org's message, if there is one, and the entry's
headline as it is now.
All of them take dry_run: they answer the change as a diff of each file
it changes, and write nothing.
They change only the agenda files and the targets of the capture
templates, refile the files of org_refile_targets too, archive
only the agenda files and their archive files (that of
org_archive_location, and those an agenda file names with #+ARCHIVE or
an ARCHIVE property when they are in the directory of an agenda file or
below), and delete_entry only the agenda files. What needs
Emacs or the editor is refused: a template with %(…) or a function
target, a clock target or clock_in, as there is no clock, and
refiling while org_refile_target_verify_function is set (both
refile_targets and refile refuse then). org_capture_templates_contexts is not looked at:
every template can be used. Stopping the clock of an entry that is done
(org_clock_out_when_done) is left to the editor.
The files are written directly, each at once (into a file beside it,
which then takes its place), and read again at each call. A refile to
another file writes two: the target first, then the file the entry came
from, so that if the second write fails the entry is in both files, never
in none; refiling within a file is one write. Archiving to an archive file
writes it first in the same way, then the file the entry came from. A file
that is read-only is not written (Buffer is read-only: #<buffer
tasks.org>), nor one that has changed since the tool read it, as when an
editor saved it meanwhile: nothing is written then, and the tool says so.
No editor is asked: one that has the file open with unsaved changes may
save over the change, or ask which to keep. Save your files before an assistant changes
them, and use dry_run to see a change first.
Prompts#
The server also has prompts: messages you send the assistant, which
bring the data of a task, read from your files at that moment as the
tools read them, and say what to do with it. Claude Code shows them as
slash commands, /mcp__org-lsp__plan_my_day and so on, their arguments
after them (/mcp__org-lsp__plan_my_day 2026-10-23); other assistants
list them in their own way. Dates are YYYY-MM-DD.
plan_my_day- the agenda of the day
date(by default today), the TODO entries with a deadline in the next 14 days or past, and those in progress (the keywords not done that start no sequence and say no waiting, such asNEXT; the whole TODO list when there are none). It asks for a plan of the day in time blocks, its conflicts, and to schedule what the plan gives a time. weekly_review- the agenda of the week of
week(a day of it; by default this week) in log mode, what was closed and clocked, the clock report of the week, the stuck projects (org_stuck_projects) and the agenda of the next week. It asks for a review: what got done, what slipped, what is stuck, the priorities of the next week, and changes. process_inbox- the entries of the inbox, each with its
[file:line]and text, the refile targets from the inbox's file, the tags in use (org_tag_alistand the agenda files') and the TODO keywords. The inbox is the headlineheadline(a title, or an outline pathA/B) offile, or its top level withoutheadline; by default the target of the first capture template (a file, or a headline or outline path in it), else the firstInboxheadline of the agenda files. It asks for a refile target, tags, a TODO state and a date for each entry. daily_standup- the agenda of the day before
date(by default today) in log mode and its clock report, the agenda ofdate, and the TODO entries whose keyword says they wait (WAITING,HOLD,BLOCKED,DELEGATEDand the like). It asks for a short standup: yesterday, today, blockers. find_stale_tasks- the open TODO entries of the agenda files with no
date in the last
daysdays (30 by default) nor one ahead: noSCHEDULEDorDEADLINE, clock, logged note or other timestamp in the entry since then; the oldest first. It asks what to do with each: reschedule, close, archive, delete or keep.
The prompts that may lead to changes (all but daily_standup) tell the
assistant to propose them first, show each with dry_run, ask you to
confirm, and only then make them with the edit tools, which are there
with mcp_edits on; without it, to tell you what to change.