Brainrot Mcp

Brainrot Mcp

🚀 🧠 Brainrot MCP

Brainrot MCP 是一个模型上下文协议(MCP)服务器,它解决了 AI 编码会话之间上下文丢失的关键问题。你只需存储一次项目决策、待办事项和架构模式,就可以通过任何兼容 MCP 的 AI 助手无缝访问它们。

🚀 快速开始

1. 克隆并设置项目

git clone https://github.com/KnowHow-Software-Inc/brainrot-mcp.git
cd brainrot-mcp

# 创建虚拟环境
uv venv
uv pip install -r backend/requirements.txt
uv pip install -r mcp_server/requirements.txt

2. 启动后端服务

python backend/server.py

若要启用向量搜索,请设置 ENABLE_VECTOR_SEARCH=true

ENABLE_VECTOR_SEARCH=true uv run python server.py

API 服务器将在 http://localhost:8000 启动。

3. 配置 Claude Desktop

将以下内容添加到 ~/.config/claude/claude_desktop_config.json 文件中:

{
"mcpServers": {
"brainrot": {
"command": "uv",
"args": ["run", "python", "/path/to/brainrot-mcp/mcp_server/server.py"],
"env": {
"BACKEND_URL": "http://localhost:8000"
}
}
}
}

4. 重启 Claude Desktop

重启 Claude Desktop,即可开始使用!🎉

✨ 主要特性

  • 自动摘要:长内容会自动生成摘要,方便快速查阅。
  • 智能指令:检索到的上下文会根据标签提供相关的使用指导。
  • 优先级设置:可以为待办事项和技术债设置优先级(低/中/高)。
  • 元数据支持:通过时间戳和来源跟踪,提供丰富的上下文信息。
  • 向量搜索:支持语义搜索,即使没有精确的关键词也能找到相关上下文。
  • 强大的标签支持:可靠的标签过滤和分类功能,便于更好地组织信息。

📦 安装指南

环境要求

  • Python 3.11+
  • uv(推荐)或 pip
  • Claude Desktop 或其他兼容 MCP 的客户端
  • FastMCP 框架(自动安装)
  • SQLite(Python 自带)

安装步骤

按照“快速开始”部分的步骤进行操作。

💻 使用示例

基础用法

存储架构决策

push_context("auth-strategy",
"Using JWT with refresh tokens, 15min access token expiry, Redis for token storage",
tags=["architecture", "security"],
priority="high")

保存项目待办事项

push_context("optimize-database",
"Add database indexes for user queries - currently taking 2+ seconds",
tags=["todo", "performance", "backend"],
priority="high")

后续检索上下文

pop_context("auth-strategy")
# Returns: Architecture decision with smart instructions
# 📐 ARCHITECTURE DECISION: Apply this pattern consistently...

list_contexts(tag="performance")
# Lists all performance-related contexts with summaries

高级用法

多会话项目开发示例

第 1 天:存储数据库模式决策

push_context("db-schema",
"Users table: id, email, password_hash. Posts table: id, user_id, content, created_at",
tags=["database", "schema"],
priority="high")

第 5 天:Claude 会根据智能指令记住你的模式

pop_context("db-schema")
# Returns with instructions: "📌 STORED CONTEXT: Apply this information as appropriate..."

团队编码标准示例

push_context("error-handling",
"Always use custom AppError class with error codes. Log to structured JSON format",
tags=["standards", "errors", "pattern"],
priority="medium")

带优先级的性能跟踪示例

push_context("slow-query-fix",
"User dashboard query optimized from 3s to 200ms using compound index on (user_id, created_at)",
tags=["performance", "solved"],
priority="low")  # Low priority since it's already solved

📚 详细文档

可用的 MCP 工具

工具 描述 示例
push_context 存储上下文并自动生成摘要 存储编码模式、决策、待办事项
pop_context 检索带有智能指令的上下文 获取带有使用指导的架构决策
list_contexts 过滤并列出所有上下文 显示所有待办事项或与安全相关的项目
delete_context 删除过时的上下文 清理已完成的待办事项

项目架构

brainrot-mcp/
├── backend/              # FastAPI server + SQLite database
├── mcp_server/          # MCP server implementation
├── data/                # SQLite database storage
└── frontend/            # Optional web dashboard

流程:MCP 客户端 → MCP 服务器 → HTTP API → SQLite 数据库

🔧 技术细节

运行测试

# 后端测试
cd backend && pytest tests/

# 测试 MCP 服务器
npx @modelcontextprotocol/inspector uv run python mcp_server/server.py

代码质量检查

# 代码检查
ruff check .

# 类型检查
mypy .

📄 许可证

本项目采用 MIT 许可证,详情请参阅 LICENSE 文件。

🎊 未来规划

  • [ ] 支持多项目命名空间
  • [ ] 团队协作功能和共享上下文
  • [ ] 增强 AI 驱动的上下文建议和洞察
  • [ ] 上下文共享的导出/导入功能
  • [ ] VS Code 扩展,实现直接集成
  • [ ] 上下文关系和链接
  • [ ] 对所有存储的上下文进行全文搜索

为那些厌倦了反复向 AI 助手解释相同内容的开发者们精心打造 ❤️

如果 Brainrot MCP 为你节省了时间,请给这个仓库点个星 ⭐!

  • 0 关注
  • 0 收藏,28 浏览
  • system 提出于 2025-09-19 16:57

相似服务问题

相关AI产品