MCP Integration

How Sessions integrates with Claude Code via Model Context Protocol.

Overview

Sessions integrates with Claude Code via the Model Context Protocol (MCP). The MCP server runs as sessions mcp and exposes tools that Claude can use to manage your rules and projects.

Available Tools

list_projects List all your projects
create_project Create a new project
name string required
link_project Link current directory to a project
name string required
create_if_missing string
get_rules Get rules for a project
project_id string required
add_rule Add a rule to a project
project_id string required
content string required
improve Add rule to current project
rule string required
add_global_rule Add rule to global profile
rule string required
sync Get presigned URLs for session upload
files array required

Using MCP in Practice

The MCP tools are exposed to Claude Code as slash commands:

Slash Command MCP Tool What it does
/project myapp link_project Link directory to project "myapp"
/improve "rule" improve Add rule to linked project (or inbox)
/global "rule" add_global_rule Add rule that applies everywhere
/projects list_projects Show all your projects

When Claude Code starts a session, the MCP server automatically calls get_rules to load your rules into context. This happens transparently - you just start coding and your preferences are already applied.

Configuration

The MCP server is automatically configured when you install Sessions. It's registered in ~/.claude/.mcp.json.

bash
# Manually reinstall MCP configuration sessions plugin install