sailfishos-mcp
Enables C++ backend development for SailfishOS applications, including generating C++ code files and integrating C++ components with QML interfaces.
Supports CMake project configuration and building for SailfishOS applications, including generating CMakeLists.txt files and managing CMake-based build processes.
Integrates with Git for version control of SailfishOS projects, including cloning repositories and managing project source code.
Connects to GitHub repositories for SailfishOS project templates and code snippets, including accessing the sailfishos-mcp server repository.
Utilizes npm for package management and build processes of the SailfishOS MCP server and related development tools.
Provides comprehensive SailfishOS application development capabilities including project scaffolding, building, deployment, code generation, and access to development guidelines and best practices.
Supports TypeScript development for the MCP server implementation and SailfishOS development tooling.
SailfishOS MCP for OpenCode
An MCP (Model Context Protocol) server that supercharges OpenCode with SailfishOS application development capabilities.
Features
Tool | What it does |
| Scaffold a complete SailfishOS project (CMake, RPM spec, QML, icons, translations) |
| Build the project with |
| Clean the build directory |
| Deploy the RPM to a connected device or emulator |
| Return curated guidelines for any SailfishOS topic |
| List common mistakes for a development area |
| Generate ready-to-use code snippets for common patterns |
| Add a new page, cover, service, D-Bus interface, or C++ backend |
| Add Chum metadata into the RPM spec of an existing project |
Prerequisites
Sailfish SDK with
sfdkin your PATH (required for build/deploy tools)
Installation
git clone https://github.com/ilpianista/sailfishos-mcp
cd sailfishos-mcp
npm install
npm run buildConfiguring OpenCode
Add this server to your OpenCode configuration file (~/.config/opencode/config.json or the project-local .opencode/config.json):
{
"mcp": {
"sailfishos": {
"type": "local",
"command": [
"node",
"/absolute/path/to/sailfishos-mcp/dist/index.js"
],
"enabled": true
}
}
}Restart OpenCode — the SailfishOS tools will be available immediately.
Usage Examples
1. Bootstrap a new app
"Create a new SailfishOS app called my-notes in ~/Projects. It's a simple note-taking app."
OpenCode will call sailfish_create_project and produce:
~/Projects/harbour-my-notes/
├── CMakeLists.txt
├── rpm/
│ ├── harbour-my-notes.changes.in
│ ├── harbour-my-notes.changes.run.in
│ └── harbour-my-notes.spec
├── src/
│ └── main.cpp
├── qml/
│ ├── harbour-my-notes.qml
│ ├── pages/
│ │ ├── FirstPage.qml
│ │ └── SecondPage.qml
│ └── cover/
│ └── CoverPage.qml
├── icons/ (86, 108, 128, 172 px stubs)
└── translations/harbour-my-notes.ts
└── harbour-my-notes.desktop2. Build the project
"Build my SailfishOS project at ~/Projects/harbour-my-notes for armv7hl"
Runs:
sfdk config target SailfishOS-4.5.0.18-armv7hl
sfdk cmake -B build -S .
sfdk cmake --build build
sfdk rpm3. Add a feature
"Add a detail page called NoteDetailPage to my project"
Creates qml/pages/NoteDetailPage.qml with correct Silica boilerplate and explains how to navigate to it.
4. Get guidelines
"What are the Harbour submission requirements for icons?"
Calls sailfish_guidelines({ topic: "harbour-validation" }).
5. Avoid pitfalls
"What are common QML mistakes on SailfishOS?"
Calls sailfish_pitfalls({ area: "qml" }) and returns an annotated list of anti-patterns.
6. Snippets on demand
"Show me how to do a pull-down menu in SailfishOS QML"
Calls sailfish_snippet({ pattern: "page-with-pulley", language: "qml" }).
Available Templates
Template | Description |
| Sailfish OS Qt Quick Application (QML Only) |
| Sailfish OS Qt Quick Application as QMake project |
| Sailfish OS Qt Quick Application as CMake project |
Available Snippets
page-with-pulley, list-view-delegate, cover-page, settings-page, dbus-interface, background-service, notification, file-picker, share-picker, theme-aware-colors, keep-alive, remorse-item, section-header, search-field
Available Guidelines Topics
harbour-validation, ui-components, navigation, theming, permissions, dbus, background-services, notifications, covers, sailfishsilica, cmake, rpm-spec, general, ux-guidelines
Sailfish SDK Quick Reference
# List available build targets
sfdk tools list
# Set active target
sfdk config target SailfishOS-4.5.0.18-armv7hl
# Configure and build
sfdk cmake -B build -S .
sfdk cmake --build build
# Package as RPM
sfdk rpm
# List connected devices
sfdk device list
# Set active device
sfdk config device "Xperia 10 III"
# Deploy to device
sfdk deploy --sdk
# Open a shell inside the build engine
sfdk build-shellProject Structure Conventions
SailfishOS / Harbour apps follow strict conventions:
harbour-appname/ ← Must start with "harbour-"
├── CMakeLists.txt
├── rpm/
│ ├── harbour-appname.spec ← RPM packaging
│ ├── harbour-appname.changes.in ← Changelog file
│ └── harbour-appname.changes.run.in ← Changelog script file
├── src/
│ └── main.cpp ← Uses SailfishApp::main()
├── qml/
│ ├── harbour-appname.qml ← ApplicationWindow root
│ ├── pages/
│ └── cover/
├── icons/
│ ├── 86x86/harbour-appname.png
│ ├── 108x108/harbour-appname.png
│ ├── 128x128/harbour-appname.png
│ └── 172x172/harbour-appname.png
├── translations/
│ └── harbour-appname.ts
└── harbour-appname.desktopDonate
License
MIT
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ilpianista/sailfishos-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server