About Capture API
Capture API is an MCP server published by brettimus in the Data category: personal capture API for saving notes/links from Apple Shortcuts. Built with Bun, Hono, SQLite.
The repository has 1 stars and 0 forks, with the last commit 9 months ago. Six months or more without a commit doesn't mean the server is broken, but check the open issues before depending on it in production.
Install
git clone https://github.com/brettimus/capture-apiThis server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.
Ask AI
Ask AI about Capture API
Powered by Claude · Grounded in docs
Security checks
Static checks derived from the repository 22 hours ago. Heuristics on the source, not an audit.
- ✓README presentThe repository ships documentation.
- !License declaredNo license file. Legally you have no right to use it in a product.
- ✓Tests presentA test suite exists in the repository.
- ✓Dependencies pinnedA lockfile pins dependency versions.
- ✓No dynamic code executionSource scan found no eval, dynamic Function, or shell execution.
- !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.
README
Capture API
A personal capture API designed for saving quick notes, links, and thoughts from Apple Shortcuts. Built with Bun, Hono, and SQLite for persistence.
Overview
This API serves as a personal inbox for capturing anything from my iPhone via Apple Shortcuts. It provides:
- REST API - Simple endpoints for saving and retrieving captures
- API Key Auth - Bearer token authentication for security
- SQLite Storage - Persistent local database
- MCP Server - Access captures from Claude via MCP protocol
Features
Core Capture API
-
Create Capture -
POST /api/captures- Accept text content, optional title, optional URL
- Auto-generate timestamp
- Support tags (comma-separated)
- Return created capture with ID
-
List Captures -
GET /api/captures- Return all captures, newest first
- Support
?limit=Nquery param - Support
?tag=tagnamefiltering - Support
?search=termfull-text search
-
Get Single Capture -
GET /api/captures/:id- Return single capture by ID
- 404 if not found
-
Delete Capture -
DELETE /api/captures/:id- Soft delete (mark as deleted)
- 404 if not found
Authentication
-
API Key Setup
- Generate API key on first run (save to
.env) - Read from
CAPTURE_API_KEYenv var - Require
Authorization: Bearer <key>header
- Generate API key on first run (save to
-
Auth Middleware
- Validate bearer token on all
/api/*routes - Return 401 for missing/invalid token
- Skip auth for health check endpoint
- Validate bearer token on all
Health & Status
-
Health Check -
GET /health- No auth required
- Return
{ status: "ok", timestamp: "..." }
-
Stats Endpoint -
GET /api/stats- Total capture count
- Captures this week
- Top tags
MCP Server
-
List Captures Tool
list_captures- Get recent captures- Parameters: limit (optional), tag (optional)
-
Search Captures Tool
search_captures- Full-text search- Parameters: query (required)
-
Create Capture Tool
create_capture- Add new capture- Parameters: content (required), title, url, tags
Tech Stack
- Runtime: Bun
- Framework: Hono (lightweight web framework)
- Database: SQLite via bun:sqlite
- Auth: Bearer token (API key)
- MCP: @modelcontextprotocol/sdk
Database Schema
CREATE TABLE captures (
id TEXT PRIMARY KEY,
content TEXT NOT NULL,
title TEXT,
url TEXT,
tags TEXT, -- JSON array
created_at TEXT NOT NULL,
deleted_at TEXT
);
CREATE INDEX idx_captures_created ON captures(created_at DESC);
CREATE INDEX idx_captures_deleted ON captures(deleted_at);
API Examples
Create a capture (from Apple Shortcuts)
curl -X POST http://localhost:3000/api/captures \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "Interesting article about AI agents",
"url": "https://example.com/article",
"tags": ["reading", "ai"]
}'
List recent captures
curl http://localhost:3000/api/captures?limit=10 \
-H "Authorization: Bearer $API_KEY"
Search captures
curl http://localhost:3000/api/captures?search=ai \
-H "Authorization: Bearer $API_KEY"
Project Structure
capture-api/
├── src/
│ ├── index.ts # Main entry, server setup
│ ├── routes/
│ │ ├── captures.ts # Capture CRUD routes
│ │ └── health.ts # Health check route
│ ├── middleware/
│ │ └── auth.ts # API key validation
│ ├── db/
│ │ ├── schema.ts # Database initialization
│ │ └── queries.ts # Database operations
│ └── mcp/
│ └── server.ts # MCP server implementation
├── tests/
│ ├── captures.test.ts # API tests
│ └── auth.test.ts # Auth tests
├── package.json
├── tsconfig.json
└── README.md
Running
# Development
bun run dev
# Production
bun run src/index.ts
# Run MCP server
bun run src/mcp/server.ts
Environment Variables
CAPTURE_API_KEY=<generated-on-first-run>
CAPTURE_DB_PATH=./captures.db
PORT=3000
README fetched from the repository 22 hours ago. The original is authoritative.