rubii-roleplay-mcp
Official# rubii-roleplay-mcp
[](LICENSE)
[](https://modelcontextprotocol.io)
[](https://nodejs.org)
[](#privacy--security)
Official **Model Context Protocol (MCP) Server** for AI character creators, interactive storytellers, and roleplay prompt engineers—built and maintained by the team behind **[Rubii AI](https://rubii.ai)**.
Runs **100% locally over stdio** with **zero API keys and zero external network calls**. Plug it into **Claude Desktop, Cursor, Windsurf, Claude Code**, or any MCP-compatible client to validate Character Card V2/V3 JSON, budget multi-turn context windows, generate safe HTML/CSS status-bar regex templates, and lint character prompts.
---
## Included Tools (5)
| Tool | Purpose |
| --- | --- |
| `validate_character_card` | Validates Character Card V1, V2 (`chara_card_v2`), and V3 (`chara_card_v3`) JSON fields, Lorebook entries, regex triggers, macro syntax, and estimates token usage across 8K / 16K / 24K / 32K windows. |
| `estimate_roleplay_context` | Projects total token load for character sheets, editable long-story Memo notes, constant vs. keyword-triggered Lorebook entries, and conversation history turns—identifying turn eviction risks and trimming opportunities. |
| `generate_status_bar_regex` | Generates sandbox-safe HTML + inline CSS status bar templates (`minimal-card`, `fantasy-rpg`, `cyber-hud`, `novel-chapter`), tested capture-group regex patterns, LLM output instructions, and live verified previews compatible with Rubii AI Styles & Regex and SillyTavern regex rules. |
| `lint_character_prompt` | Audits character prompts for macro errors (`{char}`, `{{ user }}`, unclosed `{{`), conflicting POV instructions, negative-constraint overload, duplicated lines, token bloat, and opening messages that narrate `{{user}}` actions. |
| `get_rubii_platform_guide` | Returns accurate, machine-readable public platform documentation, supported languages, canonical URL patterns, and creator workflows aligned with [rubii.ai/llms.txt](https://rubii.ai/llms.txt). |
---
## Quick Setup
### Claude Desktop
Add to your `claude_desktop_config.json`:
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
```json
{
"mcpServers": {
"rubii-roleplay": {
"command": "npx",
"args": ["-y", "rubii-roleplay-mcp"]
}
}
}
```
### Cursor
Add to `.cursor/mcp.json` (project-level) or `~/.cursor/mcp.json` (global):
```json
{
"mcpServers": {
"rubii-roleplay": {
"command": "npx",
"args": ["-y", "rubii-roleplay-mcp"]
}
}
}
```
### Windsurf
Add to `~/.codeium/windsurf/mcp_config.json`:
```json
{
"mcpServers": {
"rubii-roleplay": {
"command": "npx",
"args": ["-y", "rubii-roleplay-mcp"]
}
}
}
```
### Claude Code (CLI)
```bash
claude mcp add rubii-roleplay -- npx -y rubii-roleplay-mcp
```
---
## Example Prompts to Try in Your AI Assistant
1. *"Validate this Character Card V2 JSON and tell me if it fits comfortably inside an 8K context window."*
2. *"Estimate how many dialogue turns I can sustain on 16K context with this character sheet, 3 Lorebook entries, and a 300-word Memo."*
3. *"Generate a fantasy-rpg status bar regex and safe HTML/CSS template tracking Location, Quest, Stamina, and Key Item."*
4. *"Lint my character prompt and first message for macro typos, POV conflicts, or user god-moding."*
5. *"Look up the canonical Rubii AI public URL patterns and supported languages."*
---
## Privacy & Security
- **100% Local Execution**: Every tool runs purely in-memory on your local machine over MCP stdio. No telemetry, no API keys, and no outbound network requests.
- **Sandbox-Safe HTML/CSS Output**: `generate_status_bar_regex` strictly validates tag names, field keys, and 6-digit hex colors, emitting static HTML with inline CSS only (zero `<script>`, zero inline event handlers, zero external URLs).
---
## Development
```bash
npm install
npm run typecheck
npm test
```
---
## Related Open-Source Tool
Looking for a zero-dependency CLI & TypeScript library to read/write PNG `tEXt` (`chara` / `ccv3`) metadata chunks and convert Character Card V1/V2/V3 files? Check out [`character-card-toolkit`](https://github.com/YoMio-Tech-Inc/character-card-toolkit).
---
## License & Maintainers
Released under the [MIT License](LICENSE).
Built & maintained by the team behind **[Rubii AI](https://rubii.ai)** — AI character chat, interactive storytelling, Styles & regex formatting, and editable long-story Memo.
- Website: <https://rubii.ai>
- Machine-readable platform documentation: <https://rubii.ai/llms.txt>
TDQS
Scored across 5 tools
The tools mostly target distinct artifacts: full character-card JSON validation, prompt prose linting, context-window estimation, status-bar regex generation, and platform documentation. There is some conceptual overlap because validation, linting, and estimation all touch macros, regex, and token usage, but their descriptions make the primary use cases sufficiently distinguishable.
All five tools follow a consistent snake_case verb_noun pattern: validate_character_card, lint_character_prompt, estimate_roleplay_context, generate_status_bar_regex, and get_rubii_platform_guide. The naming is predictable and readable throughout.
Five tools is a well-scoped set for a focused roleplay character-card and prompt-assistance server. Each tool appears to cover a distinct workflow step, with no obvious padding or missing peer tool at this scale.
The surface covers validation, prompt analysis, context estimation, status-bar regex generation, and platform guidance, which addresses the main creator workflows described. Minor gaps remain, such as automated remediation/fixing of detected issues or more direct lorebook entry manipulation, but agents can work around these with the existing tools.