Castrel Proxy
A lightweight remote command execution bridge client that connects to a server via WebSocket to receive and execute commands, with MCP (Model Context Protocol) integration.
✨ Features
- ✅ Secure Pairing: Pair with server using verification codes
- ✅ Persistent Configuration: Configuration saved in
~/.castrel/config.yaml - ✅ Unique Identifier: Generate stable client ID based on machine characteristics
- ✅ WebSocket Connection: Real-time bidirectional communication
- ✅ Command Execution: Execute shell commands with whitelist security
- ✅ Document Operations: Read, write, and edit files remotely
- ✅ Auto Reconnect: Automatically reconnect when connection is lost
- ✅ Timeout Control: Command execution timeout protection
- ✅ MCP Integration: Connect to local MCP services and sync tools information
📦 Installation
Via pip
pip install castrel-proxy
From source
git clone https://github.com/castrel-ai/castrel-proxy.git
cd castrel-proxy
pip install -e .
🚀 Quick Start
1. Pair with Server
castrel-proxy pair <verification_code> <server_url>
Example:
castrel-proxy pair eyJ0cyI6MTczNTA4ODQwMCwid2lkIjoiZGVmYXVsdCIsInJhbmQiOiIxMjM0NTYifQ https://server.example.com
2. Start Bridge Service
# Run in background (default)
castrel-proxy start
# Run in foreground
castrel-proxy start --foreground
# Press Ctrl+C to stop (foreground mode only)
3. Stop Bridge Service
# Stop background daemon
castrel-proxy stop
4. Check Status
castrel-proxy status
5. View Logs
# View last 50 lines (default)
castrel-proxy logs
# View last 100 lines
castrel-proxy logs -n 100
# Follow logs in real-time
castrel-proxy logs -f
🛠️ Managing Skills
Create a skill scaffold:
castrel-bridge-cli skill init my-skill -d "my custom skill"
List local skills:
castrel-bridge-cli skill list -v
Validate a skill:
castrel-bridge-cli skill validate my-skill --strict
Package / Import a skill:
castrel-bridge-cli skill package my-skill -o /tmp/my-skill.skill
castrel-bridge-cli skill import /tmp/my-skill.skill
Sync skills to server:
castrel-bridge-cli skill sync
Skill Sync Troubleshooting
401/403: Re-runcastrel-bridge-cli pairand verify the code and workspace match.skill_content_pullfails withcontent_hashmismatch: Server content has changed — retry sync or check if server is caching an old hash.- Import fails with "directory name does not match frontmatter name": Rename the directory to exactly match the
namefield inSKILL.md. - Import fails with "forbidden file type": Remove
.pem/.key/.dll/.soand other restricted files before importing. - Skills not visible on server after sync: Confirm
castrel-bridge-cli skill list -vshows local skills, then runcastrel-bridge-cli mcp-syncorskill sync.
📖 Documentation
- Installation Guide
- Configuration Guide
- Daemon Mode Guide
- MCP Integration
- API Reference
- Protocol Specification
- Migration Guide
🔧 Configuration
Bridge Configuration (~/.castrel/config.yaml)
Pairing information is saved automatically:
server_url: "https://server.example.com"
verification_code: "ABC123"
client_id: "a1b2c3d4e5f6"
workspace_id: "default"
paired_at: "2025-12-22T10:30:00Z"
MCP Configuration (~/.castrel/mcp.json)
Configure MCP services (optional):
{
"mcpServers": {
"filesystem": {
"transport": "stdio",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/dir"],
"env": {}
}
}
}
See examples/mcp.json.example for more examples.
Command Whitelist (~/.castrel/whitelist.conf)
Configure allowed commands for security:
# Add commands one per line
ls
cat
git
python
# etc.
🏗️ Architecture
┌─────────────────────────────────────────────────┐
│ Bridge Client (Local) │
│ │
│ ┌──────────────────────────────────────────┐ │
│ │ CLI Commands │ │
│ └──────────────────────────────────────────┘ │
│ │ │
│ ┌─────────────┼─────────────┐ │
│ │ │ │ │
│ ┌───▼────┐ ┌────▼─────┐ ┌───▼─────┐ │
│ │ Core │ │ MCP │ │ Network │ │
│ │ Config │ │ Manager │ │ Client │ │
│ └────────┘ └──────────┘ └──────────┘ │
│ │ │ │
│ ┌─────▼─────┐ │ │
│ │ MCP │ │ │
│ │ Servers │ │ │
│ └───────────┘ ┌────▼─────┐ │
│ │ Command │ │
│ │ Executor │ │
│ └──────────┘ │
└─────────────────────────────────────────────────┘
│
│ WebSocket
▼
┌─────────────────────────────────────────────────┐
│ Bridge Server (Remote) │
│ /api/v1/bridge/ws?client_id=xxx&code=yyy │
└─────────────────────────────────────────────────┘
🛠️ Development
Setup Development Environment
# Clone repository
git clone https://github.com/castrel-ai/castrel-proxy.git
cd castrel-proxy
# Install dependencies and sync environment
uv sync
Run Tests
# Run all tests
pytest
# Run with coverage
pytest --cov=castrel_proxy
# Run specific test file
pytest tests/test_core.py
Code Quality
# Format code
black src/
# Lint code
flake8 src/
# Type checking
mypy src/
🤝 Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
📝 License
This project is licensed under the MIT License - see the LICENSE file for details.
🔒 Security
For security concerns, please see SECURITY.md or contact security@example.com.
📮 Contact
- Issues: GitHub Issues
- Discussions: GitHub Discussions
🙏 Acknowledgments
Metadata
Release files for castrel-proxy 0.1.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| castrel_proxy-0.1.10.tar.gz | 69.8 kB | Without provenance | Details for castrel_proxy-0.1.10.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| castrel_proxy-0.1.10-py3-none-any.whl | Python 3 | none | any | Details for castrel_proxy-0.1.10-py3-none-any.whl |
Total release size: 144.9 kB
Release files / castrel_proxy-0.1.10.tar.gz
| Download URL | castrel_proxy-0.1.10.tar.gz |
|---|---|
| Size | 69.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a6ba156832a0271485e3b159e5003338381a5710b0ab7ef0b3ec76ad53177526
|
|
BLAKE2b-256 checksum How to use checksums |
986f54bed75edbef0b2be19faf5853c2cfa13fcf04450fef9c484f6b764dd098
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / castrel_proxy-0.1.10-py3-none-any.whl
| Download URL | castrel_proxy-0.1.10-py3-none-any.whl |
|---|---|
| Size | 75.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
50e792a579fe0a528dd75b301f798d3ee3b70bea2026be5e766df74ecf1c627d
|
|
BLAKE2b-256 checksum How to use checksums |
8c2a38acdff3890b60e86e92b55dd0d814d7011269c4cb84d8138b4b69959421
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for castrel-proxy 0.1.10
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.