personal-context

personal-context

Enables LLMs to access a user's personal writing context—voice, style, opinions, expertise, projects, and communication patterns—via curated markdown files, helping the LLM match the user's voice when generating written content.

Category
访问服务器

README

Personal Context

A minimal system for giving LLMs your writing voice, opinions, and style. Curated markdown files served via MCP using FastMCP.

Inspired by Karpathy's LLM Wiki and nlwhittemore's Personal Context Portfolio.

More background on the why behind this project here.

How It Works

context/*.md  →  FastMCP server  →  MCP  →  Claude Code (or any MCP client)

You maintain 6 markdown files about yourself. A FastMCP server exposes them as tools. When you ask an LLM to write something, it can pull your context and match your voice.

The 6 Context Files

File What It Captures
identity.md Background, career arc, personal details
writing-style.md Voice, tone, sentence patterns, vocabulary, annotated examples
opinions.md Stances on topics you write about
expertise.md Domains of deep knowledge
projects.md Current and notable past projects
communication.md How you communicate in different contexts (Slack, email, docs)

Each file has YAML frontmatter tracking last_updated and source_refs (which source materials informed the content).

Getting Started

Use this as a template

  1. Fork or clone this repo
  2. Delete everything in context/ — those are my files, not yours
  3. Install dependencies and start filling in your own context

Setup

git clone <this-repo> personal-context
cd personal-context
uv venv && source .venv/bin/activate
uv pip install -e ".[dev]"

Bootstrap from existing writing (optional)

If you have a folder of markdown blog posts or writing samples, the ingest script can generate draft context files:

# Copy or symlink your markdown files
ln -s /path/to/your/blog/posts sources/blogs

# Generate drafts (--cutoff filters by date in frontmatter)
python scripts/ingest.py sources/blogs/ --cutoff 2024-01-01 --output drafts

This creates draft files in drafts/ with excerpts grouped by category. Review them, extract what's useful, and write your curated versions into context/.

The ingest script expects markdown files with YAML frontmatter containing title, pubDate, and optionally categories. If your files don't have frontmatter, you can skip this step and write context files manually.

Write your context files manually

If you don't have existing writing to ingest, just create the 6 files in context/ yourself. Use this template:

---
last_updated: 2026-05-30
source_refs: []
---

# Writing Style

## Voice
[How do you write? Conversational? Formal? Technical? Direct?]

## Patterns
[Recurring structures, transitions, vocabulary choices]

## Examples
[2-3 representative excerpts from your actual writing, with annotations]

A good approach: start a Claude Code session and ask it to interview you. Share writing samples and let it draft context files for you to review and edit.

Connect to Claude Code

The MCP server runs entirely locally — Claude Code spawns it as a subprocess on your machine, and it just reads markdown files from disk. No data is sent to external services beyond the normal Claude API calls.

Register the server as a user-scoped MCP so it's available in every Claude Code session, regardless of which project you're working in:

claude mcp add --scope user personal-context -- /absolute/path/to/personal-context/.venv/bin/python /absolute/path/to/personal-context/server.py

Restart Claude Code. The MCP tools will be available in every session.

Setting up on another machine

To use the same context on a work machine or second computer:

  1. Clone the repo: git clone <your-fork> personal-context
  2. Install: cd personal-context && uv venv && source .venv/bin/activate && uv pip install -e .
  3. Register the MCP server (update paths to match where you cloned it):
    claude mcp add --scope user personal-context -- /absolute/path/to/personal-context/.venv/bin/python /absolute/path/to/personal-context/server.py
    
  4. Restart Claude Code

That's it — same context files, same tools, works in any repo you open. If you keep your context files committed, git pull on either machine keeps them in sync.

Make it automatic

By default, Claude Code won't call MCP tools unless you ask. To have it pull your context automatically when drafting written content, add a rule to your global ~/.claude/CLAUDE.md:

## Personal Context (MCP)

When drafting any written content (emails, messages, docs, social posts, bios, etc.), call `get_writing_style` from the `personal-context` MCP server first to match my voice and tone. For tasks that benefit from broader context (introductions, project summaries, etc.), use `get_all_context` instead.

Test it

In a new Claude Code session:

  • Ask Claude to use your writing style to draft something
  • It should automatically call get_writing_style or get_all_context
  • Compare the output to how you actually write and iterate on your context files

Adding Context Over Time

This system is manually curated, you update the files, this is not an automated pipeline.

When to update

  • After publishing new writing — review if it reveals patterns not yet captured in writing-style.md
  • After changing jobs/projects — update projects.md and identity.md
  • After noticing the LLM gets your voice wrong — the gap between output and expectation tells you what's missing
  • After adding new source material — drop files in sources/private/ (gitignored) or sources/blogs/, re-run ingest if helpful

How to update

  1. Edit the relevant context/*.md file directly
  2. Update the last_updated date in frontmatter
  3. Add any new source refs to source_refs
  4. Commit

Private sources

Work emails, Slack exports, or other private writing go in sources/private/ which is gitignored. You can reference them in source_refs for provenance without committing the content.

Since sources/private/ is gitignored, these files are device-specific — they won't sync when you git pull on another machine. If you need the same private sources on multiple machines, copy them manually or sync via something outside git (e.g., iCloud, Dropbox).

Private served context

sources/private/ holds raw source material for ingest — it is not read by the MCP at runtime. If you have curated context that the MCP should serve but that must stay out of a public repo, put it in context/private.md, which is gitignored.

The server globs context/*.md, so context/private.md is returned by get_all_context() and context://private.md locally, but git never commits it. Like sources/private/, it's device-specific — copy it manually if you run the MCP on another machine.

Re-running ingest

If you add new blog posts or writing samples to sources/blogs/:

python scripts/ingest.py sources/blogs/ --cutoff 2024-01-01 --output drafts

This regenerates drafts (in drafts/, also gitignored). Review the new excerpts and fold anything useful into your context files.

MCP Tools

The server exposes:

Tool/Resource What It Does
get_writing_style() Returns your writing-style.md — the most commonly needed file
get_all_context() Returns all context files as a dict (includes a local private.md if present)
context://{filename} Resource access to any individual file by name

Project Structure

personal-context/
├── context/           # Your curated context files (the product)
│   └── private.md     # Optional private served context (GITIGNORED)
├── sources/
│   ├── blogs/         # Public writing samples (committed or symlinked)
│   └── private/       # Private writing samples (GITIGNORED)
├── scripts/
│   └── ingest.py      # Bootstrap drafts from existing writing
├── drafts/            # Generated drafts from ingest (GITIGNORED)
├── tests/             # Tests for ingest script and server
├── server.py          # FastMCP MCP server
├── pyproject.toml
└── README.md

Running Tests

python -m pytest -v

Security

This repo is designed to be public, but remember you are putting personal information in it. A few things to know:

  • Path traversal protection. The get_context resource handler validates that requested filenames resolve inside the context/ directory. Traversal attempts like ../../etc/passwd are rejected.
  • Private sources are gitignored. sources/private/ is in .gitignore so work emails, Slack exports, etc. stay local. But be careful with source_refs in frontmatter — the filenames are committed even if the files aren't. Use opaque names like work-email-1.md instead of descriptive titles.
  • Private served context is gitignored. context/private.md is in .gitignore for curated context the MCP should serve locally but never commit (e.g. work-sensitive notes). It's the runtime-served counterpart to sources/private/.
  • Review your context files before committing. These files are meant to be public, but watch for details you didn't intend to share: financial specifics, internal company information, health details, or anything useful for phishing. If in doubt, leave it out.
  • .env is gitignored. If you extend this with API keys, they won't be committed accidentally.

Philosophy

  • Start minimal. 6 files was enough for me as a starting point. Add complexity only when you outgrow it.
  • Curate manually. You know your voice better than any automated pipeline. The LLM can help draft, but you decide what stays.
  • Iterate from use. The best edits come from noticing when the LLM gets something wrong about your writing.
  • Keep private things private. The sources/private/ directory exists so you can reference work writing without committing it.

推荐服务器

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

官方
精选