personal-context-mcp
Stores personal context as markdown files and exposes them via MCP for AI assistants to retrieve user preferences, skills, and background.
README
<div align="center">
🧠 personal-context-mcp
把「你是谁」存一次,让每个 AI 都记得你。 Store who you are once — let every AI remember you.
</div>
🇨🇳 中文
✨ 这是什么
换一个新 AI、新开一个聊天框,你是不是又得从头交代一遍「我是谁、我喜欢什么风格、我做过什么」?
personal-context-mcp 把这些存成 markdown,通过 MCP(Model Context Protocol) 暴露成一组工具。任何支持 MCP 的 AI(Claude Code、Claude Desktop、Cursor…)接上后,调用一次 who_am_i 就「认识你」,不用再自我介绍。
📦 数据一份,插头随时加 · ☁️ 放 GitHub 永久免费 · 🔌 本地 stdio 零托管 · 🔐 分层可见
💡 核心理念
| 说明 | |
|---|---|
| 📦 数据与服务分离 | 你的资料是 context/ 下的纯 markdown,放在你自己的 git 仓库里;server 只是薄薄一层,随时可换、可拔。 |
| ☁️ 永久留存、不吃算力 | 跟 GPU 无关。数据放 GitHub 永久免费,server 本地跑、断网可用。哪天没有任何服务器,光靠这个 git 仓库你依然拥有全部资料。 |
| 🔐 分层可见(tier) | public ⊂ recruiter ⊂ friend ⊂ private。同一份资料,陌生人 / 招聘方 / 朋友 / 自己看到的范围不同。 |
📁 目录结构
personal-context-mcp/
├── server.py # 🔌 MCP server(stdio)
├── context/ # ★ 数据层:你的资料,改这里
│ ├── style.md # 🎨 风格习惯
│ ├── preferences.md # ⚙️ 偏好设置
│ ├── skills.md # 🧰 用过的 skill
│ ├── background.md # 📖 人生背景(可公开)
│ └── private.md # 🔒 私密信息(gitignore,仅本地 tier=private 可见)
├── ingest/import_file.py # 📄 简历/文件 → 纯文本(供 AI 解析)
└── pyproject.toml
🚀 快速开始
# 1) 装依赖(mcp / pyyaml / pypdf / python-docx)
cd personal-context-mcp
uv sync
# 2) 本地可视化调试(打开 MCP Inspector,逐个点工具试)
uv run mcp dev server.py
# 3) 接入 Claude Code / Cursor
uv run mcp install server.py --name personal-context
或手动在 AI 的 MCP 配置里加一段(注意换成绝对路径):
{
"mcpServers": {
"personal-context": {
"command": "uv",
"args": ["--directory", "/绝对路径/personal-context-mcp", "run", "python", "server.py"]
}
}
}
接入后,对 AI 说一句 「调用 who_am_i 了解我」 就行 ✅
🔄 它是怎么工作的
flowchart LR
A["📝 context/*.md<br/>你的资料"] --> B["🔌 MCP Server<br/>server.py (stdio)"]
B -->|"who_am_i / search…"| C["🤖 任意 AI<br/>Claude / Cursor…"]
C -->|"save_context 写回"| A
D["📄 简历 / 文件"] -->|"extract_file"| C
🧰 提供的工具
| 工具 | 作用 |
|---|---|
🙋 who_am_i(viewer_tier) |
一次性返回该 tier 下全部可见内容,换新 AI 时用它「一键认识你」 |
📋 list_context(viewer_tier) |
列出所有板块 |
📖 get_context(slug, viewer_tier) |
读某个板块全文 |
🔍 search_context(query, viewer_tier) |
关键词搜索 |
💾 save_context(slug, title, body, tier, tags) |
写入/更新板块(AI 整理完经历后存回来) |
📄 extract_file(path) |
抽取 pdf/docx/txt/md 文本,供 AI 解析简历 |
📄 上传简历 / 文件,自动整理进知识库
不用写死解析逻辑 —— 让 AI 来做:
- 让 AI
extract_file("我的简历.pdf")拿到纯文本; - AI 解析、优化成结构化内容;
- AI
save_context(slug="background", …)写回context/。
命令行也能单独抽文本:
uv run python ingest/import_file.py 我的简历.pdf
🔐 分层可见(tier)
每个 .md 头部的 tier 字段决定谁能看到:
public ⊂ recruiter ⊂ friend ⊂ private
陌生人 招聘方 朋友 只有自己
调用时传 viewer_tier,server 只返回该层级及以下的内容。私密信息(如内网路径、身份细节)建议单独放 context/private.md 并加进 .gitignore,这样它永不进入 GitHub,只在本地 tier=private 时可见。
☁️ 留存到 GitHub
cd personal-context-mcp
git add . && git commit -m "update my context"
git push
💡
context/private.md已在.gitignore里;其余板块默认可公开。若想全部私有,直接用私有仓库即可。
<!-- EN_APPEND_MARK -->
🇬🇧 English
✨ What is this
Every time you switch to a new AI or open a fresh chat, you re-explain who you are, what style you like, what you've built. 😮💨
personal-context-mcp stores all of that as markdown and exposes it through the Model Context Protocol (MCP). Any MCP-capable AI (Claude Code, Claude Desktop, Cursor…) plugs in, calls who_am_i once, and instantly knows you — no more re-onboarding.
📦 One data source, plug in anytime · ☁️ Free forever on GitHub · 🔌 Local stdio, zero hosting · 🔐 Tiered visibility
💡 Core ideas
| 📦 Data ≠ server | Your data is plain markdown under context/, living in your own git repo. The server is a thin, swappable layer. |
| ☁️ Permanent, compute-free | No GPU involved. Data lives on GitHub for free; the server runs locally and works offline. Even with no server anywhere, the git repo alone keeps all your data. |
| 🔐 Tiered visibility | public ⊂ recruiter ⊂ friend ⊂ private. Strangers / recruiters / friends / you each see a different slice of the same data. |
📁 Layout
personal-context-mcp/
├── server.py # 🔌 MCP server (stdio)
├── context/ # ★ data layer — edit these
│ ├── style.md # 🎨 style & habits
│ ├── preferences.md # ⚙️ preferences
│ ├── skills.md # 🧰 skills used
│ ├── background.md # 📖 background (public-safe)
│ └── private.md # 🔒 private (gitignored, tier=private only)
├── ingest/import_file.py # 📄 resume/file → plain text (for the AI to parse)
└── pyproject.toml
🚀 Quick start
# 1) install deps
cd personal-context-mcp
uv sync
# 2) local visual debugging (MCP Inspector)
uv run mcp dev server.py
# 3) install into Claude Code / Cursor
uv run mcp install server.py --name personal-context
Or add this to your AI's MCP config (use an absolute path):
{
"mcpServers": {
"personal-context": {
"command": "uv",
"args": ["--directory", "/abs/path/personal-context-mcp", "run", "python", "server.py"]
}
}
}
Then just tell the AI: "Call who_am_i to learn about me." ✅
🧰 Tools
| Tool | Purpose |
|---|---|
🙋 who_am_i(viewer_tier) |
Return everything visible at that tier in one shot — "know me instantly" |
📋 list_context(viewer_tier) |
List all sections |
📖 get_context(slug, viewer_tier) |
Read one section |
🔍 search_context(query, viewer_tier) |
Keyword search |
💾 save_context(slug, title, body, tier, tags) |
Write/update a section |
📄 extract_file(path) |
Extract text from pdf/docx/txt/md for the AI to parse |
📄 Import a resume, let the AI organize it
No hard-coded parsing — let the AI do it:
- AI calls
extract_file("resume.pdf")to get plain text; - AI parses and structures it;
- AI calls
save_context(slug="background", …)to write it back.
CLI also works:
uv run python ingest/import_file.py resume.pdf
🔐 Tiered visibility
The tier field in each .md front-matter controls who sees it. The server returns only content at or below the requested viewer_tier. Keep private data (internal paths, identity details) in context/private.md and gitignore it — it never reaches GitHub and shows only at local tier=private.
☁️ Persist to GitHub
git add . && git commit -m "update my context"
git push
<div align="center">
Made with 🧠 by KrystalJin1 · MIT License
</div>
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。