apple-books-mcp: Instructions file for GitHub Copilot

.github/copilot-instructions.md

apple-books-mcp copilot-instructions.md is an instructions file for GitHub Copilot from ragmha/apple-books-mcp. It costs 320 tokens per session, scanned A, original, MIT.

Project-specific coding guidance for an Apple Books connector built with Bun, TypeScript, SQLite, and Zod. It describes the project structure, query conventions, and handling of Apple Books database records.

In plain words
What is it for?
It helps maintain queries and data handling for books, collections, annotations, timestamps, and the connector's MCP server.
Why use it?
It gives an agent the rules needed to make consistent changes in a codebase that reads Apple Books' internal databases.

Instructions file for GitHub Copilot

Written for GitHub Copilot: a Copilot instructions file.

This is ragmha/apple-books-mcp's own configuration. It tells GitHub Copilot how to work on apple-books-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything apple-books-mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to ragmha/apple-books-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/ragmha/apple-books-mcp/main/.github/copilot-instructions.md
Clone the repo
git clone --depth 1 https://github.com/ragmha/apple-books-mcp

Made for: GitHub Copilot.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for apple-books-mcp copilot-instructions.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/ragmha/apple-books-mcp/copilot-instructions.svg)](https://agentmods.dev/instructions/ragmha/apple-books-mcp/copilot-instructions)
Your own site
<a href="https://agentmods.dev/instructions/ragmha/apple-books-mcp/copilot-instructions"><img src="https://agentmods.dev/badge/instructions/ragmha/apple-books-mcp/copilot-instructions.svg" alt="Measured on agentmods" height="20"></a>
Per session 320 This file is loaded in full into every session.
When invoked 320 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00320 $0.00320
Opus 5 $0.00160 $0.00160
Sonnet 5 $0.00064 $0.00064
Haiku 4.5 $0.00032 $0.00032

Measured 7d ago against content hash 40343769a9a1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

apple-books-mcp copilot-instructions.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/copilot-instructions.md · 37 lines

What it actually says

Copilot Instructions

This is a Bun/TypeScript MCP (Model Context Protocol) server for Apple Books.

Tech Stack

  • Runtime: Bun
  • Language: TypeScript
  • Validation: Zod v4
  • Protocol: MCP SDK (@modelcontextprotocol/sdk)
  • Database: SQLite via bun:sqlite (Apple Books internal databases)

Project Structure

  • src/index.ts - Entry point, starts stdio transport
  • src/server.ts - MCP server with tool definitions
  • src/db/ - Database layer
    • connection.ts - Database connections
    • query.ts - Fluent query builder with Zod validation
    • schemas.ts - Zod schemas for books, collections, annotations
    • constants.ts - Table names, paths, entity types
    • books.ts, collections.ts, annotations.ts - Domain queries

Conventions

  • Use the fluent query builder (createDb(db).selectFrom(table, schema)) for queries
  • Zod schemas handle row→presentation transformation
  • Raw column names (e.g., ZTITLE, Z_PK) stay as strings in queries
  • Table names use constants from constants.ts
  • Core Data timestamps need conversion via coreDataToISO()

Important Notes

  • This accesses Apple Books' internal SQLite databases (educational use only)
  • Write operations create backups and restart Apple Books
  • Core Data epoch is 2001-01-01 (not Unix epoch)
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 37 lines · 320 tokens per session scan A 40343769a9a1

Subscribe to this mod's changes

apple-books-mcp copilot-instructions.md is an instructions file published in the GitHub repository ragmha/apple-books-mcp (0 stars, last pushed 3mo ago), licensed MIT. It adds 320 tokens to every session, about $0.0016 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.