StackMemory provides 30+ MCP tools and 50+ CLI commands for lossless memory management in AI coding workflows. This reference covers all available APIs with parameters, types, and usage examples.
Retrieve relevant context from the active frame stack.
Parameters:
query(string, optional): Search query for context filteringlimit(number, optional): Maximum results (default: 5)
Returns:
{
"content": [
{
"type": "text",
"text": "Current Context Stack:\n Frame 1: Task Name\n Constraints: auth, validation\n Recent: 3 events"
}
],
"metadata": {
"relevantFrames": ["frame-id-1", "frame-id-2"],
"query": "search-term"
}
}Example:
// Get all current context
await mcp.callTool("get_context", {});
// Search for specific context
await mcp.callTool("get_context", {
query: "authentication implementation",
limit: 10
});Begin a new context frame (task/subtask) on the call stack.
Parameters:
name(string, required): Frame name/goaltype(string, optional): Frame type (default: "task")task|subtask|tool_scope|context
constraints(array, optional): Initial constraintsdefinitions(object, optional): Initial definitions/config
Returns:
{
"content": [
{
"type": "text",
"text": "Started frame: API Implementation (frame-id-123)"
}
],
"metadata": {
"frameId": "frame-id-123",
"type": "task",
"name": "API Implementation"
}
}Example:
await mcp.callTool("start_frame", {
name: "User Authentication System",
type: "task",
constraints: ["OAuth 2.0", "JWT tokens"],
definitions: {
"auth_endpoint": "/api/auth",
"token_expiry": "24h"
}
});Close the current or specified frame with optional summary.
Parameters:
summary(string, optional): Completion summaryframeId(string, optional): Specific frame to close (default: current)
Returns:
{
"content": [
{
"type": "text",
"text": "Closed frame: API Implementation with summary: Auth endpoints completed successfully"
}
]
}Record an architectural decision or important constraint.
Parameters:
content(string, required): Decision/constraint contenttype(string, required): Type of entrydecision|constraint
Returns:
{
"content": [
{
"type": "text",
"text": "Recorded decision: Use JWT for session management"
}
]
}Add a high-priority anchor (important fact) to the current frame.
Parameters:
type(string, required): Anchor typeFACT|DECISION|CONSTRAINT|INTERFACE_CONTRACT|TODO|RISK
text(string, required): Anchor contentpriority(number, optional): Priority level 1-10 (default: 5)
Example:
await mcp.callTool("add_anchor", {
type: "CONSTRAINT",
text: "Database connections must use SSL",
priority: 9
});Get current hot stack context with active frames.
Parameters:
max_events(number, optional): Maximum recent events per frame (default: 10)
Returns:
{
"content": [
{
"type": "text",
"text": "Hot Stack (3 frames):\n 0: Main Task (5 anchors, 12 events)\n 1: Auth Subtask (2 anchors, 4 events)"
}
],
"metadata": {
"stack": [
{
"depth": 0,
"frameId": "frame-1",
"goal": "Main Task",
"constraints": ["security", "performance"],
"anchors": 5,
"recentEvents": 12,
"artifacts": 3
}
]
}
}Create a new task with agent assistance capabilities.
Parameters:
title(string, required): Task titledescription(string, optional): Detailed descriptionpriority(string, optional): Priority level (default: "medium")low|medium|high|urgent
tags(array, optional): Categorization tagsparent_id(string, optional): Parent task IDautoExecute(boolean, optional): Auto-start agent execution
Returns:
{
"content": [
{
"type": "text",
"text": "Created task: Implement user auth (task-123)"
}
],
"metadata": {
"taskId": "task-123",
"title": "Implement user auth",
"priority": "high"
}
}Example:
await mcp.callTool("create_task", {
title: "Implement OAuth 2.0 authentication",
description: "Add OAuth integration with Google and GitHub providers",
priority: "high",
tags: ["auth", "oauth", "security"],
autoExecute: true
});Update the status and progress of an existing task.
Parameters:
task_id(string, required): Task identifierstatus(string, required): New statuspending|in_progress|blocked|completed|cancelled
progress(number, optional): Completion percentage (0-100)
Example:
await mcp.callTool("update_task_status", {
task_id: "task-123",
status: "in_progress",
progress: 75
});Retrieve active tasks with filtering options.
Parameters:
status(string, optional): Filter by statuspriority(string, optional): Filter by prioritylimit(number, optional): Maximum results (default: 20)include_completed(boolean, optional): Include completed tasks (default: false)tags(array, optional): Filter by tagssearch(string, optional): Search in title/description
Returns:
{
"content": [
{
"type": "text",
"text": "Active Tasks (5):\ntask-1: Auth API [in_progress] (high)\ntask-2: Database setup [pending] (medium)"
}
],
"metadata": {
"tasks": [
{
"id": "task-1",
"title": "Auth API",
"status": "in_progress",
"priority": "high",
"tags": ["auth", "api"],
"created": "2024-01-15",
"progress": 60
}
],
"totalCount": 5,
"filters": {}
}
}Get task analytics and performance metrics.
Returns:
{
"content": [
{
"type": "text",
"text": "Task Metrics:\n- Total: 45\n- Blocked: 3\n- Overdue: 1\n- Completion Rate: 78.2%\n- Effort Accuracy: 85.4%"
}
],
"metadata": {
"total_tasks": 45,
"blocked_tasks": 3,
"overdue_tasks": 1,
"completion_rate": 0.782,
"avg_effort_accuracy": 0.854,
"by_priority": {
"urgent": 2,
"high": 8,
"medium": 25,
"low": 10
},
"by_status": {
"pending": 12,
"in_progress": 8,
"completed": 22,
"blocked": 3
}
}
}Add a dependency relationship between tasks.
Parameters:
task_id(string, required): Dependent task IDdepends_on(string, required): Task this depends ondependency_type(string, optional): Dependency type (default: "blocks")
Example:
await mcp.callTool("add_task_dependency", {
task_id: "task-frontend",
depends_on: "task-api",
dependency_type: "blocks"
});Synchronize tasks with Linear issue tracker.
Parameters:
direction(string, optional): Sync direction (default: "both")both|to_linear|from_linear
force(boolean, optional): Force sync ignoring conflicts
Returns:
{
"content": [
{
"type": "text",
"text": "Linear Sync Complete:\n- To Linear: 5 tasks\n- From Linear: 3 tasks\n- Updated: 2 tasks\n- Errors: 0"
}
],
"metadata": {
"success": true,
"synced": {
"toLinear": 5,
"fromLinear": 3,
"updated": 2
},
"conflicts": [],
"errors": []
}
}Update a Linear issue directly.
Parameters:
linear_id(string, required): Linear issue ID or identifierstatus(string, optional): New statusassignee_id(string, optional): Assignee user IDpriority(number, optional): Priority level (1-4)labels(array, optional): Issue labels
Retrieve issues from Linear.
Parameters:
team_id(string, optional): Filter by teamassignee_id(string, optional): Filter by assigneestate(string, optional): Filter by state (default: "active")limit(number, optional): Maximum results (default: 20)search(string, optional): Search query
Check Linear integration connection status.
Returns:
{
"content": [
{
"type": "text",
"text": "Linear Integration Status:\n✓ Connected as: John Doe\n✓ Teams: 3\n✓ Last sync: 2024-01-15 14:30\n✓ Synced tasks: 127\n✓ Sync errors: 0"
}
],
"metadata": {
"connected": true,
"user": {"name": "John Doe", "email": "john@company.com"},
"teams": [{"id": "team-1", "name": "Engineering"}],
"syncStats": {
"lastSync": "2024-01-15T14:30:00Z",
"totalSynced": 127,
"errors": 0
}
}
}Retrieve execution traces with filtering.
Parameters:
limit(number, optional): Maximum results (default: 20)pattern(string, optional): Filter by patternstart_time(string, optional): Start time (ISO string)end_time(string, optional): End time (ISO string)include_context(boolean, optional): Include full trace context
Analyze trace patterns for insights.
Parameters:
trace_id(string, optional): Specific trace to analyzeanalysis_type(string, optional): Analysis type (default: "performance")performance|patterns|errors
include_recommendations(boolean, optional): Include recommendations (default: true)
Start a browser debugging session.
Parameters:
url(string, required): URL to navigate toheadless(boolean, optional): Run in headless mode (default: false)width(number, optional): Browser width (default: 1280)height(number, optional): Browser height (default: 720)capture_screenshots(boolean, optional): Auto-capture screenshots (default: true)
Capture a screenshot during debugging.
Parameters:
session_id(string, required): Browser session IDselector(string, optional): CSS selector for element screenshotfull_page(boolean, optional): Capture full page (default: false)
Execute JavaScript in the browser.
Parameters:
session_id(string, required): Browser session IDscript(string, required): JavaScript code to executeargs(array, optional): Script arguments
Stop a browser debugging session.
Parameters:
session_id(string, required): Session ID to stop
Execute a task using AI agent with verification loops.
Parameters:
taskId(string, required): Task ID to executemaxTurns(number, optional): Maximum agent turns (default: 10, max: 20)
Execute a single turn in an active agent session.
Parameters:
sessionId(string, required): Active session IDaction(string, required): Action to performcontext(object, optional): Additional context for the action
Break down a complex task into subtasks.
Parameters:
taskId(string, required): Task ID to break down
List all active agent execution sessions.
Returns:
{
"content": [
{
"type": "text",
"text": "Active sessions (2):\n- session-1: Task task-123 (Turn 3, running)\n- session-2: Task task-456 (Turn 1, waiting)"
}
]
}Retry a failed session with learned context.
Parameters:
sessionId(string, required): Session ID to retry
Get feedback from the last agent turn.
Parameters:
sessionId(string, required): Session ID
Initialize StackMemory in the current project.
stackmemory initCreates .stackmemory/ directory with context database and configuration.
Show current StackMemory status and active frames.
stackmemory status [options]
Options:
--all Show all active frames across sessions
--project Show all active frames in current project
--session <id> Show frames for specific sessionExample output:
📊 StackMemory Status:
Session: abc12345 (active, 25min old)
Project: my-app
Branch: feature/auth
Database Statistics (this project):
Frames: 45 (3 active, 42 closed)
Events: 234
Sessions: 8
Cached contexts: 15 (global)
Current Session:
Stack depth: 3
Active frames: 3
└─ Main Development [task]
└─ Authentication System [task]
└─ OAuth Integration [subtask]
Check for StackMemory updates.
stackmemory update-checkStart StackMemory MCP server for Claude Desktop integration.
stackmemory mcp-server [options]
Options:
-p, --project <path> Project root directory (default: current)List and filter tasks.
stackmemory tasks list [options]
Aliases: task ls
Options:
-s, --status <status> Filter by status (pending, in_progress, completed, blocked)
-p, --priority <priority> Filter by priority (urgent, high, medium, low)
-q, --query <text> Search in title/description
-l, --limit <n> Limit results (default: 20)
-a, --all Include completed tasksExample:
# List all active high priority tasks
stackmemory tasks list --priority high
# Search for authentication tasks
stackmemory tasks list --query auth --limit 10
# Show all tasks including completed
stackmemory tasks list --allCreate a new task.
stackmemory tasks create <title> [options]
Options:
-d, --description <desc> Task description
-p, --priority <priority> Priority level (urgent, high, medium, low)
-t, --tags <tags> Comma-separated tags
--parent <id> Parent task ID
--assign <user> Assign to user
--due <date> Due date (YYYY-MM-DD)Example:
stackmemory tasks create "Implement OAuth authentication" \
--description "Add Google and GitHub OAuth providers" \
--priority high \
--tags "auth,oauth,security"Update an existing task.
stackmemory tasks update <id> [options]
Options:
-s, --status <status> Update status
-p, --priority <priority> Update priority
-t, --title <title> Update title
-d, --description <desc> Update description
--progress <percent> Set completion progress (0-100)
--assign <user> Assign to user
--tags <tags> Update tags (comma-separated)Show detailed task information.
stackmemory tasks show <id> [options]
Options:
--history Show task history
--comments Show comments
--timeline Show timeline viewDelete a task.
stackmemory tasks delete <id> [options]
Options:
--force Force deletion without confirmationSet up Linear OAuth integration.
stackmemory linear setupInteractive OAuth setup with Linear. Provides authorization URL and instructions.
Complete Linear OAuth authorization.
stackmemory linear authorize <code>
Arguments:
code Authorization code from Linear OAuth flowShow Linear integration status.
stackmemory linear statusExample output:
📊 Linear Integration Status:
Configured: ✅
Client ID: abcd1234...
Tokens: ✅ Valid
Token expires: 1425 minutes
🧪 Testing connection...
Connection: ✅ OK
Synchronize tasks with Linear.
stackmemory linear sync [options]
Options:
-d, --direction <direction> Sync direction: bidirectional, to_linear, from_linear (default: bidirectional)Example:
# Bidirectional sync
stackmemory linear sync
# Only push to Linear
stackmemory linear sync --direction to_linear
# Only pull from Linear
stackmemory linear sync --direction from_linearManage automatic synchronization.
stackmemory linear auto-sync [options]
Options:
--start Start auto-sync service
--stop Stop auto-sync service
--status Show auto-sync status
--interval <minutes> Set sync interval in minutes (default: 5)
--direction <direction> Set sync direction (default: bidirectional)
--quiet-start <hour> Start of quiet hours 0-23 (default: 22)
--quiet-end <hour> End of quiet hours 0-23 (default: 7)Example:
# Start auto-sync every 10 minutes
stackmemory linear auto-sync --start --interval 10
# Check status
stackmemory linear auto-sync --status
# Stop auto-sync
stackmemory linear auto-sync --stopForce immediate synchronization.
stackmemory linear force-syncUpdate a Linear issue directly.
stackmemory linear update <issueId> [options]
Options:
-s, --status <status> New status (todo, in-progress, done, canceled)
-t, --title <title> Update task title
-d, --description <desc> Update task description
-p, --priority <priority> Set priority (1=urgent, 2=high, 3=medium, 4=low)Configure auto-sync settings.
stackmemory linear config [options]
Options:
--show Show current configuration
--set-interval <minutes> Set sync interval in minutes
--set-direction <direction> Set sync direction
--set-conflict-resolution <strategy> Set conflict resolution strategy
--set-quiet-start <hour> Set start of quiet hours (0-23)
--set-quiet-end <hour> Set end of quiet hours (0-23)
--enable Enable auto-sync
--disable Disable auto-sync
--reset Reset to default configurationList all sessions.
stackmemory sessions list [options]
Options:
--active Show only active sessions
--project Show sessions for current project only
--format Output format (table, json, csv)Create a new session.
stackmemory sessions create [options]
Options:
--name <name> Session name
--branch <branch> Git branch
--project <project> Project IDSwitch to a different session.
stackmemory sessions switch <sessionId>Close a session.
stackmemory sessions close <sessionId> [options]
Options:
--force Force close without saving
--summary Provide closing summarySave current context to shared memory.
stackmemory context save <content> [options]
Options:
--type <type> Context type (decision, constraint, learning, code, error)
--importance <score> Importance score 0-1 (default: 0.5)
--tags <tags> Comma-separated tagsLoad relevant context.
stackmemory context load <query> [options]
Options:
--limit <n> Maximum results (default: 10)
--format <format> Output format (text, json, yaml)
--frame <frameId> Load from specific frameManage context frames.
stackmemory context frames <action> [options]
Actions:
list List active frames
create Create new frame
close Close current frame
switch Switch to different frame
Options:
--name <name> Frame name (for create)
--type <type> Frame type (task, subtask, tool_scope, context)
--summary <text> Closing summary (for close)Launch task analytics dashboard.
stackmemory analytics [options]
Options:
-p, --port <port> Port for dashboard server (default: 3000)
-o, --open Open dashboard in browser
--export <format> Export metrics (json, csv)
--sync Sync with Linear before launching
--view Show analytics in terminalDisplay monitoring dashboard in terminal.
stackmemory dashboard [options]
Options:
-w, --watch Auto-refresh dashboard
-i, --interval <sec> Refresh interval in seconds (default: 5)Monitor system performance and health.
stackmemory monitor [options]
Options:
--start Start monitoring service
--stop Stop monitoring service
--status Show monitoring status
--alerts Show active alerts
--metrics Show current metricsManage automated workflows.
stackmemory workflow <action> [options]
Actions:
list List available workflows
run Run a specific workflow
create Create new workflow
edit Edit existing workflow
delete Delete workflow
Options:
--name <name> Workflow name
--trigger <trigger> Workflow trigger
--config <file> Workflow configuration fileClear cached data and temporary files.
stackmemory clear [options]
Options:
--cache Clear cached data
--logs Clear log files
--temp Clear temporary files
--all Clear everything
--force Don't ask for confirmationSearch across tasks, contexts, and frames.
stackmemory search <query> [options]
Options:
--type <type> Search type (tasks, contexts, frames, all)
--limit <n> Maximum results (default: 20)
--format <format> Output format (table, json, csv)
--case-sensitive Case-sensitive searchShow and filter application logs.
stackmemory log [options]
Options:
--level <level> Log level (error, warn, info, debug)
--since <time> Show logs since time (e.g., '1h', '30m', '2024-01-15')
--tail <n> Show last n lines (default: 100)
--follow Follow log output
--format <format> Output format (text, json)LINEAR_API_KEY: Linear API key (alternative to OAuth)STACKMEMORY_PROJECT: Override project root directoryLOG_LEVEL: Logging level (error, warn, info, debug)NODE_ENV: Environment (development, production)
~/.stackmemory/config.json: Global configuration.stackmemory/config.json: Project-specific configuration.stackmemory/linear-auth.json: Linear authentication tokens
Add to Claude Desktop config (~/.claude/config.json):
{
"mcp": {
"mcpServers": {
"stackmemory": {
"command": "stackmemory",
"args": ["mcp-server"],
"env": {
"NODE_ENV": "production",
"LOG_LEVEL": "info"
}
}
}
}
}AUTH_ERROR: Authentication/authorization failedNOT_FOUND: Resource not foundVALIDATION_ERROR: Invalid parameters providedCONFLICT: Operation conflicts with current stateRATE_LIMITED: API rate limit exceededNETWORK_ERROR: Network connectivity issue
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid task priority. Must be one of: low, medium, high, urgent",
"details": {
"field": "priority",
"provided": "invalid-priority",
"allowed": ["low", "medium", "high", "urgent"]
}
}
}- Always check authentication status before Linear operations
- Use appropriate frame types for context organization
- Set meaningful priorities for anchors (7-10 for critical info)
- Include context in agent turns for better results
- Initialize StackMemory (
stackmemory init) before using project features - Use
--dry-runflags when available for destructive operations - Set up auto-sync for continuous Linear integration
- Use tags consistently for better task organization
- Limit context queries to avoid large responses
- Use pagination for large result sets
- Close frames when tasks are complete
- Regular cleanup with
stackmemory clearcommand
- Store API keys in environment variables, not config files
- Use OAuth instead of API keys when possible
- Limit MCP server access to project directories only
- Review and rotate authentication tokens regularly