Seiro MCP server and visionOS tools
This repository ships the visionOS build MCP server. Follow these steps to finish cargo check → cargo test --all → cargo fmt -- --check → cargo build --release within ~30 minutes on a fresh machine and call the visionOS tools (inspect_xcode_schemes / validate_sandbox_policy / inspect_build_diagnostics / build_visionos_app / fetch_build_output) from an MCP client.
rustup override set 1.91.1)cargo, git, bash/zshIf DevToolsSecurity is disabled, enable it first:
$ DevToolsSecurity -status
Developer mode is currently disabled.
$ sudo DevToolsSecurity -enable
cargo install seiro-mcp --locked
--locked is recommended for reproducibility, but not mandatory for all environments.
config.toml(see docs/config.md for details)
config.example.toml as a starting point.
[server]
host = "127.0.0.1"
port = 8787
[auth]
token = "change-me-please"
[visionos]
allowed_paths = []
allowed_schemes = []
default_project_path = "/absolute/path/to/YourApp.xcodeproj"
default_destination = "platform=visionOS Simulator,name=Apple Vision Pro"
required_sdks = ["visionOS", "visionOS Simulator"]
xcode_path = "/Applications/Xcode.app/Contents/Developer"
xcodebuild_path = "/usr/bin/xcodebuild"
max_build_minutes = 20
artifact_ttl_secs = 600
cleanup_schedule_secs = 60
token to 16+ characters.MCP_CONFIG_PATH=/path/to/config.toml.[visionos], list at least one absolute path in allowed_paths and control build timeout / artifact TTL.allowed_schemes must list Xcode schemes allowed to build; anything else returns scheme_not_allowed.MCP_CONFIG_PATHMCP_CONFIG_PATH to the launch environment:
MCP_CONFIG_PATH=/absolute/path/to/config.toml seiro-mcp --help
env.MCP_CONFIG_PATH as well.src/server/config/mod.rs::tests::load_config_from_env_override.seiro-mcp skill install seiro-mcp-visionos-build-operator --dry-run
seiro-mcp skill install seiro-mcp-visionos-build-operator
seiro-mcp skill remove seiro-mcp-visionos-build-operator to remove it.skill remove returns not_found and exits successfully.seiro-mcp --version to confirm the installed binary before skill operations.seiro-mcp- prefix.seiro-mcp-visionos-build-operator.If you are contributing to this repository, run:
cargo fetch
cargo check
cargo test --all -- --nocapture
cargo fmt -- --check
cargo clippy -- -D warnings
cargo build --release
Additional repository checks:
cargo run -p xtask -- langscan
cargo run -p xtask -- docs-langscan
cargo run -p xtask -- check-docs-links
cargo publish)cargo package --list
cargo publish --dry-run
Use this sequence only when preparing a crates.io release.
If any step fails, fix and rerun.
Add an entry like the following to Codex CLI config (~/.codex/config.toml) to call the visionOS tools:
[mcp_servers.seiro_mcp]
command = "/Users/<your-username>/.cargo/bin/seiro-mcp"
args = ["--transport=stdio"]
env.MCP_CONFIG_PATH = "/absolute/path/to/config.toml"
env.MCP_SHARED_TOKEN = "change-me-please"
working_directory = "/absolute/path/to/working-directory"
${HOME}, so use absolute paths and replace <your-username>.which seiro-mcp and use the absolute path from your environment.env.MCP_CONFIG_PATH; ensure env.MCP_SHARED_TOKEN matches [auth].token.mcp list shows the visionOS tools.cargo run directly without a client will fail immediately.MCP_SHARED_TOKEN=<shared-token> MCP_CONFIG_PATH=$PWD/config.toml \
npx @modelcontextprotocol/inspector seiro-mcp --transport=stdio
cargo run --quiet -- --transport=stdio remains available.mcp call validate_sandbox_policy '{
"project_path": "/Users/<user>/codex/workspaces/vision-app",
"required_sdks": ["visionOS", "visionOS Simulator"],
"xcode_path": "/Applications/Xcode.app/Contents/Developer"
}'
status: "ok", proceed to build_visionos_app.status: "error" or an MCP error, fix based on the code:
path_not_allowed: add the project parent directory to visionos.allowed_paths.sdk_missing: inspect details.diagnostics first (probe_mode, effective_required_sdks, detected_sdks_*), then install visionOS SDK from Xcode > Settings > Platforms.devtools_security_disabled: run DevToolsSecurity -enable.xcode_unlicensed: run sudo xcodebuild -license.disk_insufficient: ensure 20GB+ free space for the build.Optional read-only SDK inspection:
mcp call inspect_xcode_sdks '{
"required_sdks": ["visionOS", "visionOS Simulator"],
"xcode_path": "/Applications/Xcode.app/Contents/Developer"
}'
validate_sandbox_policy diagnostics -> inspect_xcode_sdks -> retry validate/build.Optional scheme preflight:
mcp call inspect_xcode_schemes '{
"project_path": "/Users/<user>/codex/workspaces/VisionApp/VisionApp.xcodeproj",
"xcode_path": "/Applications/Xcode.app/Contents/Developer"
}'
project_path or scheme is not known before build.project_path is omitted, resolution order is:
.xcodeproj discovered in current working directoryvisionos.default_project_path from config.tomlbuild_visionos_appmcp call build_visionos_app '{
"project_path": "/Users/<user>/codex/workspaces/VisionApp/VisionApp.xcodeproj",
"scheme": "VisionApp",
"destination": "platform=visionOS Simulator,name=Apple Vision Pro",
"configuration": "debug",
"extra_args": ["-quiet"],
"env_overrides": {"MOCK_XCODEBUILD_BEHAVIOR": "success"}
}'
project_path / workspace must be absolute paths within visionos.allowed_paths.scheme must be listed in visionos.allowed_schemes.configuration should use lowercase canonical values: debug or release. For compatibility, Debug / Release are also accepted.extra_args: -quiet, -UseModernBuildSystem=YES, -skipPackagePluginValidation, -allowProvisioningUpdates.MOCK_XCODEBUILD_BEHAVIOR switches the test fixture (tests/fixtures/visionos/mock-xcodebuild.sh) among success / fail / timeout.job_id, artifact_path, artifact_sha256, log_excerpt, duration_ms; on failure, returns errors such as build_failed or timeout.build_visionos_app returns destination_ambiguous with matched_devices, available_destinations, and a retry-ready suggested_destination.If build fails and returns job_id, inspect diagnostics without running shell commands manually:
mcp call inspect_build_diagnostics '{
"job_id": "<UUID returned in build error context>",
"include_log_excerpt": true,
"prefer_typecheck": true
}'
availability: "available" includes primary_location (file, line, column) from typecheck diagnostics.availability: "unavailable" falls back to xcodebuild_log summary with notes.fetch_build_outputmcp call fetch_build_output '{
"job_id": "<UUID returned by build_visionos_app>",
"include_logs": true
}'
artifact_zip points to target/visionos-builds/<job_id>/artifact.zip; copy it before download_ttl_seconds expires.include_logs: false to omit log_excerpt and reduce noise on the client side.You can run the same build flow with the bundled skill:
skills/seiro-mcp-visionos-build-operator/SKILL.mdxcodebuild / swiftcWhen to choose which mode:
Prompt examples:
Use seiro-mcp-visionos-build-operator for this task.Run this via the seiro-mcp-visionos-build-operator skill.Use Seiro MCP for this Xcode project instead of direct xcodebuild.The skill still executes the same MCP tools in order:
inspect_xcode_schemes (when project or scheme discovery is needed)validate_sandbox_policybuild_visionos_appinspect_build_diagnostics (on failure)fetch_build_output (on success)Optional preflight with skill:
project_path or scheme is missing, call inspect_xcode_schemes first to resolve target project and scheme candidates..xcodeproj / .xcworkspace as directory packages. File-only searches can miss them.Contracts and payload schemas stay unchanged.
--transport {stdio|tcp} (default stdio).--token wins over MCP_SHARED_TOKEN; if neither is set, startup fails with MCP_TOKEN_REQUIRED (exit 43).[auth].token yields AUTH_TOKEN_MISMATCH (exit 42); TTY stdin/stdout yields MCP_CLIENT_REQUIRED (exit 44).docs/runbook.md for detailed procedures and troubleshooting.| Symptom | Resolution |
|---|---|
CONFIG_MISSING_FIELD auth |
[auth].token is missing. Set a 16+ character value. |
path_not_allowed |
Add the project’s parent directory to visionos.allowed_paths, then restart the server. |
sdk_missing |
Check details.diagnostics, run inspect_xcode_sdks, then install/fix SDK settings and retry. |
scheme_not_allowed |
Add the scheme to visionos.allowed_schemes and restart the server. |
timeout |
Increase max_build_minutes or reduce project size/clean build. |
artifact_expired |
Call fetch_build_output sooner or raise artifact_ttl_secs. |
RUST_LOG=debug enables verbose tracing.rmcp_sample::visionos target and record job_id, status, and elapsed_ms (see docs/telemetry.md).