pocket-mcp

pocket-mcp

Turns PocketBase into a persistent knowledge base, enabling Claude Code to capture and retrieve project knowledge, tasks, decisions, and workflows via semantic search.

Category
访问服务器

README

Pocket MCP

A Model Context Protocol (MCP) server that turns PocketBase into a "Second Brain" for Claude Code. Capture knowledge, decisions, bugs, patterns, and more - then recall them with semantic search.

Features

  • Session Management - Track work sessions with goals and outcomes
  • Task Tracking - Manage project tasks with priorities, features, and progress stats
  • Knowledge Capture - Save observations, decisions, bugs, code snippets
  • Workflow Automation - Save and reuse repeatable procedures
  • Semantic Search - AI-powered search using OpenAI embeddings
  • Project Context - Quick access to project tech stack, decisions, patterns
  • Knowledge Graph - Link related entities together
  • Retrospectives - Generate insights from past sessions

New to the tools? Check out the Complete Usage Guide for detailed workflows and best practices.


Quick Start

Option 1: Claude Code Plugin (Recommended)

# 1. Add marketplace
/plugin marketplace add JaoChai/pocket-mcp

# 2. Install plugin
/plugin install pocket-mcp@jaochai-plugins

# 3. Configure (will prompt for credentials)

Option 2: Manual MCP Setup

Add to your project's .mcp.json:

{
  "mcpServers": {
    "pocket-mcp": {
      "command": "npx",
      "args": ["-y", "github:JaoChai/pocket-mcp"],
      "env": {
        "POCKETBASE_URL": "https://your-pocketbase-instance.com",
        "POCKETBASE_EMAIL": "admin@example.com",
        "POCKETBASE_PASSWORD": "your-password",
        "OPENAI_API_KEY": "sk-..."
      }
    }
  }
}

Then enable in .claude/settings.local.json:

{
  "enableAllProjectMcpServers": true
}

Setup PocketBase

Deploy PocketBase (self-host or use PocketHost, Elestio, etc.)

Then run the setup script to create collections:

git clone https://github.com/JaoChai/pocket-mcp.git
cd pocket-mcp
npm install

# Set environment variables
export POCKETBASE_URL="https://your-instance.com"
export POCKETBASE_EMAIL="admin@example.com"
export POCKETBASE_PASSWORD="your-password"

# Run setup
npm run setup-collections

Quick Reference: When to Use Which Tool

Event Tools to Use
Start your day get_pending_outcomes, get_lessons, get_project_context
Start new work create_session, create_task, update_task(in_progress)
Need to find info search_knowledge, semantic_search, find_workflow
Made a decision capture_decision
Fixed a bug capture_bug
Learned something new capture_observation
Wrote reusable code save_snippet
Finished work update_task(done), generate_retrospective, end_session

See Complete Usage Guide for detailed workflows.


Available Tools (28 tools)

Session Tools (3)

Manage work sessions for tracking activities.

Tool Description
create_session Start a new work session with project and goal
end_session End session with outcome (success/partial/failed) and summary
get_current_session Get active session info

Task Tools (5)

Track project tasks with priorities and progress.

Tool Description
create_task Create a new task with title, description, feature, priority
update_task Update task status, priority, or details
get_tasks List tasks with filters (project, status, feature, priority)
get_project_progress Get completion stats, tasks by feature, next-up items
delete_task Delete or cancel a task (soft delete by default)

Task Statuses: pending, in_progress, done, blocked, cancelled

Priorities: critical, high, medium, low

Capture Tools (4)

Save knowledge and learnings.

Tool Description
capture_observation Save discoveries, patterns, insights, notes
capture_decision Log decisions with context, options, and rationale
capture_bug Record bugs with error message, solution, prevention
save_snippet Store reusable code snippets with language and use cases

Outcome Tracking Tools (2)

Track decision outcomes for learning.

Tool Description
record_decision_outcome Record what happened after a decision was made
get_pending_outcomes Find decisions older than N days that need outcome review

Workflow Tools (4)

Save and reuse repeatable procedures.

Tool Description
save_workflow Save a workflow with trigger, steps, and success criteria
find_workflow Find workflow by describing what you want to do
get_workflow Get full details including all steps
record_workflow_execution Record that a workflow was executed

Search Tools (2)

Find knowledge in your Second Brain.

Tool Description
search_knowledge Full-text search across all collections
semantic_search AI-powered similarity search using embeddings

Context Tools (3)

Quick access to project and user context.

Tool Description
get_project_context Get tech stack, recent decisions, bugs, patterns
get_preferences Get user preferences (coding style, tools, workflow)
save_preference Save a user preference with strength level

