Edge Studio is a set of tools and an application that allows you to create a local Ditto Database based on a database registered in the Ditto Portal and use the Ditto SDK to query information in the Ditto Edge Server, local Edge Server, or P2P with other devices sharing the same DatabaseId.
Key Features:
- Multi-app connection management with local storage
- Real-time query execution with history and favorites
- Active subscriptions and observables management
- Connection status bar with transport-level statistics
- Presence viewer and peer management
- Disk usage monitoring and permissions health checking
- Import/export functionality
- You need a Ditto Portal account. You can sign up for a free account at Ditto Portal.
- A Mac with MacOS 26.0 or higher installed
- An iPad with OS 26.0 or higher installed
- Xcode 26.2 or higher installed
- SwiftLint Installed
- Swiftformat Installed
- Periphery Installed
This project uses Ditto SDK 5.0 (currently 5.0.0-preview.5).
API Reference: https://software.ditto.live/cocoa/DittoSwift/5.0.0-preview.5/api-reference/documentation/dittoswift/
Note: The SwiftUI app is only officially supports MacOS and iPadOS. While it will build and run on iOS, it has not been tested on iOS and there are known issues with the SwiftUI app on iOS.
Edge Studio uses industry-standard code quality tools to maintain code health and detect unused code. These tools help catch issues early and keep the codebase clean.
# Install all tools
brew install swiftlint swiftformat peripheryapp/periphery/periphery
# Run quick quality check
swiftlint lint
swiftformat .| Tool | Purpose | Integration | Documentation |
|---|---|---|---|
| SwiftFormat | Auto-formatting | Xcode build phase | Guide |
| SwiftLint | Style & quality rules | Xcode build phase | Guide |
| Periphery | Unused code detection | Manual (weekly) | Guide |
Both SwiftFormat and SwiftLint are integrated into the build process:
- SwiftFormat runs first - automatically formats code
- SwiftLint runs second - shows violations as warnings in Xcode
To add both tools to your build:
- Open project in Xcode
- Target β Build Phases β "+" β New Run Script Phase (add 2 phases)
- First: "SwiftFormat" phase (formats code)
- Second: "SwiftLint" phase (checks code)
- Add scripts (see CODE_QUALITY_GUIDE.md)
All tools are configured via dotfiles in the project root:
.periphery.yml- Periphery configuration.swiftlint.yml- SwiftLint rules and exclusions.swiftformat- SwiftFormat style rules
# SwiftLint
swiftlint lint # Check violations
swiftlint lint --fix # Auto-fix where possible
# SwiftFormat
swiftformat . # Format all files
swiftformat --lint . # Check formatting only
# Periphery
periphery scan --project "SwiftUI/Edge Debug Helper.xcodeproj" \
--schemes "Edge Studio"- Every build - SwiftFormat and SwiftLint run automatically (Xcode integration)
- Weekly - Run Periphery to find unused code
- Before releases - Run all tools with
--strictflags
With build integration, you don't need to remember to format or lint - it happens automatically!
π See docs/CODE_QUALITY_GUIDE.md for:
- Detailed installation and configuration
- Xcode build phase setup
- Per-file rule overrides
- CI/CD integration examples
- Troubleshooting guide
- Best practices
Edge Debug Helper uses CocoaLumberjack for file-based logging with user-viewable logs.
Add CocoaLumberjack via Swift Package Manager in Xcode:
- File β Add Package Dependencies...
- URL:
https://github.com/CocoaLumberjack/CocoaLumberjack - Version: Latest (3.8.5+)
// Use the global Log accessor (import not needed)
Log.debug("Debug information")
Log.info("General information")
Log.warning("Non-critical issue")
Log.error("Failure or exception")
// DO NOT use print() - use Log instead- β File-based: All logs written to files automatically
- β Rotation: Keeps last 7 days, 5MB max per file
- β User export: Future feature for GitHub issue attachments
- β Performance: Asynchronous, doesn't block UI
- β
Location:
~/Library/Logs/io.ditto.EdgeStudio/
// Get all log files
let logFiles = Log.getAllLogFiles()
// Get combined content
let content = Log.getCombinedLogs()
// Export to location
try Log.exportLogs(to: url)Edge Debug Helper uses Swift Testing for comprehensive test coverage with mandatory testing requirements for all new code.
# Run all tests
xcodebuild test -project "SwiftUI/Edge Debug Helper.xcodeproj" \
-scheme "Edge Studio" \
-destination "platform=macOS,arch=arm64"
# Run with coverage report
./scripts/generate_coverage_report.sh
# View coverage dashboard
./scripts/coverage_dashboard.sh| Target | Framework | Purpose | Coverage Goal |
|---|---|---|---|
| EdgeStudioUnitTests | Swift Testing | Fast, isolated unit tests | 70% |
| EdgeStudioIntegrationTests | Swift Testing | Multi-component tests | 50% |
| EdgeStudioUITests | XCTest | UI automation | 30% |
CRITICAL: All new code MUST have tests.
- β
Unit tests with Swift Testing (
import Testing) - β 80%+ coverage on new code (minimum 50% overall)
- β AAA pattern (Arrange-Act-Assert)
- β Test isolation (uses separate database paths)
- β No skipped tests
- β No tests that touch production data
- Overall Coverage: 15.96% (target: 50%)
- SQLCipherService: 62.19% coverage β
- Total Tests: 15+ unit tests, growing weekly
Pre-push hook automatically enforces 50% minimum coverage:
# Enable pre-push hook
chmod +x .git/hooks/pre-push
# Now runs automatically before every push
git push origin main
# Bypass once (emergency only)
git push --no-verifyπ See docs/TESTING.md for:
- Complete testing guide (unit, integration, UI tests)
- Swift Testing framework tutorial
- Test isolation and sandboxing
- AAA pattern examples
- Coverage best practices
- Troubleshooting guide
Edge Studio embeds an MCP (Model Context Protocol) server that lets Claude Code query and manage your Ditto databases directly β no separate setup, no CLI binary. When Edge Studio is running with MCP enabled, Claude Code connects automatically.
- Open Edge Studio
- Go to Edge Studio β Settingsβ¦ (β,)
- Toggle Enable MCP Server ON
- A green dot confirms it's running on port 65269
Option A β This repo (auto-discovered)
The .mcp.json at the root of this repo is picked up automatically by Claude Code when you work in this project. No extra steps.
Option B β Global (available in all projects)
claude mcp add ditto-edge-studio --transport sse http://localhost:65269/mcpVerify it's connected:
claude mcp list
# ditto-edge-studio (sse) http://localhost:65269/mcpOnce connected and with a database selected in Edge Studio:
- "List the collections in my active database and their document counts"
- "Run
SELECT * FROM orders WHERE status = 'pending' LIMIT 5" - "Run
SELECT * FROM orders LIMIT 5via the HTTP API" - "Create an index on the users collection for the email field"
- "Show me the sync status and which transports are active"
- "Disable Bluetooth sync and show me the peer count"
- "Show me all connected peers and their SDK versions"
- "Stop sync, insert all documents from ~/Downloads/orders.json into the orders collection, then restart sync"
| Tool | Description |
|---|---|
execute_dql |
Run any DQL query (SELECT, INSERT, UPDATE, EVICT); pass transport: "http" to route through the HTTP API instead of the local store |
list_databases |
List all configured databases |
get_active_database |
Details on the currently selected database |
list_collections |
Collections with document counts and indexes |
list_indexes |
Flat list of every index across all collections, with name, collection, and field paths |
create_index |
Index a collection field |
drop_index |
Remove an index by name |
get_query_metrics |
Recent query timing and EXPLAIN output (requires Metrics enabled in Settings) |
get_sync_status |
Connected peer count and transport config |
configure_transport |
Toggle Bluetooth, LAN, AWDL, or Cloud Sync |
insert_documents_from_file |
Insert a local JSON file (array of objects with _id) into a collection; file must be in ~/Downloads |
set_sync |
Start or stop sync for the active database |
get_peers |
Snapshot of all connected peers with device, OS, SDK version, and transport details |
Note: All tools operate on the database currently selected in the Edge Studio UI. The MCP server stops automatically when Edge Studio quits.
For the full setup guide, troubleshooting, and security considerations see docs/MCP_SERVER.md.
THIS SOFTWARE IS PROVIDED "AS-IS" WITHOUT WARRANTY OF ANY KIND.
This tool is NOT officially supported by Ditto or the author. It is provided as a community resource for development and debugging purposes only.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
By using this software, you acknowledge and agree that:
- There is no official support from Ditto or the author
- The software may contain bugs or incomplete features
- You use this software at your own risk
- No warranty of any kind is provided
- The authors are not liable for any damages resulting from use of this software
For official Ditto support and documentation, please visit Ditto Documentation.