Ios Mcp Code Quality Server

by a-25

261 downloads Not rated yet
GitHub

About

# iOS MCP Code Quality Server A versatile iOS code quality analysis tool that operates in two modes: 1. **CLI Tool**: Direct command-line interface for iOS testing and linting 2. **MCP Server**: Model Context Protocol server for AI assistant integration This tool provides comprehensive iOS code quality analysis and…

Explore

- 🧪 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

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Ios Mcp Code Quality Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

- 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

Use instantly without installation:


For frequent use across multiple projects, you can install globally:

bash
npm install -g ios-mcp-code-quality-server

Use npx to run the CLI directly without installation:

npx ios-mcp-code-quality-server --help              # Show all available commands
npx ios-mcp-code-quality-server <command> --help    # Show help for specific command

npx ios-mcp-code-quality-server test --xcworkspace MyApp.xcworkspace --scheme MyAppTests

npx ios-mcp-code-quality-server lint --changed-files ".swift" --config-path .swiftlint.yml

git diff --name-only | grep "\.swift$" | xargs -I {} npx ios-mcp-code-quality-server lint --changed-files {}

1. Clone the repository:

   git clone https://github.com/a-25/ios-mcp-code-quality-server.git
cd ios-mcp-code-quality-server

2. Install dependencies:

   npm install

3. Build the project:

   npm run build

4. Start the server:

   npm start

PORT=3000
NODE_ENV=development
LOG_LEVEL=info

Direct Testing:

bash

npx ios-mcp-code-quality-server lint --changed-files ".swift" --config-path .swiftlint.yml

Running Tests with AI Assistant:

"Can you run the tests for the LoginFeature scheme and tell me what failed?"
"Run only the LoginTests for the MyApp scheme"
"List all available tests in my project and then run the failing ones"

The AI assistant will use the enhanced test tools to:
1. Discover available tests using the list-tests tool
2. Execute specific tests or all tests for the specified scheme
3. Validate test names and provide suggestions for typos
4. Parse build and test results with detailed failure analysis
5. Provide structured summaries of failures with file locations and line numbers

Code Quality Analysis:

"Please analyze the code quality of my iOS project using SwiftLint"

```bash

xcodeproj

(optional): Path to Xcode project file

xcworkspace

(optional): Path to Xcode workspace file

scheme

(required): Xcode scheme to test

destination

(optional): Test destination (simulator/device)

tests

(optional): Array of specific test names to run

target

(optional): Target parameter for test execution context

Executes iOS tests and provides detailed failure analysis with support for running specific tests.

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 (required): Xcode scheme to test
- destination (optional): Test destination (simulator/device)
- Default value: generic/platform=iOS Simulator
- tests (optional): Array of specific test names to run
- Format: ['MyTarget/TestClass/testMethod', 'MyTarget/TestClass']
- Examples: ['MyAppTests/LoginTests/testValidLogin', 'MyAppUITests/HomeScreenTests']
- target (optional): Target parameter for test execution context
- Can be used to specify different test environments or configurations

Example Responses:

Success Case (all tests passed):

{
"content": [
{
"type": "text",
"text": "✅ All tests passed."
}
]
}

Build Errors Case (compilation issues):

{
"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."
}
]
}

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)

Performs lint analysis on your iOS project. Currently supported linters: SwiftLint

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "ios mcp code quality server": {
            "ios-mcp-code-quality-server": {
                "command": "npx",
                "args": [
                    "-y",
                    "[email protected]",
                    "server"
                ],
                "type": "stdio"
            }
        }
    }
}

McpServers

{
    "ios-mcp-code-quality-server": {
        "command": "npx",
        "args": [
            "-y",
            "[email protected]",
            "server"
        ],
        "type": "stdio"
    }
}

A versatile iOS code quality analysis tool that operates in two modes:
1. CLI Tool: Direct command-line interface for iOS testing and linting
2. 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.

License
Tests
Node Version

Quick Start

CLI Mode (Direct Usage with npx - Recommended)

Use instantly without installation:

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.