Skip to content

MCP Server which shares context between sub-agent and Persistence contexts

License

sin5ddd/mcp-sqlew

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sqlew

sqlew_logo

npm version License: AGPL v3

SQL Efficient Workflow - MCP server for efficient context sharing between Claude Code sub-agents

What is sqlew?

sqlew is a Model Context Protocol (MCP) server that gives AI agents organizational memory across sessions.

The Problem: Without sqlew, every Claude session starts with zero context. You must re-explain decisions, agents can reintroduce bugs, and there's no way to track WHY decisions were made.

The Solution: sqlew lets agents remember decisions, query past context, prevent regressions with constraints, and coordinate via messaging and tasks.

Example: Session 1 records "API v1 deprecated". Session 2 (days later) queries and automatically uses v2.

Why Use sqlew?

🧠 Organizational Memory

Traditional code tells you WHAT and HOW. sqlew adds WHY:

  • Decisions → WHY it was changed
  • Constraints → WHY it must work this way

âš¡ Token Efficiency

60-75% token reduction in multi-session projects through structured data storage and selective querying.

🎯 Key Features

  • 6 Specialized Tools: decisions, tasks, files, constraints, stats, config
  • Metadata-Driven: Tag, layer, scope, and version everything
  • Decision Context: Document WHY with rationale, alternatives, and trade-offs
  • Task Dependencies: Blocking relationships with circular detection
  • Auto-File Tracking: Zero-token task management via file watching
  • Smart Review Detection: Quality-based auto-transition to waiting_review
  • Auto-Stale Detection: Tasks auto-transition when idle
  • Weekend-Aware Cleanup: Smart retention during weekends
  • Batch Operations: Process up to 50 items atomically

See docs/TASK_OVERVIEW.md and docs/DECISION_CONTEXT.md for details.

🔖Kanban-style AI Scrum

kanban-style task management

Installation

Requirements

  • Node.js 18.0.0 or higher
  • npm or npx

Quick Install

Recommended (npx):

npx sqlew

Or install per project:

npm install sqlew

Note: Global install (npm install -g) is not recommended because sqlew requires an independent database per project. Each project should maintain its own context database in .sqlew/sqlew.db.

Add to Claude Desktop

Edit claude_desktop_config.json:

{
  "mcpServers": {
    "sqlew": {
      "command": "npx",
      "args": ["sqlew"]
    }
  }
}

Restart Claude Desktop. Done!

Custom database path: Add path as argument: "args": ["sqlew", "/path/to/db.db"] Default location: .sqlew/sqlew.db

Configuration

Optional Config File

Create .sqlew/config.toml for persistent settings:

[database]
path = ".sqlew/custom.db"

[autodelete]
ignore_weekend = true
message_hours = 48

Priority: CLI args > config.toml > database defaults

See docs/CONFIGURATION.md for all options and validation rules.

Quick Start

Basic Usage

All tools require an action parameter. Example:

// Store a decision
{action: "set", key: "auth_method", value: "JWT", layer: "business", tags: ["security"]}

// Query later
{action: "get", key: "auth_method"}

For detailed examples, see docs/TOOL_REFERENCE.md.

Specialized Agents

sqlew provides three specialized agents for efficient multi-agent coordination in Claude Code:

Agent Purpose Token Cost Use When
Scrum Master Multi-agent coordination, task management, sprint planning 12KB/conversation Coordinating complex features, managing dependencies, tracking progress
Researcher Query decisions, analyze patterns, investigate context 14KB/conversation Understanding past decisions, onboarding new members, sprint retrospectives
Architect Document decisions, enforce constraints, maintain standards 20KB/conversation Making architectural choices, establishing rules, validating compliance

Installation

By default, all three specialized agents are automatically installed to your project's .claude/agents/ directory on first run.

To disable specific agents, create .sqlew/config.toml:

[agents]
scrum_master = true   # Coordination specialist (12KB)
researcher = false    # Disable this agent
architect = true      # Documentation specialist (20KB)

Note: Set an agent to false in the config file to prevent it from being installed.

Usage: Invoke agents with the @ prefix: @sqlew-scrum-master, @sqlew-researcher, @sqlew-architect

Recommendation: Use all three agents together - they're complementary specialists (46KB total).

Token Optimization (if needed): Disable unused agents in config. Savings: Scrum + Architect = 32KB (30%) | Scrum only = 12KB (74%)

See docs/SPECIALIZED_AGENTS.md for complete installation guide, usage examples, and customization.

Available Tools

Tool Purpose Example Use
decision Record choices "We chose PostgreSQL"
task Track work "Implement feature X"
file Track changes "Modified auth.ts"
constraint Define rules "API must be <100ms"
stats Database metrics Get layer summary
config Retention settings Auto-cleanup config

Each tool supports action: "help" for full documentation and action: "example" for comprehensive usage examples.

Documentation

On-Demand Documentation

All tools support:

  • action: "help" - Parameter reference and descriptions
  • action: "example" - Usage scenarios and examples

For AI Agents

Essential Guides:

Task System:

Advanced Features:

Reference:

For Developers

Use Cases

  • Multi-Agent Coordination: Orchestrators create tasks, agents send status updates
  • Breaking Change Management: Record deprecations and add architectural constraints
  • Decision Context: Document rationale, alternatives considered, and trade-offs
  • Session Continuity: Save progress in Session 1, resume in Session 2

See docs/WORKFLOWS.md for detailed multi-step examples.

Performance

  • Query speed: 2-50ms
  • Concurrent agents: 5+ simultaneous
  • Storage efficiency: ~140 bytes per decision
  • Token savings: 60-75% in typical projects

Support

Support development via GitHub Sponsors - One-time or monthly options available.

Version

Current version: 3.6.5 See CHANGELOG.md for release history.

License

AGPLv3 - Free to use. Open-source required when embedding or modifying. See LICENSE for details.

Links

Support & Documentation

Acknowledgments

Built with Model Context Protocol SDK, better-sqlite3, and TypeScript.

Author: sin5ddd

About

MCP Server which shares context between sub-agent and Persistence contexts

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •