A Build Server Protocol server that connects sourcekit-lsp to native Xcode projects (.xcodeproj / .xcworkspace). It uses swift-build, the same build engine as Xcode, so Swift code intelligence works in Cursor, VS Code, and other LSP editors.
The server reloads when project metadata changes, such as project.pbxproj or Package.resolved.
Important
For native Xcode projects only. For Bazel, use sourcekit-bazel-bsp.
Note
Early-stage. APIs and setup may change.
- macOS 15+
- Xcode 26+, selected with
xcode-select(orDEVELOPER_DIR). You still need Xcode installed for SDKs and toolchains. - Swift 6.2+ to build from source
Homebrew:
brew tap slime-studio/tap
brew install sourcekit-xcode-bspFrom source:
git clone https://github.com/slime-studio/sourcekit-xcode-bsp.git
cd sourcekit-xcode-bsp
swift build -c release
cp .build/release/sourcekit-xcode-bsp .build/release/SWBBuildServiceBundle /usr/local/bin/SWBBuildServiceBundle must stay next to the sourcekit-xcode-bsp binary.
From your Xcode project root:
sourcekit-xcode-bsp initThis writes buildServer.json in the current directory. It detects a .xcworkspace or .xcodeproj, defaults the platform to iphonesimulator, and sets argv to the binary you just ran.
Then in Cursor or VS Code:
- Install the Swift extension.
- Open the folder that contains
buildServer.json. - Run Swift: Restart LSP Server from the command palette (
Cmd+Shift+P), or reload the window.
sourcekit-lsp reads buildServer.json and launches this server over stdio. Bare sourcekit-xcode-bsp and sourcekit-xcode-bsp serve both run the server.
buildServer.json lives at the workspace root. Minimal example:
{
"argv": ["/usr/local/bin/sourcekit-xcode-bsp"],
"bspVersion": "2.1.0",
"languages": ["swift"],
"name": "sourcekit-xcode-bsp",
"version": "0.1.0",
"workspace": "MyApp.xcodeproj"
}| Field | Required | Description |
|---|---|---|
workspace |
Yes | Path to .xcodeproj or .xcworkspace, relative to this file or absolute |
buildRoot |
No | Build artifacts directory. Defaults to .build/derived-data |
platform |
No | Run destination, such as iphonesimulator, iphoneos, or macosx. init defaults to iphonesimulator. If omitted, swift-build chooses one |
serviceBundlePath |
No | Path to SWBBuildServiceBundle. Defaults to the copy next to the binary |
synchronousBuildDescriptionSerialization |
No | Write the build description before notifying SourceKit-LSP, so the first diagnostics are not empty. Defaults to true |
swift build
swift test
swiftlint lintOptional hook: brew install pre-commit swiftlint && pre-commit install. Commits then lint staged Swift files.
In Cursor or VS Code, open Output and choose SourceKit Language Server. After you open a Swift file you should see the BSP start. Server logs go to stderr with a prefix like [sourcekit-xcode-bsp:bootstrap].
buildServer.jsonnot found: put the file in the folder your editor opened as the workspace root.- Workspace not found:
workspacemust point at a real.xcodeprojor.xcworkspace. - Xcode not found: run
xcode-select -pand confirm Xcode 26+ is selected. Override withDEVELOPER_DIRif needed.
- sourcekit-lsp: Swift language server that consumes this BSP
- sourcekit-bazel-bsp: same idea for Bazel
- xcode-build-server: alternative BSP that parses
xcodebuildlogs
Apache License 2.0. See LICENSE.