Skip to content

Agents (MCP) ​

CodeKasten has a Model Context Protocol server. Connect Claude Code, Claude Desktop or any MCP client to it and the agent can work in a workspace: read and change records, build record types and workflows, commit, and ask for a merge.

http://<your-host>:8811/mcp
Authorization: Bearer sk_…

For Claude Code:

bash
claude mcp add --transport http codekasten http://127.0.0.1:8811/mcp \
  --header "Authorization: Bearer sk_…"

The agent acts for a person ​

An agent uses an API key, or a grant narrowed from one, so it acts for the person who made the key, on that key's branch, with that person's role in the workspace and on that branch. It does no more than they may - a reader's agent reads, and a key for a branch its person no longer reads stops working - and no more than its grant allows. What it writes is recorded as the agent, acting for its person: a record's history and a commit say "Claude, for Maria", and get_record says who wrote a record (writtenBy), so an agent can weigh what it reads by who wrote it.

What every tool does is declared once - it reads, changes, removes, or reaches outside CodeKasten - and that is what a client is told about it, so a client that lets read-only tools run without asking never lets one through that changes something.

An agent never writes to a protected branch. The intended way of working is the one a careful colleague would follow:

  1. make a branch for the agent and a key on it,
  2. let the agent work and commit,
  3. the agent calls request_merge, which asks the people who may merge, in their Inbox (somebody alone in their workspace is asked themselves),
  4. a person looks at the commits and merges.

A coding session's branch is its person's alone until the merge is asked for: see project memory.

When a tool refuses something, the refusal comes back as the tool's result, worded for the model, so the agent can explain or try another way.

Tools ​

Looking around ​

ToolDoes
workspace_infoWho the agent is acting as, the workspace, the branch, whether it is protected, the person's role in the workspace and on the branch, and the members (for a guest: the people on that branch)
list_entity_types, describe_entity_typeThe record types, and a type's fields and relations
search_records, get_record, get_relationsFind and read records
query_recordsCount and add up the records of a type, over everything or grouped: the question a report asks

Records ​

ToolDoes
create_record, update_record, delete_recordBy the field names the type defines. A select takes a choice's name or id; a person field a member's username, email or id, and comes back as { id, username, name }
link_records, unlink_recordsJoin two records by a relation
get_description, set_descriptionThe text on a record's page, as Markdown
get_document_text, set_document_textA document's body, as Markdown
draw_shapesAdds shapes (rectangles, ellipses, lines, text, paths) to a Drawing
upload_file, finish_uploadUploads a file and puts it in a record's Files, as the tab's + does (see below); with package: true, a picture an app ships, such as a solution's cover

Types with Give agents tools for this type switched on also get their own create_<type> and search_<type> tools, with the type's fields as parameters.

Markdown covers paragraphs, headings, lists (nested, and check lists), quotes, code blocks, dividers, bold, italic, underline, strikethrough, code and @username mentions. What the editor has beyond that is written so that a text read and written back keeps it:

