Thortspace API
Your own programs can read and build Thortspace arrangements through the same address AI assistants use:
https://thort.cloud/mcp
It speaks MCP (Model Context Protocol): JSON-RPC 2.0 over HTTPS. Any language that can send an HTTPS request can use it, and so can any MCP client library that supports the Streamable HTTP transport. A program acts as the person whose token it holds, under the same rules: it can see and change only what they could in Thortspace.
New to Thortspace? Each idea is a Thort: one short thought. Thorts sit in groups, on spheres around a centre, and pathsteps join them. An arrangement is one whole layout, private, shared with a few people, or published. Try it at thort.cloud. Accounts are free.
Getting a token
- Sign in at thort.cloud.
- On your arrangements page, open Connect an AI assistant and choose Make a connection token.
- Copy the token. It is shown once, and lasts 90 days.
Send it with every request as Authorization: Bearer <token>. Treat it like a password: anyone who
has it can act as you. To cancel a token before it runs out, email
support@thortspace.com.
A token is for your own account. A program that other people use should sign each of them in with OAuth instead.
Calling a tool
Each request is a POST of one JSON-RPC message, and the answer comes back as JSON. There is no session to open:
every request stands alone, so initialize is answered but not needed.
To list the tools, with their inputs as JSON Schema:
curl https://thort.cloud/mcp \
-H "Authorization: Bearer $THORTSPACE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
To call one:
curl https://thort.cloud/mcp \
-H "Authorization: Bearer $THORTSPACE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call",
"params":{"name":"create_arrangement","arguments":{"name":"Where should we go on holiday?"}}}'
The answer:
{"jsonrpc":"2.0","id":2,"result":{"content":[{"type":"text","text":"Created \"Where should we go on holiday?\" (id f75c3538-3eef-44f0-8a86-9120e2961e48). Its home group is \"Where should we go on holiday?\" (id a88fa262-cf03-429e-bf14-bceb38840348)."}],"isError":false}}
A whole example in JavaScript
Node 18 or later, with your token in THORTSPACE_TOKEN. It makes an arrangement, adds a group and
three Thorts, joins two of them with a pathstep, and reads the result back.
// holiday.mjs: run with node holiday.mjs
const server = 'https://thort.cloud/mcp';
let requestId = 0;
async function call(name, args = {}) {
const res = await fetch(server, {
method: 'POST',
headers: { 'Content-Type': 'application/json', Authorization: 'Bearer ' + process.env.THORTSPACE_TOKEN },
body: JSON.stringify({ jsonrpc: '2.0', id: ++requestId, method: 'tools/call', params: { name, arguments: args } }),
});
if (!res.ok) throw new Error(res.status + ' ' + await res.text());
const { result, error } = await res.json();
if (error) throw new Error(error.message);
const text = result.content.map(c => c.text).join('\n');
if (result.isError) throw new Error(text);
return text;
}
const question = 'Where should we go on holiday?';
const made = await call('create_arrangement', { name: question });
const id = made.match(/\(id ([0-9a-f-]{36})\)/)[1]; // the arrangement's id comes first
await call('add_group', { arrangement_id: id, name: 'Costs' });
await call('add_thort', { arrangement_id: id, group: question, text: 'Somewhere warm in October.' });
await call('add_thort', { arrangement_id: id, group: 'Costs', text: 'Flights are cheaper midweek.' });
await call('add_thort', { arrangement_id: id, group: 'Costs', text: 'Half term doubles the price.' });
await call('link', { arrangement_id: id, from: 'Somewhere warm in October.', to: 'Half term doubles the price.', type: 'Leads to' });
console.log(await call('read_arrangement', { arrangement_id: id }));
The same in Python
Python 3, standard library only. Give your program a name in the User-Agent header: thort.cloud's
network (Cloudflare) turns away requests that carry the name Python's urllib gives them.
import itertools, json, os, re, urllib.request
SERVER = "https://thort.cloud/mcp"
request_ids = itertools.count(1)
def call(tool, **args):
body = {"jsonrpc": "2.0", "id": next(request_ids), "method": "tools/call",
"params": {"name": tool, "arguments": args}}
request = urllib.request.Request(SERVER, data=json.dumps(body).encode(), headers={
"Content-Type": "application/json",
"Authorization": "Bearer " + os.environ["THORTSPACE_TOKEN"],
"User-Agent": "holiday-example/1.0"}) # urllib's own name is turned away
with urllib.request.urlopen(request) as response:
reply = json.load(response)
if "error" in reply:
raise RuntimeError(reply["error"]["message"])
text = "\n".join(c["text"] for c in reply["result"]["content"])
if reply["result"]["isError"]:
raise RuntimeError(text)
return text
question = "Where should we go on holiday?"
made = call("create_arrangement", name=question)
arrangement = re.search(r"\(id ([0-9a-f-]{36})\)", made).group(1)
call("add_thort", arrangement_id=arrangement, group=question, text="Somewhere warm in October.")
print(call("read_arrangement", arrangement_id=arrangement))
What to expect
- Results are text, written to be read by a person or an assistant. Ids appear in brackets, as
(id …).read_arrangementgives a whole arrangement as an outline. - Names or ids. Many inputs take either an id or exact text: a group's name, or a Thort's text. Ids are safer when two things have the same words.
- When a tool can't do what was asked, the result has
"isError": trueand says why, such asNo group called that. Read the arrangement for the group names.A missing or expired token gets HTTP 401. An unknown method gets JSON-RPC error -32601. - The same rules as in the app. A program can do only what its person could. The free plan keeps 3 arrangements active at once: archive one to make room. Publishing is free.
- Changes are live. Anyone who has the arrangement open sees them straight away, and they can be undone
(
undo). - Thorts made through this address are marked as made by an AI, as an assistant's are.
Programs that act for other people (OAuth)
Sign each person in with OAuth 2.1: the authorization code flow, with PKCE (S256) and the scope
thortspace. The person signs in on Thortspace's own page and allows your program. Your program never sees
their password.
- Metadata:
https://thort.cloud/.well-known/oauth-protected-resource/mcpandhttps://thort.cloud/.well-known/oauth-authorization-server. - Register your program dynamically (RFC 7591), or use the URL of a client ID metadata document as its
client_id. Clients are public: there is no client secret. - An access token lasts an hour. A refresh token lasts 90 days, and is replaced each time it's used.
- A person can disconnect your program at any time, from their arrangements page.
When tools change
Thortspace is changing quickly, and tools can be added, changed or removed with it. tools/list always
gives the current set, and the list below is made from it. If your program depends on a tool, tell us at
support@thortspace.com, so that we know.
The tools
64 tools. Reads changes nothing. Adds only adds. Changes can change or remove what's there.
Arrangements
list_arrangements List arrangements Reads
List the arrangements this person can see: their own, ones they contribute to, and published ones. Archived ones come last, marked: they can be read but not changed until their owner brings them back.
No inputs.
read_arrangement Read an arrangement Reads
Read an arrangement as an outline: each group with its Thorts in order, and the pathsteps between them.
arrangement_idstring The arrangement's id.
create_arrangement Create an arrangement Adds
Create a new private arrangement. Its name becomes the home group.
namestring The arrangement's name, e.g. the question being thought through.
copy_arrangement Copy an arrangement Adds
Copy an arrangement this person can see into a new private arrangement of their own (where its owner allows copying).
arrangement_idstring The arrangement's id.
arrangement_settings Change an arrangement's settings Changes
Change an arrangement's settings (its owner only): its name, whether anyone may join it just by adding to it, and whether others may copy it. Give only what changes.
arrangement_idstring The arrangement's id.namestring, optional A new name.joining_openboolean, optional Anyone signed in can join by adding to it.copying_allowedboolean, optional Others may copy it as their own.
set_visibility Publish an arrangement, or make it private Changes
Publish an arrangement (anyone signed in can see it) or make it private.
arrangement_idstring The arrangement's id.publishedboolean
set_surface_colours Choose an arrangement's colours Changes
Choose the colours of an arrangement's sphere surface, which make it recognisable, even from a distance: one colour ("#rrggbb", a plain sphere) or two ("#rrggbb #rrggbb", bands of the two). Empty: back to the colours it had to start with. Only its owner can.
arrangement_idstring The arrangement's id.coloursstring "#rrggbb", "#rrggbb #rrggbb", or empty.
set_atmosphere Choose an arrangement's atmosphere Changes
Choose the colour of the atmosphere round an arrangement's sphere: a glow round it, fading into the space beyond, which helps make it recognisable. One colour ("#rrggbb"), or "none" for no atmosphere. Empty: back to one from the sphere's own colours. Only its owner can.
arrangement_idstring The arrangement's id.colourstring "#rrggbb", "none", or empty.
set_sky Choose the space round an arrangement Changes
Choose the space round an arrangement, which everything in it is seen against: its colour (its ambient) and what is in it: stars, clouds (shaded by the colour, fainter as it is darker) or plain. Either or both. An empty colour: back to the dark one; an empty kind: stars on a dark colour, clouds on a light one. Only its owner can.
arrangement_idstring The arrangement's id.colourstring, optional "#rrggbb", or empty for the dark one. Leave it out to keep it.kindstring, optional "stars", "clouds", "plain", or empty for stars or clouds by how light the colour is. Leave it out to keep it.
archive_arrangement Archive an arrangement, or bring it back Changes
Archive one of this person's arrangements (it stays readable, nobody can change it, and it no longer counts towards the free plan's 3 active arrangements), or bring an archived one back (archived false; within the plan's limit).
arrangement_idstring The arrangement's id.archivedboolean true to archive it, false to bring it back.
delete_arrangement Delete an arrangement Changes
Delete one of this person's own arrangements.
arrangement_idstring The arrangement's id.
search_arrangements Search what's published Reads
Search what people have published, as the home page does; with no query, the most popular arrangements and journeys.
querystring, optional What to look for; leave out for the most popular.
whats_new What's new Reads
What has happened lately: in this person's arrangements and ones they're in, and what was recently published (the home page's news).
No inputs.
undo Undo or redo Changes
Undo this person's last change in an arrangement (several made together go together), or redo what was undone.
arrangement_idstring The arrangement's id.redoboolean, optional true to redo instead.
Thorts and groups
add_thort Add a Thort Adds
Add a Thort (one short thought) to a group.
arrangement_idstring The arrangement's id.groupstring The group's id or its exact name.textstring The thought.
add_group Add a group Adds
Add a group (a theme) beside an existing group.
arrangement_idstring The arrangement's id.namestring The group's name.besidestring, optional The id or name of the group it sits beside; the home group if left out.
edit_thort Change a Thort's text Changes
Change the text of a Thort this person owns.
arrangement_idstring The arrangement's id.thortstring The Thort's id or exact text.textstring The new text.
set_notes Set a Thort's notes Changes
Set a Thort's notes: a longer elaboration of it (several sentences or paragraphs) for anyone who wants more than the Thort says. The Thort stays a concise statement. Only the Thort's owner can. An empty text removes them.
arrangement_idstring The arrangement's id.thortstring The Thort's id or exact text.notesstring The notes.
set_link Attach a web link Changes
Attach a link to any web page (http or https) to a Thort this person owns, or remove it with an empty link. Thortspace only stores the address; it doesn't fetch the page.
arrangement_idstring The arrangement's id.thortstring The Thort's id or exact text.urlstring The web page's address, or empty to remove the link.
set_picture Give a picture Changes
Give a Thort or group this person owns a picture from Wikimedia Commons; on a group it fills the group's background. Only public-domain or CC0 files are accepted (the server checks the licence on Commons and records the file page, licence and author). Empty file removes the picture.
arrangement_idstring The arrangement's id.thortstring The Thort's or group's id or exact text.filestring The Commons file: its title (File:Something.jpg) or the address of its file page.
set_category Give a category Changes
Give a Thort or group one of this person's categories (by name; made with this colour if new).
arrangement_idstring The arrangement's id.thortstring The Thort's or group's id or exact text.categorystring The category's name, or empty for none.colourstring, optional #rrggbb, used only if the category is new.
find_thorts Find Thorts said before Reads
Find Thorts already said, this person's own and published ones, close in meaning to some text. Each comes with its id, so that it can be used again.
textstring The thought.arrangement_idstring, optional Optional: an arrangement, to say which are in it already.
thort_places Where a Thort is Reads
List the arrangements a Thort is in (those this person can see).
thort_idstring The Thort's id.
insert_thort Use a Thort again Adds
Put an existing Thort, by its id, into a group here: the same Thort, shared, not a copy.
arrangement_idstring The arrangement's id.thort_idstring The Thort's id.groupstring The group's id or exact name.
move_thort Move a Thort to another group Changes
Move a Thort into another group.
arrangement_idstring The arrangement's id.thortstring The Thort's id or exact text.to_groupstring The group's id or exact name.
reorder_thort Change a Thort's place in its group Changes
Move a Thort to another place in its group's order (the order an arrangement's outline lists).
arrangement_idstring The arrangement's id.thortstring The Thort's id or exact text.positionnumber Its new place: 1 for first.
make_group Make a Thort a group Changes
Take a Thort out of its group to become a group of its own, beside the group it came from and joined to it.
arrangement_idstring The arrangement's id.thortstring The Thort's id or exact text.
merge_group Put a group into another Changes
Put a group into another group: its Thorts and embedded arrangements move across, and the group itself becomes a Thort there.
arrangement_idstring The arrangement's id.groupstring The group to put in (id or exact name).intostring The group it goes into (id or exact name).
remove_thort Remove a Thort or group Changes
Take a Thort out of an arrangement; a group goes with its Thorts. The Thorts stay their owners' (and stay in other arrangements). The home group can't be removed.
arrangement_idstring The arrangement's id.thortstring The Thort's or group's id or exact text.
delete_unused_thorts Delete unused Thorts Changes
Delete every Thort this person owns that no remaining arrangement uses (so no one else loses one).
No inputs.
vote Vote Changes
Vote for a Thort, a pathstep or the arrangement itself (+1), or take the vote back.
arrangement_idstring The arrangement's id.kindstring thort, pathstep or arrangement.thortstring, optional For a Thort: its id or exact text.fromstring, optional For a pathstep: one end.tostring, optional For a pathstep: the other end.onboolean true to vote, false to take it back.
Pathsteps
link Connect two Thorts or groups Adds
Join two Thorts or groups with a pathstep (a relationship).
arrangement_idstring The arrangement's id.fromstring Id or exact text of a Thort or group.tostring Id or exact text of a Thort or group.typestring, optional Optional: the kind of relationship (a path type by name, e.g. Leads to, Causes, Supports, Contradicts).colourstring, optional Optional #rrggbb for a new path type.
unlink Delete a pathstep Changes
Delete the pathstep between two Thorts or groups.
arrangement_idstring The arrangement's id.fromstring Id or exact text of one end.tostring Id or exact text of the other end.
set_path_type Give a pathstep its kind Changes
Give the pathstep between two Thorts or groups a kind of relationship (a path type, by name; made with this colour if new). Pathsteps between groups show in their type's colour.
arrangement_idstring The arrangement's id.fromstring Id or exact text of one end.tostring Id or exact text of the other end.typestring The path type's name, e.g. Leads to, Answers, Challenges, Supports; empty for none.colourstring, optional #rrggbb, used only if the path type is new.
Arrangements inside arrangements
link_arrangement Link another arrangement Adds
Show another arrangement in this one: linked (a sphere beside a group, or beside another linked arrangement) or embedded (inside a group).
arrangement_idstring The arrangement's id.groupstring The group's id or exact name.target_arrangement_idstring The arrangement to show.kindstring, optional linked or embedded.from_linkedstring, optional Optional: the id of the arrangement already linked here that the new one hangs from.
unlink_arrangement Take out a linked arrangement Changes
Take a linked or embedded arrangement out of this one (the arrangement itself stays).
arrangement_idstring The arrangement's id.target_arrangement_idstring The arrangement shown here.
move_embedded_arrangement Move an embedded arrangement Changes
Move an arrangement embedded in a group into another group.
arrangement_idstring The arrangement's id.target_arrangement_idstring The embedded arrangement.to_groupstring The group's id or exact name.
Placing
place_group Place a group by hand Changes
Place a group by hand, in a direction from level 0 (the home group unless given), as seen from where the view starts: above, below, left, right, front (towards the viewer), back, or two or three together ("above left"). The other groups at its level stay where they are. reset: back to where the layout would put it.
arrangement_idstring The arrangement's id.groupstring The group's id or exact name.directionstring, optional e.g. above, left, "below right", front.level0string, optional Optional: the group at level 0 (id or exact name).resetboolean, optional true: back to its automatic place.
turn_group Turn a group Changes
Turn a group about its middle, with everything in it.
arrangement_idstring The arrangement's id.groupstring The group's id or exact name.degreesnumber Anticlockwise; negative for clockwise.
size_level Size a level's sphere Changes
Make a level's sphere bigger or smaller, around level 0 (the home group unless given): scale 1.5 is half as big again, 0.8 smaller; 0 puts it back to its automatic size.
arrangement_idstring The arrangement's id.levelnumber The level: 1 for the groups round level 0.scalenumber 1.5, 0.8, or 0 for automatic.level0string, optional Optional: the group at level 0 (id or exact name).
Journeys
list_journeys List journeys Reads
List this person's journeys with their steps.
No inputs.
read_journey Read a journey Reads
Read a journey, this person's or a public one: its steps with their ids, arrangements, titles and descriptions.
journey_idstring The journey's id.
create_journey Start a journey Adds
Start a new journey (a sequence of views) owned by this person.
namestring The journey's name.
rename_journey Rename a journey Changes
Rename one of this person's journeys.
journey_idstring The journey's id.namestring Its new name.
add_journey_step Add a journey step Adds
Add a step to a journey: a view of an arrangement with a title and a description.
journey_idstring The journey's id.arrangement_idstring The arrangement's id.titlestring The step's title.descriptionstring, optional What the step says.level0string, optional The group to put at level 0 (id or exact name); the home group if left out.centrestring, optional The group, or linked arrangement (by name), to bring to the centre of the screen; level 0 if left out (then the whole arrangement is shown).distancenumber, optional Optional: how far back the camera is. Best left out: the view is then worked out to frame the centre, seen from the side with nothing in front of it.
edit_journey_step Change a journey step Changes
Change a journey step's title or description (give only what changes).
step_idstring The step's id, as reading the journey gives it.titlestring, optional A new title.descriptionstring, optional A new description.
delete_journey_step Delete a journey step Changes
Delete a step from one of this person's journeys.
step_idstring The step's id.
order_journey Reorder a journey Changes
Put a journey's steps in a new order: all its step ids, first to last.
journey_idstring The journey's id.step_idslist of strings Every step's id, in the new order.
delete_journey Delete a journey Changes
Delete one of this person's journeys.
journey_idstring The journey's id.
Categories and path types
list_categories List categories Reads
List this person's categories (kinds of thought) with their colours.
No inputs.
edit_category Change a category Changes
Change one of this person's categories: its name, or its background, text or tag colour (#rrggbb). Every Thort in it changes with it.
categorystring The category's name or id.namestring, optional A new name.backgroundstring, optional #rrggbbtext_colourstring, optional #rrggbbtag_colourstring, optional #rrggbb
list_path_types List path types Reads
List this person's path types (kinds of connection) with their colours.
No inputs.
People
list_members List an arrangement's people Reads
List the people in an arrangement: its owner, contributors, and anyone asking to join.
arrangement_idstring The arrangement's id.
add_member Add someone to an arrangement Adds
Add someone to one of this person's arrangements as a contributor, by the name they have in Thortspace.
arrangement_idstring The arrangement's id.namestring Their name in Thortspace.
admit_member Let someone in Adds
Let in someone who asked to join one of this person's arrangements.
arrangement_idstring The arrangement's id.memberstring Their name or id, as the arrangement's list of people gives it.
block_member Block someone from an arrangement Changes
Block a contributor from one of this person's arrangements. What they added goes with them into a copy of their own (a fork).
arrangement_idstring The arrangement's id.memberstring Their name or id, as the arrangement's list of people gives it.
join_arrangement Join an arrangement Adds
Join an arrangement to add to it: at once where joining is open, otherwise asking its owner.
arrangement_idstring The arrangement's id.
leave_arrangement Leave an arrangement Changes
Leave an arrangement this person has joined.
arrangement_idstring The arrangement's id.
You
my_account My account Reads
This person's name, plan, active arrangements (and the limit), and AI help used this month.
No inputs.
set_my_name Change my name Changes
Change the name people see beside this person's Thorts and arrangements.
namestring The name.
list_notifications List notifications Reads
List this person's notifications: what others did in their arrangements, and Thorts they use that someone changed.
No inputs.
answer_notification Answer a notification Changes
Answer a notification. For a Thort someone changed: keep_original true puts a copy with the old text in its place in this person's arrangement; false takes the new text. Any other is dismissed.
notification_idnumber The notification's id.keep_originalboolean, optional For a changed Thort: keep the original wording.
Thortspace version 1
list_v1_spheres List my v1 spheres Reads
List this person's spheres in Thortspace version 1 (the apps), and which have been brought across.
querystring, optional Optional: part of a sphere's name.
import_v1_sphere Bring a v1 sphere across Adds
Bring one of this person's v1 spheres across as a private arrangement, a faithful copy (beyond the free plan's limit it arrives archived).
sphere_idstring The sphere's id (from list_v1_spheres).
Help
Email support@thortspace.com. For connecting Claude, ChatGPT and other assistants, see Connect an AI assistant.