关于 Grumpy Senior Developer as MCP server
Grumpy Senior Developer 是一个基于 Node.js 的 MCP 服务,以带讽刺语气的资深开发者视角审查代码。适合希望获得直接反馈的开发者,也适合需要审阅大量 AI 生成代码的团队。
主要功能
- 01以讽刺口吻审查代码并指出问题
- 02可通过 GENAISCRIPT_DEFAULT_MODEL 配置模型
- 03支持 GenAIScript 支持的多种模型提供方
- 04可通过 npx 直接运行
适用场景
- 01审查由 AI 生成的代码改动
- 02在编辑器中为代码获取审查意见
MCP 相关
该项目是一个 MCP 服务,通过 stdio 传输运行,可接入 VS Code、GitHub Copilot 和 Claude Desktop 等 MCP 客户端,并可用 MCP Inspector 测试其工具。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
工具
本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。
详细介绍
你是资深开发者,厌倦了审查和修复这些靠氛围编程写出的 PR 留下的烂摊子吗?或者你是氛围编程爱好者,厌倦了别人叫你修代码?这款 MCP 工具正适合你们!🫵
这款 MCP 服务旨在提供与你团队里那位(脾气暴躁的)资深开发者相同的视角。它会审查你的代码,告诉你需要修复什么以及代码的问题所在。全程采用你早已习惯的讽刺、愤世嫉俗的语气。
审查示例
待审查的代码:
console.log(`Hello world`)
结果:
Oh great, a one-liner. How inspiring. Let’s dive into this "masterpiece."
1. **Template Literal Abuse:**
Really? A template literal for a static string? Back in my day, we didn't waste resources on unnecessary string interpolation when a plain `'Hello world'` would have done just fine. This reeks of laziness.
2. **Semicolon Missing:**
No semicolon at the end of the line? What is this, JavaScript anarchy? Sure, JavaScript allows it, but don’t come crying to me when you run headfirst into an ASI (Automatic Semicolon Insertion) gotcha.
3. **Unnecessary Backticks:**
Did I mention how pointless those backticks are? Use them when you actually need variable interpolation or multiline strings, not just to show off that you’re following "modern" syntax trends.
4. **Lack of Context:**
What is this accomplishing, exactly? A `"Hello world"` with zero context or an explanation of why it exists? Is this a debugging tool? A placeholder? A cry for help? Back in the old days, we wrote comments. Try it sometime.
5. **Console.log Overkill:**
Oh sure, `console.log` is fine **now**, but don't pretend this is production-grade. Professionals use proper logging systems, not this poor man’s debugging trick.
**Verdict:**
Well, it works, I guess. Next time—if there is a next time—try writing something that doesn’t immediately make me regret my choice of career.
说明
什么是 MCP?
Model Context Protocol (MCP) 是一种开放协议,用于规范应用向大模型提供上下文的方式。可以把 MCP 想成 AI 应用的 USB-C 接口。正如 USB-C 提供了连接设备与各种外设和配件的标准方式,MCP 也提供了连接 AI 模型与不同数据源和工具的标准方式。
用法
此工具需要在系统中安装 Node.js 20+。
与 GitHub Copilot 搭配使用
重要
VS Code 和 GitHub Copilot 目前需要你启用 Agent 模式,或使用最新版 VS Code Insiders 或更高版本,才能支持 MCP。你可以在常规版本的 VS Code 旁安装 Insiders 版本。
你可以通过以下链接安装 MCP 服务:
也可以使用命令行:
# For VS Code
code --add-mcp '{"name":"grumpydev","command":"npx","args":["-y","grumpydev-mcp"]}'
# For VS Code Insiders
code-insiders --add-mcp '{"name":"grumpydev","command":"npx","args":["-y","grumpydev-mcp"]}'
或者在工作区的 .vscode/mcp.json 文件中手动添加:
{
"servers": {
"grumpydev-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"grumpydev-mcp",
],
// Optional, if you want to configure the model
// "envFile": "${workspaceFolder}/.env"
}
}
}
与 Claude 桌面应用搭配使用
将以下内容添加到 claude_desktop_config.json:
{
"mcpServers": {
"grumpydev-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"grumpydev-mcp",
],
// Optional, if you want to configure the model
// "env": {
// "GENAISCRIPT_DEFAULT_MODEL": "<your_model_config>",
// }
}
}
}
使用 MCP inspector 测试
- 在终端窗口中启动 MCP Inspector:
npx -y @modelcontextprotocol/inspector - 按住 Ctrl 并单击应用显示的 URL(例如 http://127.0.0.1:6274),打开 MCP Inspector Web 应用。
- 将命令设为
npx,将参数设为-y grumpydev-mcp,然后单击 Connect 按钮。 - 在 Tools 选项卡中,选择 List Tools。单击某个工具并选择 Run Tool。
模型配置
你可以通过设置 GENAISCRIPT_DEFAULT_MODEL 环境变量,配置此 MCP 服务使用的模型。此变量应包含你要使用的模型提供商和名称,例如 github:gpt-4o。默认情况下,它使用 GitHub Models 中的 GPT-4o 模型。
你可以使用 GenAIScript 支持的任何提供商和模型。更多详情请参阅模型配置部分。某些模型可能需要通过环境变量进行额外配置,例如 API 密钥或其他凭据。
关于
此 MCP 工具使用 GenAIScript 构建。
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。