technical-impact-analyst
Analyzes GitHub contributions and maps them to the Karpathy Skills framework, providing metrics, alignment scores, and executive summaries.
README
🎯 MCP GitHub PR — Technical Impact Analyst
Servidor MCP (Model Context Protocol) que analisa suas contribuições no GitHub e as mapeia contra o framework de competências do Andrej Karpathy Skills.
📋 Sumário
- Visão Geral
- Arquitetura
- Ferramentas (Tools)
- Instalação
- Configuração do GitHub Token
- Registrando o Servidor
- Uso
- Karpathy Skills Framework
- Stack Técnica
🔍 Visão Geral
Este servidor MCP atua como um Analista de Impacto Técnico, conectando-se à API GraphQL do GitHub para:
- Extrair contribuições (Commits, PRs, Reviews) de um usuário
- Analisar o conteúdo contra o framework Karpathy Skills
- Classificar o tipo e impacto arquitetural de cada contribuição
- Gerar relatórios executivos semanais com tradução técnico → negócio
Os 5 Pilares do Karpathy Skills
| Dimensão | Descrição | Karpathy Principle |
|---|---|---|
| 🏗️ Building from Scratch | Soluções from first principles, substituição de deps pesadas | Goal-Driven Execution |
| 🔍 Attention to Detail | Testes, docs, commits descritivos, diffs cirúrgicos | Surgical Changes |
| 🧠 Deep Understanding | Root cause analysis, otimização na camada certa | Think Before Coding |
| ✨ Technical Clarity | Código simples, PRs focados, 50 linhas > 200 linhas | Simplicity First |
| 🧩 Problem Solving | Desafios complexos, tradeoffs, soluções verificáveis | Goal-Driven Execution |
🏛️ Arquitetura
O projeto segue Clean Architecture com separação clara de camadas:
mcp-github-pr/
├── server.py # 🚀 Entrypoint do servidor MCP
├── pyproject.toml # Configuração do projeto
├── .env.example # Template de variáveis de ambiente
│
├── src/
│ ├── domain/ # 🟢 CAMADA DE DOMÍNIO
│ │ ├── entities.py # Entidades: Commit, PR, Review
│ │ ├── karpathy_skills.py # Modelo: Skills, Scores, Alignment
│ │ └── interfaces.py # Contratos: GitHubClient, Cache
│ │
│ ├── use_cases/ # 🔵 CAMADA DE CASOS DE USO
│ │ ├── get_contribution_metrics.py
│ │ ├── analyze_karpathy_alignment.py
│ │ ├── get_architecture_impact.py
│ │ └── generate_weekly_summary.py
│ │
│ └── infrastructure/ # 🟠 CAMADA DE INFRAESTRUTURA
│ ├── github_client.py # Cliente GitHub GraphQL + REST
│ └── database.py # Cache SQLite com aiosqlite
│
└── data/ # Cache SQLite (gitignored)
└── cache.db
Fluxo de Dependências
Domain ← Use Cases ← Infrastructure ← Server (MCP)
│ │ │
│ │ ├── GitHubClient (httpx)
│ │ └── SQLiteCache (aiosqlite)
│ │
│ ├── GetContributionMetrics
│ ├── AnalyzeKarpathyAlignment
│ ├── GetArchitectureImpact
│ └── GenerateWeeklyImpactSummary
│
├── Entities (Commit, PR, Review)
├── KarpathySkills (SkillCategory, SkillScore)
└── Interfaces (ABCs)
🛠️ Ferramentas (Tools)
1. get_contribution_metrics
Retorna dados brutos de contribuição filtrados por período.
{
"username": "choqs",
"period": "2025-04-01 → 2025-04-30",
"total_commits": 47,
"total_prs": 12,
"total_reviews": 8,
"prs_merged": 10,
"prs_with_tests": 7,
"total_additions": 3421,
"total_deletions": 1205,
"repositories": ["org/api", "org/frontend"]
}
2. analyze_karpathy_alignment
Analisa contribuições e retorna scores 1-5 por dimensão com evidências.
{
"overall_score": 3.8,
"scores": {
"Building from Scratch": {
"score": 4,
"level": "Proficient",
"evidence": ["PR #42: 'Implement custom auth from scratch'"],
"suggestions": []
},
"Attention to Detail": {
"score": 3,
"level": "Competent",
"evidence": ["70% of PRs include test updates"],
"suggestions": ["Update README/docs alongside code changes"]
}
},
"spider_chart_data": {
"Building from Scratch": 4,
"Attention to Detail": 3,
"Deep Understanding": 4,
"Technical Clarity": 4,
"Problem Solving": 3
},
"first_principles_indicators": [
"PR #42: Replaced dependency with custom implementation"
]
}
3. get_architecture_impact
Classifica contribuições e avalia impacto na saúde do código.
{
"impacts": [
{
"pr_number": 42,
"contribution_type": "refactor",
"impact_level": "high",
"health_delta": 0.50,
"complexity_score": 0.67,
"first_principles": {
"detected": true,
"explanation": "Removed unnecessary abstraction layer"
}
}
]
}
4. generate_weekly_impact_summary
Consolida atividades da semana em um relatório executivo.
{
"executive_summary": "During the week of May 05 to May 11, 2025...",
"key_achievements": [
"Merged 5 pull request(s) across 2 repositories",
"3 PR(s) included test coverage updates"
],
"business_value_translations": [
"Improved code maintainability and reduced technical debt",
"Delivered new functionality expanding product capabilities"
],
"spider_chart_data": { ... }
}
📦 Instalação
Pré-requisitos
- Python 3.10+
- uv (recomendado) ou pip
Com uv (Recomendado)
# Clonar o repositório
git clone https://github.com/seu-usuario/mcp-github-pr.git
cd mcp-github-pr
# Instalar dependências
uv sync
# Copiar e configurar variáveis de ambiente
cp .env.example .env
# Edite o .env com seu GITHUB_TOKEN e GITHUB_USERNAME
Com pip
# Clonar o repositório
git clone https://github.com/seu-usuario/mcp-github-pr.git
cd mcp-github-pr
# Criar virtual environment
python -m venv .venv
# Ativar (Windows)
.venv\Scripts\activate
# Ativar (Linux/Mac)
source .venv/bin/activate
# Instalar dependências
pip install -e .
# Configurar ambiente
cp .env.example .env
Dependências de Desenvolvimento
# Com uv
uv sync --extra dev
# Com pip
pip install -e ".[dev]"
🔑 Configuração do GitHub Token
- Acesse GitHub Settings → Tokens
- Clique em "Generate new token (classic)"
- Selecione os escopos (scopes):
- ✅
repo— Acesso completo a repositórios - ✅
read:user— Leitura de perfil do usuário - ✅
read:org— Leitura de organizações (se necessário)
- ✅
- Copie o token gerado
- Configure no arquivo
.env:
GITHUB_TOKEN=ghp_seu_token_aqui
GITHUB_USERNAME=seu_username
⚠️ Nunca commite o arquivo
.env! Ele já está no.gitignore.
🔌 Registrando o Servidor
Claude Desktop
Adicione ao arquivo de configuração do Claude Desktop (claude_desktop_config.json):
Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"technical-impact-analyst": {
"command": "uv",
"args": ["run", "--directory", "D:\\dev\\mcp-github-pr", "python", "server.py"],
"env": {
"GITHUB_TOKEN": "ghp_seu_token",
"GITHUB_USERNAME": "seu_username"
}
}
}
}
Alternativa com pip/python:
{
"mcpServers": {
"technical-impact-analyst": {
"command": "D:\\dev\\mcp-github-pr\\.venv\\Scripts\\python.exe",
"args": ["D:\\dev\\mcp-github-pr\\server.py"],
"env": {
"GITHUB_TOKEN": "ghp_seu_token",
"GITHUB_USERNAME": "seu_username"
}
}
}
}
Cursor
Adicione ao arquivo .cursor/mcp.json na raiz do seu projeto:
{
"mcpServers": {
"technical-impact-analyst": {
"command": "uv",
"args": ["run", "--directory", "D:\\dev\\mcp-github-pr", "python", "server.py"],
"env": {
"GITHUB_TOKEN": "ghp_seu_token",
"GITHUB_USERNAME": "seu_username"
}
}
}
}
Antigravity
Configure nas settings do Antigravity, seção MCP Servers:
{
"technical-impact-analyst": {
"command": "uv",
"args": ["run", "--directory", "D:\\dev\\mcp-github-pr", "python", "server.py"],
"env": {
"GITHUB_TOKEN": "ghp_seu_token",
"GITHUB_USERNAME": "seu_username"
}
}
}
Teste Manual
# Rodar o servidor diretamente (modo stdio)
cd D:\dev\mcp-github-pr
uv run python server.py
# Ou com o MCP Inspector
uv run fastmcp dev inspector server.py
💡 Uso
Uma vez registrado, você pode invocar as ferramentas diretamente no chat:
Exemplos de Prompts
"Mostre minhas métricas de contribuição do último mês"
"Analise meu alinhamento com o Karpathy Skills framework nos últimos 7 dias"
"Qual foi o impacto arquitetural das minhas contribuições no repositório org/api?"
"Gere um resumo executivo da minha semana para stakeholders"
"Compare meu Karpathy Score desta semana com a semana passada"
🧠 Karpathy Skills Framework
O framework é baseado nas observações de Andrej Karpathy sobre pitfalls de engenharia de software, estruturado em 4 princípios:
1. Think Before Coding
"Don't assume. Don't hide confusion. Surface tradeoffs."
Mapeado para: Deep Understanding + Problem Solving
2. Simplicity First
"Minimum code that solves the problem. Nothing speculative."
Mapeado para: Technical Clarity
3. Surgical Changes
"Touch only what you must. Clean up only your own mess."
Mapeado para: Attention to Detail
4. Goal-Driven Execution
"Define success criteria. Loop until verified."
Mapeado para: Building from Scratch + Problem Solving
Como o Score é Calculado
Cada dimensão é avaliada com heurísticas baseadas em:
| Sinal | Dimensão Afetada | Efeito |
|---|---|---|
| PRs com testes | Attention to Detail | +1 se >80% |
| Commits descritivos | Attention to Detail | +1 se >70% |
| PRs com docs atualizados | Attention to Detail | +1 se >50% |
root cause no commit msg |
Deep Understanding | +1 se ≥2 |
| Reviews substantivos | Deep Understanding | +1 se ≥3 |
| PR size < 200 linhas | Technical Clarity | +1 |
| Ratio deletions/additions | Technical Clarity | Evidência |
| First-principles patterns | Build from Scratch | +1/+2 |
| PRs 500+ linhas | Build from Scratch | +1 |
| Cross-cutting changes (5+ files) | Problem Solving | +1 |
| Merge rate ≥80% | Problem Solving | Evidência |
🔧 Stack Técnica
| Tecnologia | Propósito |
|---|---|
| Python 3.10+ | Runtime |
| FastMCP | SDK do Model Context Protocol |
| httpx | HTTP client assíncrono |
| aiosqlite | Cache SQLite assíncrono |
| Pydantic | Validação de dados |
| python-dotenv | Variáveis de ambiente |
| mypy | Type checking estrito |
| ruff | Linter + formatter |
| pytest | Testing |
📄 Licença
MIT License — veja LICENSE para detalhes.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。