🔬 AB MCP服务器
A. 综合模型上下文协议(MCP)服务器 建造于 @vercel/mcp适配器 提供 高级开发工具 包括人工智能代理协助、Swift/Kotlin代码审查、Python集成、网络抓取和研究功能。
现场演示: https://ab-mcp.vercel.app
🎯 什么是AB MCP服务器?
AB MCP服务器是 生产就绪的MCP服务器 这提供了 9个强大的开发工具 通过标准化的界面。无论你是否在 光标, 克劳德桌面,或 帆板运动,AB MCP Server将高级AI功能直接无缝集成到您的开发工作流程中。
🚀 主要亮点
- 🤖 AI 代理:OpenAI GPT驱动的智能自动检测助手
- 📱 Swift代码审查:基于Clean Architecture原则的全面iOS开发分析
- 🤖 Kotlin代码审查:使用MVVM模式完成Android开发审查
- 🐍 Python集成:使用数据科学库无缝执行TypeScript到Python
- 🌐 Web剪贴套件:使用Firecrawl API进行高级web抓取(3个工具)
- 🔍 研究助理:智能Swift/Kotlin文档研究
- ℹ️ 服务器监控:实时服务器状态和工具可用性
┌─────────────────────────────────────────────────────────────────┐
│ AB MCP SERVER │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────┐ ┌──────────────┐ ┌─────────────────┐ │
│ │ Web UI │ │ MCP Server │ │ External APIs │ │
│ │ │ │ │ │ │ │
│ │ ┌─────────┐ │ │ ┌──────────┐ │ │ ┌─────────────┐ │ │
│ │ │ Agent │◄┼────┼►│ Agent │◄┼────┼►│ OpenAI GPT │ │ │
│ │ │ Chat │ │ │ │ Tool │ │ │ │ Models │ │ │
│ │ └─────────┘ │ │ └──────────┘ │ │ └─────────────┘ │ │
│ └─────────────┘ │ │ │ │ │
│ │ ┌──────────┐ │ │ ┌─────────────┐ │ │
│ ┌─────────────┐ │ │ Swift │ │ │ │ Firecrawl │ │ │
│ │ MCP │ │ │ Review │ │ │ │ API │ │ │
│ │ Clients │ │ └──────────┘ │ │ └─────────────┘ │ │
│ │ │◄───┼► │ │ │ │
│ │ • Claude │ │ ┌──────────┐ │ │ ┌─────────────┐ │ │
│ │ • Cursor │ │ │ Kotlin │ │ │ │ Python │ │ │
│ │ • Windsurf │ │ │ Review │ │ │ │ Runtime │ │ │
│ └─────────────┘ │ └──────────┘ │ │ └─────────────┘ │ │
│ │ │ └─────────────────┘ │
│ │ ┌──────────┐ │ │
│ │ │ Python │ │ │
│ │ │ Exec │ │ │
│ │ └──────────┘ │ │
│ │ │ │
│ │ ┌──────────┐ │ │
│ │ │ Web │ │ │
│ │ │ Scraping │ │ │
│ │ └──────────┘ │ │
│ │ │ │
│ │ ┌──────────┐ │ │
│ │ │ Research │ │ │
│ │ │ Assistant│ │ │
│ │ └──────────┘ │ │
└─────────────────────────────────────────────────────────────────┘✨ 核心功能
🤖 AI代理助理
这 OpenAI GPT驱动的代理 提供智能辅助 自动检测 功能和跨开发工作流程的无缝集成。
🧠 主要特点
- 智能自动检测:根据用户查询自动建议相关工具
- 多模型支持:GPT-4o、GPT-4、GPT-3.5涡轮增压器,带车型选择
- web界面:具有对话管理功能的实时聊天界面
- MCP集成:与Cursor、Claude Desktop、Windsurf无缝集成
📱 Swift iOS代码评测
全面的iOS开发分析 采用行业最佳实践、清洁架构原则和SOLID设计模式。
🔍 审查能力
- 内存管理:强制展开检测、保留循环分析、弱/强模式
- 穿线安全:DispatchQueue使用、异步/等待模式、主线程验证
- SwiftUI/UIKit:现代模式检测,不推荐使用API警告
- 演出:字符串操作、收集效率、算法改进
- 安全:Keychain与UserDefaults、HTTPS强制、数据保护
- 建筑:MVVM模式、存储库设计、依赖注入
- 清洁代码:函数长度、有意义的命名、文档标准
- 坚实的原则:单一职责,开放/封闭,Liskov替代
🤖 Kotlin安卓代码评测
完成Android开发审查 使用干净的架构、MVVM模式和现代Kotlin最佳实践。
🔍 审查能力
- 零安全:正确的可空处理、安全调用、elvis运算符使用
- 协程:结构化并发、适当的调度程序、流模式
- Android生命周期:活动/片段模式,ViewBinding与findViewById
- 建筑:MVVM实现、存储库模式、Hilt/Dagger DI
- 数据类:正确使用与常规类、不变性模式
- 演出:内存泄漏检测、GlobalScope避免、效率
- 清洁代码:函数组合、有意义的名称、幻数消除
- 坚实的原则:适用于Android/Kotlin开发环境
🐍 Python集成
从TypeScript到Python的无缝执行 内置数据科学库和动态包管理。
🚀 主要特点
- 内置图书馆:pandas、numpy、matplotlib、seaborn、datetime
- 动态软件包安装:按需安装任何PyPI包
- 多种退货类型:文本、JSON和图像(matplotlib图)
- TypeScript集成:TS和Python之间的无缝数据交换
🌐 Web抓取和分析套件
高级网页抓取 由...驱动 Firecrawl API 使用SEO分析功能进行干净、结构化的数据提取。
🔧 三种可用工具
- Web剪贴器:清洁内容提取,主要内容过滤
- URL分析器:SEO分析、内容结构和元标签验证
- 批量刮板:多URL处理(最多可同时处理5个URL)
🔍 研究助理
智能研究能力 用于Swift/Kotlin文档,具有自动源代码发现和相关性分析功能。
🧠 主要特点
- 数据源发现:自动从Swift.org和Kotlinlang.org中查找相关文档
- 内容分析:提取关键信息和最佳做法
- 相关性评分:按与查询的相关性对结果进行排名
- 多语言:支持Swift和Kotlin研究
ℹ️ 服务器信息和监控
实时服务器状态 以及全面的工具可用性监控。
提供实时服务器状态、工具可用性、性能指标和系统信息。
🚀 入门指南
📋 先决条件
- Node.js 18岁或以上
- npm 或 pnpm 包管理器
- OpenAI API密钥 用于AI代理功能
- Firecrawl API密钥 用于网页抓取功能
⚡ 快速设置
- 克隆并安装:
git clone https://github.com/aditi711/ab-mcp-server.git
cd ab-mcp-server
npm install- 环境配置:
创建 .env.local 文件:
# Required for AI Agent functionality
OPENAI_API_KEY=sk-proj-your-openai-api-key-here
# Required for web scraping features
FIRECRAWL_API_KEY=fc-your-firecrawl-api-key-here获取API密钥:
- 启动开发服务器:
npm run dev- 访问Web界面:
打开 http://localhost:3000 查看服务器状态页面和AI代理聊天界面。
🔌 MCP客户端配置
MCP服务器端点: http://localhost:3000/api/sse
克劳德桌面
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json\ 视窗: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"ab-mcp-server": {
"transport": {
"type": "sse",
"url": "http://localhost:3000/api/sse"
}
}
}
}光标
方法1:一键集成(推荐) 使用“🚀 “添加到光标”按钮 https://ab-mcp.vercel.app 直接整合。
方法2:终端命令
# Direct installation using mcp-remote
npx mcp-remote add http://localhost:3000/api/sse --name ab-mcp-server --type sse帆板运动
增添 ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"ab-mcp-server": {
"transport": {
"type": "sse",
"url": "http://localhost:3000/api/sse"
}
}
}
}🧪 测试与开发
🔧 MCP服务器测试
基本连接:
# Test server health
curl -X GET http://localhost:3000/api/sse
# List all available tools
curl -X POST http://localhost:3000/api/sse \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"tools/list","id":1}'
# Test server info tool
curl -X POST http://localhost:3000/api/sse \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"server_info","arguments":{}},"id":1}'生产服务器测试:
# Test deployed server
curl -X POST https://ab-mcp.vercel.app/api/sse \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"tools/list","id":1}'📱 Swift代码审查测试
使用损坏的Swift代码进行测试:
# Test Swift code review tool
curl -X POST http://localhost:3000/api/sse \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"swift_code_review","arguments":{"code":"'"$(cat test_swift_broken.swift)"'"}},"id":1}'预期检测:
- 在没有安全检查的情况下强行拆开包装
- 在闭合中保持循环
- 后台线程的UI更新
- 命名规范不佳
- 幻数和硬编码值
- 违反SOLID原则
🤖 Kotlin代码审查测试
使用损坏的Kotlin代码进行测试:
# Test Kotlin code review tool
curl -X POST http://localhost:3000/api/sse \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"kotlin_code_review","arguments":{"code":"'"$(cat test_kotlin_broken.kt)"'"}},"id":1}'预期检测:
- 零安全违规
- GlobalScope协程使用不佳
- 内存泄漏和上下文引用
- 架构模式违规
- 线程和生命周期问题
🐍 Python集成测试
数据分析示例:
# Test Python execution with data science
curl -X POST http://localhost:3000/api/sse \
-H "Content-Type: application/json" \
-d '{
"jsonrpc":"2.0",
"method":"tools/call",
"params":{
"name":"python_exec",
"arguments":{
"code":"import pandas as pd; import numpy as np; data = pd.DataFrame({\"x\": np.random.randn(100), \"y\": np.random.randn(100)}); print(data.describe())",
"return_type":"text"
}
},
"id":1
}'可视化示例:
# Test matplotlib plotting
curl -X POST http://localhost:3000/api/sse \
-H "Content-Type: application/json" \
-d '{
"jsonrpc":"2.0",
"method":"tools/call",
"params":{
"name":"python_exec",
"arguments":{
"code":"import matplotlib.pyplot as plt; import numpy as np; x = np.linspace(0, 10, 100); y = np.sin(x); plt.plot(x, y); plt.title(\"Sine Wave\"); plt.savefig(\"plot.png\")",
"return_type":"image"
}
},
"id":1
}'🌐 Web刮擦测试
单URL抓取:
# Test web scraper
curl -X POST http://localhost:3000/api/sse \
-H "Content-Type: application/json" \
-d '{
"jsonrpc":"2.0",
"method":"tools/call",
"params":{
"name":"web_scraper",
"arguments":{
"url":"https://example.com",
"onlyMainContent":true
}
},
"id":1
}'SEO分析:
# Test URL analyzer
curl -X POST http://localhost:3000/api/sse \
-H "Content-Type: application/json" \
-d '{
"jsonrpc":"2.0",
"method":"tools/call",
"params":{
"name":"url_analyzer",
"arguments":{
"url":"https://example.com"
}
},
"id":1
}'批量报废:
# Test batch scraper
curl -X POST http://localhost:3000/api/sse \
-H "Content-Type: application/json" \
-d '{
"jsonrpc":"2.0",
"method":"tools/call",
"params":{
"name":"batch_scraper",
"arguments":{
"urls":["https://example.com", "https://httpbin.org/json"],
"onlyMainContent":true
}
},
"id":1
}'🔍 研究助理测试
Swift研究:
# Test Swift documentation research
curl -X POST http://localhost:3000/api/sse \
-H "Content-Type: application/json" \
-d '{
"jsonrpc":"2.0",
"method":"tools/call",
"params":{
"name":"research_assistant",
"arguments":{
"query":"Swift async await best practices",
"language":"swift"
}
},
"id":1
}'Kotlin研究:
# Test Kotlin documentation research
curl -X POST http://localhost:3000/api/sse \
-H "Content-Type: application/json" \
-d '{
"jsonrpc":"2.0",
"method":"tools/call",
"params":{
"name":"research_assistant",
"arguments":{
"query":"Kotlin coroutines lifecycle management",
"language":"kotlin"
}
},
"id":1
}'🤖 AI代理测试
交互式Web界面:
- 引导到
http://localhost:3000 - 使用聊天界面测试自然语言查询
- 尝试以下查询:
- *“检查此Swift代码是否存在问题”* - *“分析此Python数据并创建可视化”* - *“删除此网站并总结内容”*
MCP客户端测试:
- 通过Cursor、Claude Desktop或Windsurf使用代理
- 测试用户意图的自动检测
- 验证工具建议和执行情况
📊 样本测试文件
📱 test_swift_broken.swift
一个全面的Swift测试文件 故意问题 用于代码审查演示:
// Multiple issues for testing Swift code review
class UserManager {
var users: [User]! = nil // ❌ Force unwrapping
static let shared = UserManager() // ❌ Singleton without thread safety
func loadUsers() {
DispatchQueue.global().async {
// Data loading...
self.updateUI() // ❌ UI update on background thread
}
}
func saveUser(_ user: User) {
try! realm.write { // ❌ Force try
realm.add(user)
}
}
}检测到的问题:
- 记忆:强制展开,保持循环
- 线程:后台线程上的UI更新
- 错误处理:在没有适当错误管理的情况下强制尝试
- 建筑:违反单一责任原则
- 演出:算法和字符串操作效率低下
🤖 test_kotlin_broken.kt
一个全面的Kotlin测试文件 Android特有问题:
// Multiple issues for testing Kotlin code review
class UserRepository {
companion object {
var instance: UserRepository? = null // ❌ Not thread-safe singleton
}
fun getUsers(): List? {
return null!! // ❌ Null safety violation
}
fun saveUser(user: User) {
GlobalScope.launch { // ❌ Poor coroutine scope usage
Thread.sleep(1000) // ❌ Blocking call in coroutine
// Save logic
}
}
}检测到的问题:
- 零安全:危险的空处理模式
- 并发:GlobalScope使用,阻止协程中的调用
- 记忆:上下文泄漏、静态引用
- 建筑:MVVM模式违规,关注点分离不良
- 安卓:使用findViewById而不是ViewBinding
📁 项目架构
ab-mcp-server/ # 🏠 Project root
├── app/ # 🌐 Next.js application
│ ├── api/ # API routes
│ │ ├── [transport]/ # 🔧 MCP protocol handler
│ │ │ └── route.ts # Main MCP server implementation
│ │ ├── agent/ # 🤖 Client-side agent API
│ │ │ └── route.ts # Web interface agent endpoint
│ │ └── tools/ # 🛠️ MCP Tools implementation
│ │ ├── agent.ts # AI agent tool
│ │ ├── index.ts # Tool exports and type definitions
│ │ ├── kotlin.ts # Kotlin code review tool
│ │ ├── python.ts # Python execution tool
│ │ ├── server.ts # Server info tool
│ │ ├── swift.ts # Swift code review tool
│ │ └── web-scraping.ts # Web scraping and research tools
│ ├── components/ # 🎨 React components
│ │ └── AgentChat.tsx # Client-side chat interface
│ ├── globals.css # 🎨 Global styles
│ ├── layout.tsx # 📱 App layout
│ └── page.tsx # 🏠 Home page with agent interface
├── test_swift_broken.swift # 📱 Swift test file with issues
├── test_kotlin_broken.kt # 🤖 Kotlin test file with issues
├── SECURITY.md # 🔒 Security guidelines and best practices
├── next.config.js # ⚙️ Next.js configuration
├── package.json # 📦 Dependencies & scripts
├── tsconfig.json # 📝 TypeScript configuration
├── vercel.json # 🚀 Deployment configuration
└── README.md # 📖 Documentation🛠️ 工具架构
MCP Server Tools (9 total):
├── 🤖 agent # AI assistant with auto-detection
├── 📱 swift_code_review # Swift iOS code analysis
├── 🤖 kotlin_code_review # Kotlin Android code analysis
├── 🐍 python_exec # Python code execution
├── 🌐 web_scraper # Single URL scraping
├── 🌐 url_analyzer # URL SEO analysis
├── 🌐 batch_scraper # Multi-URL scraping
├── 🔍 research_assistant # Swift/Kotlin documentation research
└── ℹ️ server_info # Server status and information🔮 未来发展路线图
🎯 计划功能(尚未实施)
🧠 增强的人工智能能力
- 内存持久性:跨会话的对话上下文
- 多步骤工作流:具有依赖关系的复杂分析
- 海关代理:特定领域的专业知识模块
- 代码生成:AI驱动的代码脚手架和模板
📊 高级代码分析
- 静态分析集成:ESLint、SwiftLint、ktlint集成
- 性能分析:运行时分析和优化建议
- 安全扫描:漏洞检测和补救
- 相关性分析:包安全和更新建议
🌐 增强的Web功能
- 实时监控:网站更改检测和警报
- API测试:自动化API端点测试和验证
- 绩效审计:核心网络生命和可访问性评分
- 内容管理:自动内容提取和组织
🐍 Python高级功能
- Jupyter集成:笔记本风格的执行和可视化
- 机器学习:scikit-learn、TensorFlow、PyTorch集成
- 数据库连接:PostgreSQL、MongoDB、Redis连接
- 异步处理:后台任务执行和排队
📱 移动开发
- React Native:跨平台代码审查和分析
- 颤振/飞镖:Dart代码审查和优化建议
- CI/CD集成:GitHub Actions、Bitrise、Fastlane自动化
- 应用商店优化ASO分析和建议
🔧 开发者体验
- IDE扩展:VS Code、Xcode、Android Studio插件
- CLI接口:用于本地开发的命令行工具
- 自定义模板:项目脚手架和样板生成
- 文档:自动生成的API文档和代码文档
🚀 贡献
这个项目是 开放供捐款!优先领域:
- 增强型AI代理:内存持久性,多步骤工作流
- 移动开发:React Native,Flutter集成
- 演出:缓存、优化、并发处理
- 安全:增强的代码扫描、漏洞检测
- 文档:综合指南、视频教程
如何做出贡献:
- 分叉存储库
- 创建要素分支
- 添加新功能的测试
- 提交带有详细描述的拉取请求
______________________________________________________________________
内置于❤️ 使用TypeScript、Next.js、OpenAI、Python和模型上下文协议。
🚀 已准备好进行生产部署和持续增强!
