A versatile iOS code quality analysis tool that operates in two modes:
CLI Tool: Direct command-line interface for iOS testing and linting
MCP Server: Model Context Protocol server for AI assistant integration
This tool provides comprehensive iOS code quality analysis and test automation capabilities, enabling both direct developer usage and AI assistant integration for Xcode tests, linter analysis, and detailed feedback on iOS projects through structured, actionable reports.
This server enables AI assistants to run Xcode tests, perform linter analysis, and provide detailed feedback on iOS projects through structured, actionable reports.
ดาว
11
เครื่องมือ
—
อัปไทม์
—
Quick Start
CLI Mode (Direct Usage with npx - Recommended)
Use instantly without installation:
# Run iOS tests
npx ios-mcp-code-quality-server test --xcworkspace MyApp.xcworkspace --scheme MyAppTests
# Run SwiftLint analysis
npx ios-mcp-code-quality-server lint --changed-files "ViewController.swift,Model.swift"
# Show help
npx ios-mcp-code-quality-server --help
Alternative: Install Globally (Optional)
For frequent use across multiple projects, you can install globally:
npm install -g ios-mcp-code-quality-server
# Then use the full name (following MCP conventions)
ios-mcp-code-quality-server test --xcworkspace MyApp.xcworkspace --scheme MyAppTests
ios-mcp-code-quality-server lint --changed-files "ViewController.swift,Model.swift"
💡 Tip: Using npx is recommended as it ensures you always use the latest version without global installs.
MCP Server Mode (AI Assistant Integration)
# Start as MCP server (no arguments)
npx ios-mcp-code-quality-server
# Or explicitly start server mode
npx ios-mcp-code-quality-server server
The server will start on http://localhost:3000 and be ready to receive MCP requests.
Features
🧪 iOS Test Execution: Run Xcode tests with detailed failure analysis
📱 Multiple Schemes Support: Test different iOS project configurations
🔍 SwiftLint Integration: Automated Swift code style and quality checking
📊 Structured Reporting: Clear, actionable feedback with file locations and line numbers
🛠 Build Error Detection: Intelligent parsing of Xcode build failures
🔒 Local Processing: All analysis happens on your machine for security
⚡ Dual Mode Operation: Use as CLI tool or MCP server
💻 Command Line Interface: Direct terminal usage for developers
🤖 AI Assistant Ready: MCP protocol support for seamless AI integration
Architecture
This tool operates in two distinct modes with intelligent detection:
CLI Mode
Activation: When command-line arguments are provided
Usage: Direct developer interaction via terminal commands or npx
Output: Human-readable or JSON format for scripting
Benefits: Fast execution, scriptable, CI/CD friendly, no installation required with npx
MCP Server Mode
Activation: When no arguments are provided (default)
Usage: AI assistant integration via Model Context Protocol
Output: Structured MCP responses for AI consumption
--changed-files <files>: Comma-separated list of files to lint (required)
--config-path <path>: Path to SwiftLint configuration file
--json: Output results in JSON format
--verbose: Enable verbose logging
Server Command
Start MCP server mode explicitly:
# Start server on default port (3000)
npx ios-mcp-code-quality-server server
# Start server on custom port
npx ios-mcp-code-quality-server server --port 8080
# Server with custom settings
PORT=3001 LOG_LEVEL=debug npx ios-mcp-code-quality-server server
CLI Examples
# Complete iOS project test workflow
npx ios-mcp-code-quality-server test --xcworkspace MyApp.xcworkspace --scheme MyAppTests --verbose
# Quick SwiftLint check on modified files
git diff --name-only | grep "\.swift$" | xargs -I {} npx ios-mcp-code-quality-server lint --changed-files {}
# CI/CD integration with JSON output
npx ios-mcp-code-quality-server test --xcworkspace MyApp.xcworkspace --scheme MyAppTests --json > test-results.json
# Check specific Swift files before commit
npx ios-mcp-code-quality-server lint --changed-files "LoginViewController.swift,UserModel.swift" --config-path .swiftlint.yml
MCP Server Installation
Prerequisites
Node.js 18+: Required for running the MCP server
Xcode: For iOS project building and testing
iOS Simulator: For running tests (or physical iOS device)
SwiftLint (optional): For code quality analysis
Setup Steps
Clone the repository:
git clone https://github.com/a-25/ios-mcp-code-quality-server.git
cd ios-mcp-code-quality-server
Install dependencies:
npm install
Build the project:
npm run build
Start the server:
npm start
# or explicitly
node dist/index.js server
AI Assistant Integration
Configure your AI assistant (Claude, Copilot, etc.) to use this MCP server:
{
"content": [
{
"type": "text",
"text": "❌ Build failed. Please provide the code for the failing test and the class/function under test for better AI suggestions."
}
]
}
Test Errors Case (tests built but failed):
{
"content": [
{
"type": "text",
"text": "❌ Test failed. Please provide the code for the failing test and the class/function under test for better AI suggestions."
}
]
}
List Tests Tool
Discovers and lists all available tests in the iOS project.
Parameters:
xcodeproj (optional): Path to Xcode project file
xcworkspace (optional): Path to Xcode workspace file
Note: Either xcodeproj or xcworkspace parameter is mandatory (at least one must be provided)
scheme (optional): Xcode scheme to analyze
destination (optional): Test destination (simulator/device)
Lint Tool
Performs lint analysis on your iOS project. Currently supported linters: SwiftLint
Usage Examples
CLI Usage Examples
Direct Testing:
# Run all tests in a scheme
npx ios-mcp-code-quality-server test --xcworkspace MyApp.xcworkspace --scheme MyAppTests
# Run tests with specific simulator
npx ios-mcp-code-quality-server test --xcworkspace MyApp.xcworkspace --scheme MyAppTests \
--destination "platform=iOS Simulator,name=iPhone 15 Pro"
# Get machine-readable output for CI/CD
npx ios-mcp-code-quality-server test --xcworkspace MyApp.xcworkspace --scheme MyAppTests --json
Documentation: This README and inline code documentation
Made with ❤️ for the iOS development community
I
Ios MCP Code Quality Server
a-25·11 ดาว·
This server enables AI assistants to run Xcode tests, perform linter analysis, and provide detailed feedback on iOS projects through structured, actionable reports.
คัดลอกคอนฟิก stdio สำหรับ Cursor, Claude Desktop, Claude Code หรือ VS Code ได้ในหน้านี้ คอนฟิกนี้ใช้การติดตั้งของผู้เผยแพร่ ไม่ใช่พร็อกซีของ PlugMCP
Ios MCP Code Quality Server ต้องใช้ API key ไหม?
ระเบียนนี้ไม่ได้ระบุตัวแปรสภาพแวดล้อมที่จำเป็น
Ios MCP Code Quality Server ใช้ทรานสปอร์ตแบบใด?
Ios MCP Code Quality Server ทำงานแบบโลคัลผ่าน stdio
Ios MCP Code Quality Server ถูกตรวจสอบล่าสุดเมื่อใด?
ตรวจสอบล่าสุดเมื่อ 2026-10-26 This server enables AI assistants to run Xcode tests, perform linter analysis, and provide detailed feedback on iOS projects through structured, actionable reports.