sfvibe-templates-mcp
v1.1.1
Published
Reusable code templates MCP server for AI coding agents
Maintainers
Readme
sfvibe-templates-mcp
Reusable code templates MCP server for AI coding agents.
Overview
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.
Why sfvibe-templates? (vs Documentation Fetchers)
| 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 |
Token Efficiency Example
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 & cheaperReal-World Token Usage (Measured)
| 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%
Features
- 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
Installation
Cursor
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"sfvibe-templates": {
"command": "npx",
"args": ["-y", "sfvibe-templates-mcp"],
"env": {
"OPENAI_API_KEY": "sk-..."
}
}
}
}Claude Code
claude mcp add sfvibe-templates -- npx -y sfvibe-templates-mcpVS Code (Copilot)
Add to your settings.json:
{
"mcp.servers": {
"sfvibe-templates": {
"command": "npx",
"args": ["-y", "sfvibe-templates-mcp"]
}
}
}Available Templates
| 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 |
MCP Tools
search_templates
Search for templates using natural language:
Input: "I need Google authentication for my Next.js app"
Output: List of relevant templates with scoresget_template
Get complete template code and setup instructions:
Input: templateId = "typescript/nextjs/auth/nextauth-google"
Output: Code files, dependencies, env vars, usage guidelist_templates
Browse available templates:
Input: category = "auth" (optional)
Output: List of templates in the categoryEnvironment Variables
| 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.
Contributing
We welcome contributions! Help us build the best collection of templates.
Contributor Levels
| 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.
CI/CD Release Pipeline
When code is pushed to the main branch, GitHub Actions automatically runs npm release in this order:
pnpm install --frozen-lockfiletypecheck,test,build,validate-templates- Automatically bump patch version with
npm version patch --no-git-tag-version npm publish --access public --provenance- Commit the updated
package.jsonand push avX.Y.Ztag
Required setup:
- Connect npm package
sfvibe-templates-mcpto this GitHub repository as a Trusted Publisher - Allow
contents: writepermission for GitHub ActionsGITHUB_TOKEN(already configured in workflow)
License
MIT - see LICENSE for details.
