SwiftPieces
ช่วยให้เอเจนต์เขียนโค้ดค้นหาและติดตั้งคอมโพเนนต์ SwiftUI จริงลงในแอป iOS ของคุณได้
เซิร์ฟเวอร์ MCP แบบโฮสต์
npx add-mcp 'https://swiftpieces.com/api/mcp'ติดตั้งลง Claude Code, Codex, Cursor และอื่นๆ
เอกสาร
Connect Claude Code, Cursor or any MCP client to the free library and the App Design skill, so your agent designs with a method and installs the real piece instead of inventing a lookalike.
The SwiftPieces MCP server is public and needs no account. Your agent can search the free library, read a piece's source and install it into your project. It also carries App Design, a free design method for any SwiftUI app, with or without SwiftPieces: study real apps first, reuse pieces instead of rebuilding them, pick the right navigation, keep motion native, and check every flow in the simulator before calling it done.
URL: https://swiftpieces.com/api/mcp
Claude Code
Run this in your project folder:
claude mcp add --transport http swiftpieces https://swiftpieces.com/api/mcp
This registers the server in your Claude Code settings for this folder, not as a file in the project, so nothing new appears next to your code. Check it with claude mcp list. To share it with everyone who works on the project, add --scope project instead: that writes a .mcp.json you can commit.
Cursor and other clients
Add this to .cursor/mcp.json in your project, or your client's MCP settings:
{
"mcpServers": {
"swiftpieces": { "url": "https://swiftpieces.com/api/mcp" }
}
}
Try it
Start a new agent session in your project and ask:
Add the SwiftPieces "Assistant Orb" piece to my app
Every piece page has this prompt ready to copy under Install.
To design a whole screen or flow, start from the skill. In Claude Code, the server's prompts show up as slash commands:
/mcp__swiftpieces__app-design onboarding with a paywall for my meditation app
In other clients, ask your agent to "use the SwiftPieces App Design skill". It loads the skill with get_design_skill and reads each reference only when the skill points to it.
Prompts and resources
| Name | What it is |
|---|---|
app-design prompt | The App Design skill, ready to follow for the task you give it. |
swiftpieces://skills/swiftpieces-tool-app-design | The skill as a resource you can attach as context. |
swiftpieces://skills/swiftpieces-tool-app-design/references/<name> | Its references: native-controls, navigation, motion, performance and simulator-loop. |
swiftpieces://guides/liquid-glass | The Liquid Glass rules below. |
Tools
| Tool | What it does |
|---|---|
get_design_skill | The App Design skill, or one of its references. |
search_pieces | Search the free library by keyword, category or minimum iOS version. |
search_blocks | Search patterns (also called blocks), whole sections of a screen in SwiftPieces Pro, by keyword or category. |
get_piece | A piece's or a free block's full source, shaders and docs link. |
install_piece | The files to write into your project, plus the matching CLI command. For a block, install the pieces in its registryDependencies too. |
list_categories | Free piece and block categories with counts. |
get_liquid_glass_guide | The rules for correct Liquid Glass code, with verified iOS 26 API names. |
Rules every agent should follow with Liquid Glass
- Gate every glass call with
#available(iOS 26, *)and provide aMaterialfallback. - Wrap multiple glass views in one
GlassEffectContainer. - Apply
.glassEffectafter layout and appearance modifiers. - Respect
accessibilityReduceTransparency. - Never use invented modifiers such as
.liquidGlassUltra. They do not exist.
llms.txt at the site root lists every free piece for agents that read it.
Have SwiftPieces Pro? Its screens, flows, templates and Build Kit use a separate server with your license key. Set up the Pro server →
[
CLI
The swiftpieces CLI copies free SwiftUI components into your Xcode project. npx swiftpieces add Name. There is no Swift package.
](https://swiftpieces.com/docs/cli)[
Changelog
Next Page