Skip to content
Back to search

mcp-startup-boilerplate

MCP Startup Boilerplate v0.0.1

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/f--mcp-startup-boilerplate/badge.svg)](/listings/f--mcp-startup-boilerplate)

HTML

<a href="/listings/f--mcp-startup-boilerplate"><img src="/api/listings/f--mcp-startup-boilerplate/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

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

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 260 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # MCP Startup Boilerplate v0.0.1
  2. 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.
  3. ## 🚀 Features
  4. - **User Authentication**: Complete authentication system powered by Devise
  5. - **OAuth2 Provider**: Full OAuth2 server implementation with Doorkeeper
  6. - **MCP Integration**: Seamless Claude AI integration using fast-mcp
  7. - **Payment Processing**: Integrated Stripe payments for tools with subscription options
  8. - **Modern Rails**: Built on Rails 8.0.2 with the latest features
  9. - **Tailwind CSS**: Beautiful, responsive UI with Tailwind
  10. - **Hotwire**: Modern, fast frontend with Turbo and Stimulus
  11. ## 📋 Requirements
  12. - Ruby 3.2+
  13. - PostgreSQL
  14. - Node.js & Yarn (for frontend assets)
  15. - Stripe Account (for payment processing)
  16. ## 🔧 Setup
  17. ### 1. Clone the repository
  18. ```bash
  19. git clone https://github.com/f/mcp-startup-boilerplate mcp-startup
  20. cd mcp-startup
  21. ```
  22. ### 2. Install dependencies
  23. ```bash
  24. bundle install
  25. yarn install
  26. ```
  27. ### 3. Setup the database
  28. ```bash
  29. rails db:create db:migrate db:seed
  30. ```
  31. ### 4. Configure Stripe (optional for payment features)
  32. Set your Stripe API keys in your environment:
  33. ```bash
  34. export STRIPE_PUBLISHABLE_KEY="pk_test_your_key"
  35. export STRIPE_SECRET_KEY="sk_test_your_key"
  36. export STRIPE_WEBHOOK_SECRET="whsec_your_webhook_key"
  37. ```
  38. For development, you can also update these in `config/initializers/stripe.rb`
  39. ### 5. Start the server
  40. ```bash
  41. rails server
  42. ```
  43. Your application should now be running at http://localhost:3000
  44. ## 💳 Payment Integration
  45. This application comes with built-in Stripe payment processing for MCP tools:
  46. ### Subscription Plans
  47. - **Standard Plan**: $0.03 per tool call with 40% savings compared to pay-as-you-go
  48. - **Enterprise Plan**: $0.03 per tool call with additional benefits and unlimited usage
  49. ### Pay-Per-Use Pricing
  50. - Default pricing: $0.05 per tool call (can be customized per tool)
  51. ### Payment Management
  52. - User-friendly subscription management interface
  53. - Detailed usage tracking dashboard
  54. - Tool usage history and analytics
  55. ## 🧰 Paid Tool Framework
  56. The application includes a `PaidTool` base class that allows you to easily create tools that require payment:
  57. ```ruby
  58. class YourPaidTool < PaidTool
  59. description "Your paid tool description"
  60. # Custom pricing (optional, defaults to $0.05)
  61. def price_cents
  62. 8 # $0.08 per call
  63. end
  64. def call
  65. return { error: "User has no active subscription" } unless charge_user
  66. # Your implementation here after charge
  67. end
  68. end
  69. ```
  70. ### How PaidTool Works
  71. 1. When a tool is called, it first checks if the user has an active subscription
  72. 2. If subscribed, the tool executes and logs usage without additional charges
  73. 3. If not subscribed, the user is charged the tool's price via Stripe
  74. 4. All tool usage is tracked for analytics and billing purposes
  75. ### Extending PaidTool
  76. You can customize pricing and behavior by:
  77. - Overriding `price_cents` to set custom pricing for specific tools
  78. - Creating different tool categories with varying price points
  79. - Adding tool-specific features for premium subscription tiers
  80. ## 🔒 OAuth2 Integration
  81. This boilerplate comes with a complete OAuth2 server implementation powered by Doorkeeper. Key endpoints:
  82. - OAuth Authorization: `/oauth/authorize`
  83. - Token Endpoint: `/oauth/token`
  84. - Application Registration: `/oauth/applications`
  85. - Token Revocation: `/oauth/revoke`
  86. The OAuth server supports:
  87. - Authorization Code Flow
  88. - Client Credentials Flow
  89. - Refresh Token Flow
  90. - PKCE Extension (S256 and plain)
  91. ## 🤖 MCP Integration
  92. This boilerplate is pre-configured to work with Claude AI through the Model Context Protocol, enabling AI applications to securely access your application's data and functionality.
  93. ### Available MCP Resources
  94. - `users/me` - Access information about the authenticated user
  95. ### Available MCP Tools
  96. - `MeTool` - Get information about the currently authenticated user (do not delete it)
  97. - `FinancialCalculatorTool` - Example paid calculator tool
  98. ## 🔌 Integrating with Claude
  99. To connect your application with Claude:
  100. 1. Register your application in Claude Desktop or other Claude integrations
  101. 2. Configure your MCP server in Claude's configuration:
  102. ```json
  103. {
  104. "mcpServers": {
  105. "your-server-name": {
  106. "command": "npx",
  107. "args": [
  108. "-y",
  109. "mcp-remote",
  110. "http://your-server-url/mcp/sse"
  111. ]
  112. }
  113. }
  114. }
  115. ```
  116. For Claude Desktop, this file is located at:
  117. - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
  118. - Windows: `%APPDATA%\Claude\claude_desktop_config.json`
  119. ## 🔧 Customization
  120. ### Adding New MCP Tools
  121. 1. Create a new tool in `app/tools/`:
  122. ```ruby
  123. class YourTool < ApplicationTool
  124. description 'Your tool description'
  125. arguments do
  126. required(:param_name).filled(:string).description('Parameter description')
  127. end
  128. def call(param_name:)
  129. # Your implementation
  130. # Access the current authenticated user
  131. user = current_user
  132. # Do something with the user data
  133. { user_id: user.id, result: "Processed data for #{user.email}" }
  134. end
  135. end
  136. ```
  137. 2. Register the tool in your MCP configuration
  138. ### Adding New MCP Resources
  139. 1. Create a new resource in `app/resources/`:
  140. ```ruby
  141. class YourResource < ApplicationResource
  142. uri 'your/resource/path'
  143. resource_name 'Your Resource'
  144. description 'Your resource description'
  145. mime_type 'application/json'
  146. def content
  147. # Access the current authenticated user
  148. user = current_user
  149. JSON.generate({
  150. user_id: user.id,
  151. email: user.email,
  152. # Additional user-specific data
  153. custom_data: user.custom_data
  154. })
  155. end
  156. end
  157. ```
  158. 2. Register the resource in your MCP configuration
  159. ### Working with Current User
  160. Both MCP Tools and Resources have access to the `current_user` method, which returns the authenticated user from the OAuth token. This allows you to:
  161. - Retrieve user-specific data
  162. - Perform user-authorized operations
  163. - Maintain security by scoping operations to the authenticated user
  164. - Build personalized AI experiences based on user context
  165. For security reasons, always verify user permissions before exposing sensitive data or performing critical operations.
  166. ## 🛡️ Security Considerations
  167. - All MCP endpoints require proper OAuth authentication
  168. - User data is only accessible to authorized applications
  169. - OAuth tokens can be revoked by users at any time
  170. - PKCE extension is supported for public clients
  171. - Stripe payments are securely processed with modern best practices
  172. ## 📚 Further Reading
  173. - [Doorkeeper Documentation](https://doorkeeper.gitbook.io/guides)
  174. - [fast-mcp Documentation](https://github.com/yjacquin/fast-mcp)
  175. - [Model Context Protocol Specification](https://github.com/anthropics/model-context-protocol)
  176. - [Devise Documentation](https://github.com/heartcombo/devise)
  177. - [Stripe Documentation](https://stripe.com/docs)
  178. ## 📝 License
  179. This project is available under the MIT License.
  180. ## 👥 Contributing
  181. Contributions, issues, and feature requests are welcome!

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.