Relation Tools (3)

Build a knowledge graph.

Tool Description
link_entities Create relationship between two entities
get_relations Get all relationships for an entity
suggest_relations Auto-suggest relations based on shared tags

Relation Types: uses, caused, fixed_by, led_to, related_to, depends_on, inspired_by

Reflection Tools (2)

Learn from past experiences.

Tool Description
generate_retrospective Create retrospective with lessons and action items
get_lessons Get lessons from past retrospectives

PocketBase Collections (14)

The setup script creates these collections:

Collection Description
projects Project information and tech stack
sessions Work session tracking
tasks Task tracking with priorities and features
areas PARA method areas of responsibility
observations Discoveries, patterns, insights, notes
decisions Decision logs with rationale and outcomes
bugs_and_fixes Error tracking and solutions
patterns Design and architecture patterns
code_snippets Reusable code snippets
workflows Saved procedures and workflows
retrospectives Session reviews and lessons
resources Reference materials
relationships Knowledge graph edges
user_preferences User preferences
embeddings Vector embeddings for semantic search

Environment Variables

Variable Required Description
POCKETBASE_URL Yes PocketBase instance URL
POCKETBASE_EMAIL Yes Admin email for authentication
POCKETBASE_PASSWORD Yes Admin password
OPENAI_API_KEY Yes OpenAI API key for embeddings
LOG_LEVEL No Log level (default: info)

Usage Examples

Session Management

# Start a session
Claude, start a session for "implementing user authentication"

# End with summary
Claude, end the session - we completed JWT auth and refresh tokens

Task Tracking

# Create tasks
Claude, create a task "Add password reset flow" with high priority

# Check progress
Claude, show me the project progress

# Update status
Claude, mark the authentication task as done

Knowledge Capture

# Capture observation
Claude, save this: "React Query handles cache invalidation automatically in mutation's onSuccess"

# Capture decision
Claude, record that we chose JWT over sessions because of scalability needs

# Capture bug fix
Claude, save this bug: TypeError on undefined - fixed by adding optional chaining

Workflow Automation

# Save a workflow
Claude, save this deployment workflow:
1. Run tests
2. Build the project
3. Deploy to staging
4. Run smoke tests

# Find a workflow
Claude, how do I deploy to production?

# Record execution
Claude, I just ran the deployment workflow successfully

Search Knowledge

# Full-text search
Claude, search for "authentication patterns"

# Semantic search
Claude, find knowledge related to "handling API errors gracefully"

Project Context

# Get project context
Claude, what do you know about this project?

# Get preferences
Claude, what are my coding preferences?

Retrospectives

# Generate retrospective
Claude, generate a retrospective for today's session

# Get lessons
Claude, show me lessons from past sessions

Installation Options

Option 1: Plugin (Easiest)

/plugin marketplace add JaoChai/pocket-mcp
/plugin install pocket-mcp@jaochai-plugins

Option 2: npx from GitHub

{
  "mcpServers": {
    "pocket-mcp": {
      "command": "npx",
      "args": ["-y", "github:JaoChai/pocket-mcp"],
      "env": { ... }
    }
  }
}

Option 3: From Source

git clone https://github.com/JaoChai/pocket-mcp.git
cd pocket-mcp
npm install
npm run build

Development

npm install           # Install dependencies
npm run build         # Build TypeScript
npm run dev           # Development mode with tsx
npm run setup-collections  # Setup PocketBase collections
npm test              # Run tests

Architecture

pocket-mcp/
├── src/
│   ├── index.ts          # Entry point (bin)
│   ├── server.ts         # MCP server with 28 tools
│   ├── config.ts         # Config validation (Zod)
│   ├── pocketbase/
│   │   ├── client.ts     # PocketBase client
│   │   └── collections.ts # Collection schemas
│   ├── tools/
│   │   ├── session.ts    # Session management
│   │   ├── tasks.ts      # Task tracking
│   │   ├── capture.ts    # Knowledge capture
│   │   ├── workflow.ts   # Workflow automation
│   │   ├── search.ts     # Full-text & semantic search
│   │   ├── context.ts    # Project context & preferences
│   │   ├── relate.ts     # Knowledge graph relations
│   │   └── reflect.ts    # Retrospectives & lessons
│   └── utils/
│       ├── embeddings.ts # OpenAI embeddings
│       └── logger.ts     # Logging (stderr for MCP)
├── scripts/
│   └── setup-collections.ts
└── dist/                 # Compiled output

License

MIT

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

Credits

Built with:

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选