Ghost Writer MCP

Ghost Writer MCP

Scans Git repositories, identifies interesting engineering work, and generates LinkedIn post drafts with built-in confidentiality sanitisation.

Category
访问服务器

README

Ghost Writer MCP

An MCP server that scans your Git repositories, identifies interesting engineering work, and generates LinkedIn post drafts — with built-in confidentiality sanitisation.

What it does

Your repos → scan activity → classify by content potential → generate draft → sanitise → review
  1. Scan — reads git log from local repo clones (zero API calls, instant)
  2. Aggregate — groups commits by conventional-commit prefix and clusters related work
  3. Classify — LLM ranks groups by content potential, assigns pillars and angles
  4. Generate — LLM writes a LinkedIn draft in your chosen format (war story, hot take, tactical howto, TIL, deep dive)
  5. Sanitise — three-gate safety: regex blocklist → LLM review → human review

Quick start

Prerequisites

  • Python 3.12+
  • uv (recommended) or pip
  • An LLM provider: Ollama (free, local) or an Anthropic API key
  • Local clones of the repos you want to scan

Install

Option A — clone and run (recommended for customisation):

git clone https://github.com/fabdendev/ghost-writer-mcp.git
cd ghost-writer-mcp
uv sync

Option B — run directly with uvx (no clone needed):

uvx ghost-writer-mcp

Configure

cp config.example.yaml config.yaml

Edit config.yaml with your repos, blocklist, and LLM settings. See config.example.yaml for a fully documented template.

For Ollama (free, local):

llm:
  provider: ollama
  base_url: "http://localhost:11434/v1"
  classifier_model: qwen3:8b
  generator_model: qwen3:8b
  api_key: "ollama"
ollama pull qwen3:8b
ollama serve

For Anthropic (cloud):

llm:
  provider: anthropic
  classifier_model: claude-haiku-4-5-20251001
  generator_model: claude-haiku-4-5-20251001
  api_key: "${ANTHROPIC_API_KEY}"
echo "ANTHROPIC_API_KEY=sk-ant-..." > .env

Add to Claude Code

Add to your Claude Code MCP settings (~/.claude/settings.json):

If installed from clone:

{
  "mcpServers": {
    "ghost-writer": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/ghost-writer-mcp", "fastmcp", "run", "src/server.py"]
    }
  }
}

If using uvx:

{
  "mcpServers": {
    "ghost-writer": {
      "command": "uvx",
      "args": ["ghost-writer-mcp"]
    }
  }
}

Use via MCP

From Claude Code (or any MCP client):

scan_activity                          # scan all configured repos (last 7 days)
scan_activity(repo="my-project")       # scan a single repo
scan_activity(days=30)                 # look back 30 days
generate_draft(activity_index=1)       # generate from top candidate
generate_draft(3, format="hot_take")   # override format
edit_draft(1, "make it shorter")       # refine with natural language
list_drafts(status="pending")          # see saved drafts

Use via CLI

You can also test without an MCP client:

uv run python -m src scan --days 14                    # scan all repos
uv run python -m src scan --repo my-project            # scan one repo
uv run python -m src generate 1                        # draft from top result
uv run python -m src generate 3 --format hot_take      # override format
uv run python -m src list                              # list saved drafts

Tools

Tool Description
scan_activity Scan repos, aggregate commits, classify and rank by content potential
generate_draft Generate a LinkedIn draft from a classified activity
edit_draft Refine a draft with natural language instructions
list_drafts List saved drafts, optionally filtered by status

Scanning modes

Ghost Writer supports two scanning backends:

  • Local git (default) — reads git log from local clones. Zero API calls, instant results. Set local_path on each repo in your config.
  • GitHub API (fallback) — used automatically for repos without local_path. Requires a GitHub token (github.token in config). Fetches up to 30 commits and 20 merged PRs per repo.

You can mix both: some repos with local clones, others via API.

Confidentiality

Ghost Writer uses three safety gates to prevent leaking sensitive information:

  • Gate 1 — Blocklist: regex-based detection and replacement of company names, client names, product names, infrastructure details, and people names
  • Gate 2 — LLM Review: the LLM scans generated text for anything that looks confidential and flags it
  • Gate 3 — Human Review: drafts are saved as pending — you always get the final say

Configure your blocklist and abstractions in config.yaml:

sanitisation:
  blocklist:
    company_names: ["Acme Corp"]
    client_names: ["Big Client"]
    product_names: ["internal-tool"]
    infrastructure: ["prod-db-01.internal"]
    people: ["John Doe"]
  abstractions:
    "Acme Corp": "a mid-size tech company"
    "internal-tool": "an internal platform"

Content pillars

Define what topics you want to post about. The classifier maps activities to pillars:

content:
  pillars:
    - name: ai_engineering
      description: "Building AI agents, LLM integration, prompt engineering"
      repo_signals: ["agent", "llm", "prompt"]
      weight: 1.0
    - name: data_architecture
      description: "Data pipelines, ETL, event-driven systems"
      repo_signals: ["pipeline", "etl", "kafka"]
      weight: 0.8

Post formats

Format Description
tactical_howto Problem → 3-5 concrete steps → takeaway
hot_take Contrarian claim backed by one specific thing you built
war_story What broke, what you tried, what worked, the lesson
til One surprising thing you learned, under 500 chars
deep_dive 3-4 sections with trade-offs and alternatives

Architecture

src/
├── server.py              # FastMCP server (4 tools)
├── cli.py                 # Standalone CLI for testing without MCP
├── config.py              # Pydantic config with env/shell resolution
├── llm_client.py          # Unified Anthropic + OpenAI-compatible client
├── scanner/
│   ├── local_git.py       # Git CLI scanner (primary)
│   ├── github_client.py   # GitHub API scanner (alternative)
│   ├── aggregator.py      # Commit grouping and clustering
│   └── activity.py        # ActivityItem dataclass
├── content/
│   ├── classifier.py      # LLM-based content scoring
│   ├── generator.py       # Draft generation with sanitisation
│   ├── abstractor.py      # Two-gate confidentiality layer
│   └── prompts/           # System prompts (classifier, generator, reviewer)
└── store/
    ├── database.py         # SQLite persistence
    └── blocklist.py        # Regex-based blocklist

Development

uv sync --extra dev
uv run pytest                 # run tests
uv run ruff check src/ tests/ # lint

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

官方
精选