In the editorIn the Markdown
A link to a record[Website relaunch](record:<id>). The name is for the reader; the id is the link
A tag[#urgent](tag:<id>)
AlignmentA paragraph, heading or quote ending in {align=center} (also right, justify)
A calloutA quote that opens with a line [!NOTE], [!TIP], [!IMPORTANT], [!WARNING] or [!CAUTION], or [!callout 🚀] for any other icon
A toggle<details> (or <details open>), a line <summary>title</summary>, the content, </details>

Callouts and toggles can hold lists, code and each other. A link to a record that is not on the branch is refused, and nothing is written.

People ​

ToolDoes
send_to_inboxTells members something in their Inbox
list_my_inboxReads the Inbox of the agent's person
askAsks its person to decide something (choices, or words), in their Inbox, and waits up to 50 seconds for the answer; unanswered, it gets a ticket to read the answer with later, and a coding session with the plugin is told when the answer comes, even if it sat idle. The answer stays with the question: who decided what, when
grantNarrows the agent's grant for a subagent, lists and revokes those it narrowed, shows its own
watchWaits (up to 50 seconds) for what changes on the branch since a cursor - records made, changed or deleted, and by whom - instead of searching again and again

Earlier sessions ​

ToolDoes
search_sessions, get_sessionLook back through the coding sessions of the agent's person
set_session_summaryWrites down what the session at work did

Branches ​

ToolDoes
list_branches, branch_statusThe branches its person reads, and what has changed since the last commit; once a merge was asked, whether it is still asked, was declined (by whom, and the note saying why) or merged
open_branchOpens a branch from the one it is on, the agent's person's alone until a merge is asked, within the plan's branches. Only with a workspace key, which names the new branch in the X-CK-Branch header of the requests that work on it: for a program that keeps many people's work apart, such as a service that gives each of its users' drafts a branch of its own. A coding session does not need it: its first change opens its branch
close_branchCloses a branch that is its person's alone (one open_branch opened, before a merge was asked), when its work is not to be merged: withdrawn, or its merge declined. What is not committed is committed first and its commits are kept; what its workflow runs held back is dropped. Only with a workspace key, and a grant must allow the verb branch
commitCommits the branch
merge_branchesMerges a branch its person reads into one that is not protected and that they may merge into
request_mergeAsks the people who may merge

Packages ​

list_packages and install_package.

Building record types ​

In an app workspace: create_entity_type (with fields at once), update_entity_type, add_field, update_field, remove_field, add_relation. They write what the Entity Builder writes, so a type an agent made opens in the builder.

A field may be an enum: a word from a fixed list, given as choices (a word each, or { value, label, icon, color }). describe_entity_type lists a field's choices and says in choices_extendable whether the list may grow. update_field changes it:

ParameterWhat it does
add_choicesPuts choices after the ones the field has. Every value already stored stays valid, so this is safe on a released type. A choice it has already is left alone
choicesThe whole list, in the order given: to reorder it, to change a label, icon or colour, or to take a choice away. A choice named by its value alone keeps its label, icon and colour
extendableWhether choices may be added from now on. A field made with extendable: false has a closed list

Two things are refused: adding a choice to a closed list, and removing a choice, or changing its value, while a record holds it. A program with an API key does the same over HTTP: POST /api/agent/fields/choices with { type, field, add, choices, extendable }, on the branch named in X-CK-Branch.

Not offered: deleting a type or a relation, and view sections of a type's own.

Writing solutions ​

In an app workspace: list_solutions (the branch's solutions, and the domain, role and industry tags one may name), get_solution and save_solution. A solution is saved whole, as the builder saves it and refused where the builder would refuse it: its texts in Markdown, its requirements, its sample data, and a cover picture the agent uploads with upload_file and package: true. It reaches other workspaces with the app's next published release.

Building workflows ​

In a workflow workspace: list_workflow_functions, list_workflows, get_workflow, save_workflow. Wherever a workflow is installed: create_workflow_instance, list_workflow_instances, set_workflow_instance_enabled, run_workflow_instance, list_workflow_runs.

On a coding session's branch, a workflow run changes the branch's records at once, but what it would send out of CodeKasten - a connector's action - is held until the branch is merged: the merge sends it, once, and the merge screen lists what is waiting. A branch closed unmerged sends nothing.

Uploading a file takes three steps, so the file's content never passes through the agent's conversation. upload_file (its name, type, size in bytes, and the record it is for) answers with an address valid for five minutes. The agent sends the file there itself, for example curl -sf -X PUT -H 'Content-Type: text/plain' --upload-file notes.txt '<address>'. Then finish_upload checks that what arrived is what was announced and puts the file in the record's Files. A file is also a picture in rich text: ![caption](file:<id>). Not on a protected branch, and not with a read-only key.

save_workflow takes a whole workflow (steps and edges), checks it by the same rules as Validate — reporting everything wrong at once — and compiles it. Connector steps, Execute Workflow, For Each and On Signal are refused for now.

What an agent cannot touch ​

Definitions outside the builder tools, settings, people, credentials, and what the engine keeps for itself.

Not there yet ​

OAuth (so the server cannot be added as a claude.ai connector yet), and tools for connector accounts.

Further reading ​

Every picture on this site was saved by a test that had just seen the feature work.