agentleFS
MeridionaMeridiona/meridian/.claude/skills/meridian-mcp/SKILL.md

meridian-mcp

Skill404 starsChanged 6 months agoMITView on GitHub

Build, configure, and debug the Meridian MCP server. Exposes app session data to AI tools via the Model Context Protocol.

  • Installs packages

The file

Files
SKILL.md

Meridian MCP Server Skill

What It Is

A TypeScript MCP server (packages/meridian-mcp/) that exposes Meridian's structured session database to any MCP-compatible AI tool (Claude Code, Claude Desktop, Cursor, etc.).

It opens ~/.meridian/meridian.db read-only using sql.js (pure WebAssembly SQLite — no native Node.js modules, works with any Node.js version) and provides tools for querying app sessions, focus time, and activity history.

Build & Run

cd packages/meridian-mcp

# Install dependencies
npm install

# Build TypeScript → dist/
npm run build

# Start server (stdio transport)
node dist/index.js

Prerequisite: The Meridian daemon must be running and have produced at least one session. The MCP server returns an error message on tool calls (does not crash) if the DB is missing.

Available Tools

ToolDescription
get-sessionsList completed app sessions for a date (default: today)
get-timelineFull day timeline including idle and sleep gaps
get-statsDaily productivity stats — focus/idle/away time, top apps
get-active-sessionCurrently in-progress session (if daemon is running)
get-appsAll-time app usage stats
search-sessionsSearch sessions by window title, OCR text, or audio
get-session-detailFull OCR, elements, and signals for a session ID (audio excluded — stored in DB but not sent to LLMs)
health-checkETL run status, cursor position, and total session count

Configuration

# Override DB path (default: ~/.meridian/meridian.db)
MERIDIAN_DB=/path/to/custom.db node dist/index.js

Add to Claude Desktop / Claude Code

Edit ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "meridian": {
      "command": "node",
      "args": ["/path/to/meridian/packages/meridian-mcp/dist/index.js"]
    }
  }
}

Replace /path/to/meridian with the actual repo path.

Debugging

MCP server errors on startup

# Check if DB exists
ls -lh ~/.meridian/meridian.db

# Check if daemon is running
pgrep meridian

# Run daemon first, then start MCP server
./target/release/meridian &
node packages/meridian-mcp/dist/index.js

TypeScript build errors

cd packages/meridian-mcp
npx tsc --noEmit    # type-check without emitting
npm run build       # full build

Test a tool call manually

npx @modelcontextprotocol/inspector node dist/index.js

Development

# Watch mode (ts-node)
npm run dev

# Type check only
npx tsc --noEmit

# Add a new tool: edit src/index.ts
# 1. Add to the TOOLS array (name, description, inputSchema)
# 2. Add a case in the CallToolRequest handler
# 3. Rebuild: npm run build

File Structure

packages/meridian-mcp/
├── src/
│   └── index.ts          # All MCP logic (single file)
├── dist/                 # Compiled JS (committed)
├── package.json
└── tsconfig.json

Implementation Notes

  • Uses sql.js (pure WASM) instead of better-sqlite3 (native) to avoid Node.js version mismatch errors across different environments (Claude Code, Claude Desktop, shell).
  • The DB file is loaded into memory on each tool call so data is always fresh (daemon writes every 60s).
  • The sql.js engine itself (_SQL) is cached across calls to avoid re-initialising the WASM runtime.
  • audio_snippets is intentionally excluded from all MCP tool responses. Audio transcriptions from screenpipe are noisy and prone to hallucinations. They are still stored in app_sessions.audio_snippets and remain searchable via search-sessions (LIKE match on the column).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.