stylemcp
Validates and rewrites AI-generated text to match brand voice, supporting REST API, MCP, CLI, and GitHub Actions.
README
StyleMCP
Executable brand rules for AI models and agents. Keep every AI-generated message on-brand.
What is StyleMCP?
StyleMCP validates and rewrites AI-generated text to match your brand voice. Use it as:
- REST API - Validate text from any application
- MCP Server - Direct integration with Claude and other AI agents
- CLI - Check copy in your terminal or CI/CD
- GitHub Action - Catch off-brand copy in pull requests
Quick Start
API
curl -X POST https://stylemcp.com/api/validate \
-H "Content-Type: application/json" \
-d '{"text": "Click here to learn more!"}'
Response:
{
"valid": false,
"score": 65,
"violations": [
{
"rule": "no-click-here",
"severity": "error",
"message": "Avoid 'click here' - describe the destination instead",
"suggestion": "Learn more about our features"
}
]
}
CLI
# Install
npm install -g stylemcp
# Validate text
stylemcp validate "Click here to learn more"
# Validate file
stylemcp validate src/copy/homepage.json --pack saas
# Rewrite text
stylemcp rewrite "Please utilize our product" --mode aggressive
MCP (Claude Desktop)
Add to your claude_desktop_config.json:
{
"mcpServers": {
"stylemcp": {
"command": "npx",
"args": ["stylemcp"]
}
}
}
Now Claude can validate and rewrite text using your brand rules.
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/validate |
Validate text against brand rules |
| POST | /api/rewrite |
Rewrite text to match brand voice |
| POST | /api/validate/batch |
Validate multiple texts |
| GET | /api/packs |
List available style packs |
| GET | /api/packs/{pack}/voice |
Get voice guidelines |
| GET | /api/packs/{pack}/ctas |
Get CTA rules |
| GET | /api/mcp/sse |
MCP SSE endpoint |
| POST | /api/mcp/call |
MCP tool calls |
Style Packs
StyleMCP uses style packs - YAML files that define your brand rules.
Available Packs
| Pack | Best For | Key Features |
|---|---|---|
saas |
B2B SaaS products | Professional, clear, helpful tone |
ecommerce |
DTC & retail brands | Friendly, conversion-focused, no pushy CTAs |
healthcare |
Medical & wellness | Compliant language, no cure claims, person-first |
finance |
Fintech & banking | Precise, risk-aware, no guaranteed returns |
Example: saas Pack
- Vocabulary: Prefer "use" over "utilize", "help" over "assist"
- Forbidden words: "synergy", "leverage", "cutting-edge", "game-changing"
- Patterns to avoid: "click here", "we're sorry for any inconvenience"
- CTA rules: Avoid "Submit", "Click here", "OK" - prefer "Save", "Create", "Sign up"
Pack Structure
packs/
my-brand/
manifest.yaml # Pack metadata
voice.yaml # Tone, vocabulary, forbidden words
copy_patterns.yaml # Reusable copy templates
cta_rules.yaml # Button/CTA guidelines
tokens.json # Design tokens (optional)
Create Your Own Pack
# Copy the default pack
cp -r packs/saas packs/my-brand
# Edit the rules
nano packs/my-brand/voice.yaml
# Use your pack
curl -X POST https://stylemcp.com/api/validate \
-d '{"text": "Your text", "pack": "my-brand"}'
voice.yaml Example
tone:
summary: "Friendly, clear, and helpful"
attributes:
- name: friendly
weight: 0.8
- name: professional
weight: 0.7
vocabulary:
rules:
- preferred: "use"
avoid: ["utilize", "leverage"]
- preferred: "help"
avoid: ["assist", "facilitate"]
forbidden:
- "synergy"
- "paradigm shift"
- "game-changing"
doNot:
- pattern: "click here"
reason: "Poor accessibility"
suggestion: "Describe the destination"
severity: error
- pattern: "\\b(obviously|simply|just)\\b"
isRegex: true
reason: "Can make users feel stupid"
severity: warning
Self-Hosting
Docker
# Clone the repo
git clone https://github.com/3DUNLMTD/stylemcp.git
cd stylemcp
# Set up environment
echo "STYLEMCP_API_KEY=$(openssl rand -hex 32)" > .env
# Run with Docker
docker compose up -d
# Check health
curl http://localhost:3000/health
Manual
# Install dependencies
npm install
# Build
npm run build
# Start server
npm start
GitHub Actions
name: Brand Check
on: [pull_request]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate copy
run: |
npx stylemcp validate src/copy/*.json \
--min-score 80 \
--format github
Environment Variables
| Variable | Description | Default |
|---|---|---|
PORT |
Server port | 3000 |
STYLEMCP_API_KEY |
API key for authentication | (none) |
GITHUB_WEBHOOK_SECRET |
GitHub webhook secret | (none) |
MCP Tools
When used as an MCP server, StyleMCP provides these tools:
| Tool | Description |
|---|---|
validate_text |
Validate text against brand rules |
rewrite_to_style |
Rewrite text to match brand voice |
get_voice_rules |
Get voice and tone guidelines |
get_copy_patterns |
Get approved copy patterns |
get_cta_rules |
Get CTA guidelines |
get_tokens |
Get design tokens |
list_packs |
List available style packs |
What Gets Validated?
The saas pack checks for:
Vocabulary
- Use simple words: "use" not "utilize", "help" not "assist"
- Avoid jargon: "synergy", "leverage", "paradigm shift"
- Avoid weak intensifiers: "very", "really", "extremely"
Patterns
- No "click here" (accessibility issue)
- No "we're sorry for any inconvenience" (corporate non-apology)
- No double "please" (sounds desperate)
- No starting with "Sorry" (lead with solutions)
CTAs
- Avoid generic: "Submit", "OK", "Yes/No", "Click here"
- Use specific actions: "Save", "Create", "Sign up", "Export"
- Max 4 words
Constraints
- Max 25 words per sentence
- No exclamation marks (in most contexts)
- First-person plural ("we", "our")
- Oxford comma
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。