Skip to content

feat(mcp): tools to create session groups and file sessions under them - #673

Merged
blpsoares merged 1 commit into
devfrom
feat/mcp-session-groups
Sep 25, 2026
Merged

blpsoares merged 1 commit into
devfrom
feat/mcp-session-groups

Conversation

@blpsoares

Copy link
Copy Markdown
Owner

Summary

  • MCP tools so an assistant can organise the sessions it starts: agentistics_session_groups (list), agentistics_session_group_create (optionally files sessions in the same call) and agentistics_session_group_edit (add / remove / rename / delete), over new /api/session-groups routes.
  • Groups are addressed by id or name, sessions by managed id, conversation id, exact title or unique id prefix. A reference that matches nothing (404) or two things (409) is refused, and a batch with a bad session changes nothing.
  • Filing follows the sidebar's rules: a session belongs to at most one group (adding moves it) and is unpinned.

Motivation

Requested: let LLMs create the groups and put the sessions they start inside, to keep the fleet organised.

Changes

  • @agentistics/core sessionGroups.ts: the pure planners move here (planGroupOp, resolveGroupRef, resolveSessionForGroup, sessionIdentityKey); the web module re-exports them, so both surfaces share one rule.
  • server/sessions/session-groups-web.ts + routes in index.ts + capability-guard.ts (localShell).
  • preferences.ts: updatePreferences, an atomic read-modify-write (the browser writes the same key).
  • packages/mcp/agentistics-mcp.ts, docs/mcp.md, CLAUDE.md.

Test plan

  • tsc + tests (pre-commit): core planners, server module with an in-memory store, and concurrent updatePreferencesAt (20 writers, none lost)
  • Real server on an isolated data dir: create / refusals (404, 400) / rename by name / delete by name; a seeded registry filed by title and by id prefix, stored with the right identity keys
  • The MCP server over stdio: 3 tools listed, create + add by group name and session title moves a session between groups, a bad group returns the refusal message

Notes

The browser adopts a change made through the MCP when its tab regains focus (the same refresh every shared preference uses).

🤖 Generated with Claude Code

An assistant can now organise the sessions it starts: agentistics_session_groups (list),
agentistics_session_group_create (optionally filing sessions in the same call) and
agentistics_session_group_edit (add / remove / rename / delete), over the new /api/session-groups
routes. Groups and sessions are addressed by id OR name/title/id prefix, and a reference that
matches nothing or two things is refused (404/409) rather than guessed.

The pure rules move to @agentistics/core (planGroupOp, resolveGroupRef, resolveSessionForGroup) so
the web sidebar and the server use the same ones. Writes go through a new atomic
updatePreferences, so a browser and an assistant changing groups at once cannot undo each other.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q6YYtbuG1MA3dzqc6Hiam3
@blpsoares
blpsoares merged commit 3041891 into dev Sep 25, 2026
3 checks passed
@blpsoares blpsoares mentioned this pull request Sep 25, 2026
3 tasks
@blpsoares
blpsoares deleted the feat/mcp-session-groups branch September 26, 2026 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant