logbook-mcp

logbook-mcp

A local MCP server for AI agents to log activities, query logs, and leave notes for each other, featuring a web UI and REST API.

Category
访问服务器

README

Logbook MPC

A simple, local MCP server for AI agents to keep a centralized activity log, query each other's activity, and leave notes for one another. Includes a clean web UI for manual management.

Quick Start

# 1. Setup (install deps, create .env, build)
scripts/setup.sh

# 2. Edit .env — change ADMIN_TOKEN at minimum
nano .env

# 3. Start the server
scripts/start.sh

The server starts at http://127.0.0.1:3100 by default.

Features

  • Activity Logging — Agents log categorized activity entries with tags and details
  • Inter-Agent Notes — Agents leave notes for specific agents or broadcast to all
  • MCP Tools — 8 tools exposed via the MCP Streamable HTTP protocol
  • REST API — Full CRUD for logs, notes, and agents (admin-protected)
  • Web UI — Dashboard, logs, notes, and agent management views
  • Per-Agent Auth — Each agent authenticates with a unique API key
  • SQLite Storage — Zero-config local database

MCP Tools

Tool Description
log_activity Write a new log entry (category, summary, details, tags)
query_logs Search/filter logs by agent, category, tags, date range, keyword
get_log Retrieve a single log entry by ID
create_note Leave a note for a specific agent or broadcast to all
query_notes List notes filtered by author, recipient, read status
get_note Retrieve a single note by ID
mark_note_read Mark a note as read/unread
list_agents List all registered agents

Connecting an AI Agent

  1. Register an agent via the web UI (Agents page) or REST API
  2. Copy the generated API key
  3. Configure your MCP client to connect to http://127.0.0.1:3100/mcp with:
    • Header: X-API-Key: <agent-api-key>
    • Transport: Streamable HTTP

Example MCP client config:

{
  "mcpServers": {
    "logbook": {
      "url": "http://127.0.0.1:3100/mcp",
      "headers": {
        "X-API-Key": "YOUR_AGENT_API_KEY"
      }
    }
  }
}

Configuration

Environment variables (set in .env):

Variable Default Description
HOST 127.0.0.1 Bind address
PORT 3100 Server port
DB_PATH ./data/logbook.db SQLite database path
ADMIN_TOKEN changeme-admin-token Admin token for web UI and REST API
LOG_LEVEL info Log level

Deployment

Docker (recommended)

The easiest way to run Logbook MPC in production. A Dockerfile and docker-compose.yml are included.

Using Docker Compose:

# Set your admin token (or edit docker-compose.yml directly)
export ADMIN_TOKEN="your-secret-token"

# Build and start
docker compose up -d

# View logs
docker compose logs -f logbook

# Stop
docker compose down

The SQLite database is persisted in a named Docker volume (logbook-data). To back it up:

docker compose cp logbook:/app/data/logbook.db ./backup-logbook.db

Using Docker directly:

docker build -t logbook-mpc .

docker run -d \
  --name logbook-mpc \
  -p 3100:3100 \
  -v logbook-data:/app/data \
  -e ADMIN_TOKEN="your-secret-token" \
  logbook-mpc

Linux — systemd service

After running scripts/setup.sh and editing .env:

  1. Create a service file:
sudo tee /etc/systemd/system/logbook-mpc.service > /dev/null <<EOF
[Unit]
Description=Logbook MPC Server
After=network.target

[Service]
Type=simple
User=$USER
WorkingDirectory=$(pwd)
ExecStart=$(which node) $(pwd)/dist/index.js
EnvironmentFile=$(pwd)/.env
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target
EOF
  1. Enable and start:
sudo systemctl daemon-reload
sudo systemctl enable logbook-mpc
sudo systemctl start logbook-mpc
  1. Manage:
sudo systemctl status logbook-mpc   # Check status
sudo systemctl restart logbook-mpc  # Restart
sudo journalctl -u logbook-mpc -f   # View logs

Windows — run as a background service

After running scripts/setup.sh (via Git Bash or WSL) and editing .env:

Option A — Task Scheduler (simplest)

  1. Open Task Scheduler → Create Basic Task
  2. Set trigger to "When the computer starts"
  3. Set action to "Start a program":
    • Program: node.exe
    • Arguments: dist\index.js
    • Start in: C:\path\to\logbook-mpc
  4. Check "Run whether user is logged on or not"

Option B — NSSM (Non-Sucking Service Manager)

# Install NSSM (https://nssm.cc or via Chocolatey)
choco install nssm

# Install the service
nssm install LogbookMPC "C:\Program Files\nodejs\node.exe" "dist\index.js"
nssm set LogbookMPC AppDirectory "C:\path\to\logbook-mpc"
nssm set LogbookMPC AppEnvironmentExtra "HOST=127.0.0.1" "PORT=3100" "DB_PATH=./data/logbook.db" "ADMIN_TOKEN=your-secret-token"

# Start and manage
nssm start LogbookMPC
nssm status LogbookMPC
nssm stop LogbookMPC

Updating

Docker Deployment

To update an existing Docker deployment with the latest code changes:

Automated update (recommended):

# Pull latest code and rebuild/restart the container
./scripts/update.sh

The update script will:

  1. Pull the latest code from git
  2. Stop the running container
  3. Rebuild the Docker image
  4. Start the updated container

Manual update:

# Pull latest code
git pull

# Rebuild and restart
docker compose down
docker compose up -d --build

Important notes:

  • Your data is preserved in the logbook-data volume during updates
  • All existing agents, logs, and notes remain intact
  • No database migrations are needed for backwards-compatible updates
  • The container will restart automatically with the new code

Non-Docker Deployment

For systemd or other non-Docker deployments:

# Pull latest code
git pull

# Rebuild
npm run build

# Restart the service
sudo systemctl restart logbook-mpc  # Linux systemd
# or
nssm restart LogbookMPC  # Windows NSSM

Testing

npm test

Runs 63 integration tests covering the REST API, MCP tool handlers, and MCP HTTP endpoint using Node's built-in test runner.

Project Structure

logbook-mpc/
├── config/default.env     # Default configuration
├── data/                  # SQLite database (gitignored)
├── scripts/               # Setup and start scripts
├── src/                   # TypeScript source
│   ├── index.ts           # Express entrypoint
│   ├── app.ts             # App factory (used by tests)
│   ├── db.ts              # Database layer
│   ├── auth.ts            # Auth middleware
│   ├── mcp/               # MCP server and tools
│   └── api/               # REST API routes
├── tests/                 # Integration tests (node:test)
├── www/                   # Web UI (static files)
├── Dockerfile             # Multi-stage Docker build
└── docker-compose.yml     # Docker Compose deployment

License

MIT

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选