Reusable code templates MCP server for AI coding agents
npm install sfvibe-templates-mcpReusable code templates MCP server for AI coding agents.


sfvibe-templates-mcp provides production-ready code templates to AI coding agents (Cursor, Claude Code, Windsurf, etc.) via the Model Context Protocol (MCP). Stop generating boilerplate from scratch - get high-quality, tested templates instantly.
| Aspect | sfvibe-templates | Documentation Fetchers (e.g., Context7) |
|--------|----------------|----------------------------------------|
| Token Usage | ~500-1,500 tokens per template | ~3,000-15,000+ tokens per doc page |
| Response Type | Curated, production-ready code | Raw documentation (needs interpretation) |
| Latency | Instant (local templates) | Variable (API + parsing) |
| Accuracy | 100% tested, working code | May need adaptation |
| Offline | Works offline | Requires internet |
| Cost | No API calls for templates | API costs per request |
Task: "Add Google OAuth to my Next.js app"
``
Documentation Fetcher approach:
├─ Search query → 200 tokens
├─ Doc page fetch → 8,000+ tokens (NextAuth docs)
├─ LLM interpretation → 2,000 tokens
├─ Code generation → 1,500 tokens
└─ Total: ~12,000+ tokens
sfvibe-templates approach:
├─ Search query → 200 tokens
├─ Template fetch → 800 tokens (exact code needed)
├─ Copy & configure → 0 tokens
└─ Total: ~1,000 tokens
Savings: ~90% fewer tokens = faster & cheaper
`
| Operation | Tokens | Response Time |
|-----------|--------|---------------|
| list_templates (all 10) | ~1,101 | 9ms |list_templates
| (auth only) | ~345 | 8ms |search_templates
| | ~419 | 1ms |get_template
| (NextAuth Google) | ~1,121 | 3ms |get_template
| (NextAuth Credentials) | ~1,411 | 2ms |get_template
| (Stripe Checkout) | ~1,572 | 2ms |get_template
| (Prisma Setup) | ~818 | 1ms |get_template
| (tRPC Setup) | ~1,262 | 3ms |
Key Metrics:
- Average template size: ~1,237 tokens
- Template range: 818 - 1,572 tokens
- Estimated savings vs doc fetchers: ~88-90%
- 10x Token Efficient: Pre-curated templates vs raw documentation
- Semantic Search: Find templates using natural language queries
- 10+ Templates: Auth, payment, email, database, storage, and more
- Production Ready: All templates are tested and ready to use
- Zero Hallucination: Exact code, not LLM-generated approximations
- Framework Support: Next.js, with more frameworks coming soon
- MCP Native: Works with any MCP-compatible AI coding tool
Add to ~/.cursor/mcp.json:
`json`
{
"mcpServers": {
"sfvibe-templates": {
"command": "npx",
"args": ["-y", "sfvibe-templates-mcp"],
"env": {
"OPENAI_API_KEY": "sk-..."
}
}
}
}
`bash`
claude mcp add sfvibe-templates -- npx -y sfvibe-templates-mcp
Add to your settings.json:
`json`
{
"mcp.servers": {
"sfvibe-templates": {
"command": "npx",
"args": ["-y", "sfvibe-templates-mcp"]
}
}
}
| Category | Template | Description |
|----------|----------|-------------|
| Auth | NextAuth Credentials | Email/password auth with NextAuth.js v5 |
| Auth | NextAuth Google | Google OAuth with NextAuth.js v5 |
| Auth | Supabase Auth | Supabase Auth with @supabase/ssr |
| Payment | Stripe Checkout | One-time payments with Stripe |
| Payment | Stripe Subscription | Subscription billing with Stripe |
| Email | Resend | Transactional emails with Resend |
| Database | Prisma Setup | Prisma ORM configuration |
| Database | Drizzle Setup | Drizzle ORM configuration |
| Storage | S3 Upload | AWS S3 file uploads |
| API | tRPC Setup | Type-safe API with tRPC |
Search for templates using natural language:
``
Input: "I need Google authentication for my Next.js app"
Output: List of relevant templates with scores
Get complete template code and setup instructions:
``
Input: templateId = "typescript/nextjs/auth/nextauth-google"
Output: Code files, dependencies, env vars, usage guide
Browse available templates:
```
Input: category = "auth" (optional)
Output: List of templates in the category
| Variable | Required | Description |
|----------|----------|-------------|
| OPENAI_API_KEY | No* | OpenAI API key for semantic search |
| GOOGLE_API_KEY | No* | Google Gemini API key for semantic search |
| ANTHROPIC_API_KEY | No* | Anthropic Claude API key for semantic search |
*Semantic search requires one of the API keys above. The system checks in order: OpenAI → Gemini → Claude. Without any key, keyword search is used as fallback.
We welcome contributions! Help us build the best collection of templates.
| Level | Title | Requirements | Privileges |
|-------|-------|--------------|------------|
| 1 | Newcomer | First PR merged | Name in Contributors list |
| 2 | Contributor | 3+ templates | Priority review, badge |
| 3 | Regular | 10+ templates | Can review PRs |
| 4 | Expert | 25+ templates | Category ownership |
| 5 | Maintainer | Invited | Can merge PRs |
See CONTRIBUTING.md for detailed guidelines on adding templates.
MIT - see LICENSE for details.