i2y/castella/castella-mcp
Claude Code and agent skill by i2y/castella
- community
Checking that the SKILL.md file is still in the repository.
Enable AI agents to introspect and control Castella UIs via MCP. Create MCP servers, expose UI resources, handle MCP tools, and use semantic IDs.
Install
npx vskill@latest install i2y/castella/castella-mcpSKILL.md
Castella MCP Integration
MCP (Model Context Protocol) enables AI agents to introspect and control Castella UIs programmatically. This provides a standard protocol for AI-UI interaction.
When to use: "enable MCP for Castella", "MCP server", "semantic ID", "MCP resources", "MCP tools", "SSE transport", "CastellaMCPServer", "control UI with MCP"
Quick Start
Create an MCP-enabled Castella app:
Installation
Semantic IDs
Assign stable, human-readable identifiers to widgets:
Auto-generated IDs (if not specified): button_0, input_1, etc.
Best Practices for Semantic IDs
- Use descriptive names:
submit-form-btn, notbtn1 - Use kebab-case:
user-name-input - Include widget type:
email-input,save-btn - Match action/purpose:
login-btn,search-input
MCP Resources
Read-only data available to AI agents:
| URI | Description | |
|---|---|---|
ui://tree | Complete UI tree structure | |
ui://focus | Currently focused element | |
ui://elements | All interactive elements | |
ui://element/{id} | Specific element details | |
a2ui://surfaces | A2UI surfaces (if A2UI enabled) |
Example: UI Tree Resource
MCP Tools
Actions AI agents can perform:
| Tool | Description | Parameters | |
|---|---|---|---|
click | Click/tap element | element_id | |
type_text | Type into input | element_id, text, replace | |
focus | Set focus | element_id | |
scroll | Scroll container | element_id, direction, amount | |
toggle | Toggle checkbox/switch | element_id | |
select | Select in picker/tabs | element_id, value | |
list_actionable | List interactive elements | - | |
send_a2ui | Send A2UI message | message |
Tool Examples
Transports
stdio (Default)
For MCP clients that communicate via stdin/stdout:
SSE (HTTP)
For HTTP-based MCP clients (Claude Desktop, web clients):
SSE endpoints:
GET /sse- SSE event streamPOST /message- Send MCP messagesGET /health- Health check
Example: MCP Client (Python)
Control a Castella app via HTTP:
A2UI + MCP Integration
Combine A2UI rendering with MCP control:
A2UI component IDs automatically become MCP semantic IDs.
send_a2ui Tool
When A2UI renderer is provided, the send_a2ui tool becomes available:
API Reference
CastellaMCPServer
ElementInfo
Information about a UI element:
Best Practices
- Use descriptive semantic IDs for all interactive elements
- Refresh registry after major UI changes:
mcp.refresh_registry() - Use SSE transport for remote/HTTP clients
- Combine with A2UI for full agent-UI integration
- Handle errors in tool calls gracefully
Reference
references/resources.md- Complete resource URI referencereferences/tools.md- Complete tool referencereferences/types.md- ElementInfo, UITreeNode typesscripts/- Executable examples (mcp_basic.py, mcp_sse.py)
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/castella-mcp/SKILL.md
Popularity
- Repository stars
- 37
- Repository forks
- 1
- 7-day trend score
- 18
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 18 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/i2y/castella/castella-mcp)