
f/mcp-startup-boilerplate 是从 https://github.com/f/mcp-startup-boilerplate. 导入的一个 MCP 服务器候选
概览
f/mcp-startup-boilerplate 是从 https://github.com/f/mcp-startup-boilerplate. 导入的一个 MCP 服务器候选
概述(AI 翻译)
一个强大、免费、现成可用的 Rails 模板,用于构建基于 AI 驱动的应用,通过模型上下文协议(MCP)与 Claude AI 无缝集成。该模板开箱即用地包含用户认证和 OAuth2 提供者功能。
🚀 特色
- 用户认证:由Devise驱动的完整认证系统
- OAuth2 提供者:带 Doorkeeper 的完整 OAuth2 服务器实现
- MCP 集成:使用 fast-mcp 实现无缝 Claude AI 集成
- 支付处理:支持订阅选项工具的集成Stripe支付
- 现代轨道:基于轨道构建,具备最新功能
- Tailwind CSS:Tailwind 界面美观且响应灵敏
- Hotwire:现代快速前端,配备Turbo和Stimulus
📋 要求
- Ruby 3.2+
- PostgreSQL
- Node.js & Yarn(前端资产)
- Stripe 账户(用于支付处理)
🔧 布置
1.克隆仓库
2.安装依赖
3.建立数据库
4.配置Stripe(支付功能可选)
在你的环境中设置你的 Stripe API 密钥:
在开发方面,你也可以在config/initializers/stripe.rb中更新这些内容。
5.
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
MCP Startup Boilerplate v0.0.1
A robust, free, ready-to-use Rails boilerplate for building AI-powered applications that integrate seamlessly with Claude AI using the Model Context Protocol (MCP). This boilerplate includes user authentication and OAuth2 provider capabilities out of the box.
🚀 Features
- User Authentication: Complete authentication system powered by Devise
- OAuth2 Provider: Full OAuth2 server implementation with Doorkeeper
- MCP Integration: Seamless Claude AI integration using fast-mcp
- Payment Processing: Integrated Stripe payments for tools with subscription options
- Modern Rails: Built on Rails 8.0.2 with the latest features
- Tailwind CSS: Beautiful, responsive UI with Tailwind
- Hotwire: Modern, fast frontend with Turbo and Stimulus
📋 Requirements
- Ruby 3.2+
- PostgreSQL
- Node.js & Yarn (for frontend assets)
- Stripe Account (for payment processing)
🔧 Setup
1. Clone the repository
git clone https://github.com/f/mcp-startup-boilerplate mcp-startup
cd mcp-startup
2. Install dependencies
bundle install
yarn install
3. Setup the database
rails db:create db:migrate db:seed
4. Configure Stripe (optional for payment features)
Set your Stripe API keys in your environment:
export STRIPE_PUBLISHABLE_KEY="pk_test_your_key"
export STRIPE_SECRET_KEY="sk_test_your_key"
export STRIPE_WEBHOOK_SECRET="whsec_your_webhook_key"
For development, you can also update these in config/initializers/stripe.rb
5. Start the server
rails server
Your application should now be running at http://localhost:3000
💳 Payment Integration
This application comes with built-in Stripe payment processing for MCP tools:
Subscription Plans
- Standard Plan: $0.03 per tool call with 40% savings compared to pay-as-you-go
- Enterprise Plan: $0.03 per tool call with additional benefits and unlimited usage
Pay-Per-Use Pricing
- Default pricing: $0.05 per tool call (can be customized per tool)
Payment Management
- User-friendly subscription management interface
- Detailed usage tracking dashboard
- Tool usage history and analytics
🧰 Paid Tool Framework
The application includes a PaidTool base class that allows you to easily create tools that require payment:
class YourPaidTool < PaidTool
description "Your paid tool description"
# Custom pricing (optional, defaults to $0.05)
def price_cents
8 # $0.08 per call
end
def call
return { error: "User has no active subscription" } unless charge_user
# Your implementation here after charge
end
end
How PaidTool Works
- When a tool is called, it first checks if the user has an active subscription
- If subscribed, the tool executes and logs usage without additional charges
- If not subscribed, the user is charged the tool’s price via Stripe
安装
npx -y mcp-remote http://your-server-url/mcp/sse配置
{
"mcpServers": {
"your-server-name": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"http://your-server-url/mcp/sse"
]
}
}
}