Swift Test icon

Swift Test

Executes `swift test` commands within Swift package directories, providing programmatic control over testing processes.

About

This server acts as an MCP (Model Context Protocol) endpoint, exposing a specialized `swift-test` tool designed to run `swift test` commands against Swift package directories. It's particularly useful for MCP clients, such as editors or AI agents, that need to trigger tests programmatically over standard I/O without granting a full interactive shell. The tool handles directory validation, accepts custom arguments for `swift test`, and streams back combined stdout/stderr along with execution metadata like exit code, duration, and the full command executed, reporting non-zero exits as MCP tool errors for structured client handling.

Key Features

  • Exposes a dedicated `swift-test` tool for running Swift tests
  • Runs `swift test` in specified Swift package directories
  • Streams combined stdout/stderr output for comprehensive logging
  • Provides execution metadata including exit code, duration, and command
  • Validates package directory existence and `Package.swift` prior to execution
  • 0 GitHub stars

Use Cases

  • Running Swift tests programmatically from an MCP-aware client or editor
  • Integrating Swift testing into AI agent workflows for automated code analysis or remediation
  • Automating Swift test execution within CI/CD pipelines through stdio communication
Craft Better Prompts with AnyPrompt
Sponsored