Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Ignore RSpec status file
/.rspec_status

Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Added
- Tool annotations support for providing hints about tool behavior (readOnlyHint, destructiveHint, etc.)
- Comprehensive Prompts Feature implementation following MCP specification
- Full MCP prompts protocol support
- Prompt templates with ERB support
- Prompt argument validation using Dry::Schema
- Prompt filtering support with ServerFiltering architecture
- MessageBuilder for fluent message construction API
- Auto-naming from class names (e.g., `CodeReviewPrompt` → `code_review`)
- Support for authorization, tags, metadata, and prompt annotations
- Base64 validation for image content to ensure MCP compliance
- Flexible API for the `messages` method supporting hash, array, and block formats
- Rails generator templates for creating prompts

## [1.5.0] - 2025-06-01
### Added
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
fast-mcp (1.5.0)
fast-mcp (1.6.0)
addressable (~> 2.8)
base64
dry-schema (~> 1.14)
Expand Down
29 changes: 27 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ Fast MCP solves all these problems by providing a clean, Ruby-focused implementa

- 🛠️ **Tools API** - Let AI models call your Ruby functions securely, with in-depth argument validation through [Dry-Schema](https://github.com/dry-rb/dry-schema).
- 📚 **Resources API** - Share data between your app and AI models
- 💬 **Prompt Handling** - Create structured message templates for LLM interactions
- 🔄 **Multiple Transports** - Choose from STDIO, HTTP, or SSE based on your needs
- 🧩 **Framework Integration** - Works seamlessly with Rails, Sinatra or any Rack app.
- 🔒 **Authentication Support** - Secure your AI-powered endpoints with ease
- 🚀 **Real-time Updates** - Subscribe to changes for interactive applications
- 🎯 **Dynamic Filtering** - Control tool/resource access based on request context (permissions, API versions, etc.)


## 💎 What Makes FastMCP Great
```ruby
# Define tools for AI models to use
Expand Down Expand Up @@ -269,6 +269,27 @@ end
# Register the resource with the server
server.register_resource(StatisticsResource)

# Define prompts for structured AI interactions
class CodeReviewPrompt < FastMcp::Prompt
# prompt_name is automatically generated as "code_review" from class name
description "Review code for best practices"

arguments do
required(:code).filled(:string)
required(:language).filled(:string)
end

def call(code:, language:)
messages(
assistant: "I'll review your #{language} code for best practices and potential improvements.",
user: "Please review this #{language} code:\n\n```#{language}\n#{code}\n```\n\nFocus on readability, performance, and maintainability."
)
end
end

# Register the prompt with the server
server.register_prompt(CodeReviewPrompt)

# Start the server
server.start
```
Expand Down Expand Up @@ -338,6 +359,7 @@ Add your server to your Claude Desktop configuration at:
```

## How to add a MCP server to Claude, Cursor, or other MCP clients?

Please refer to [configuring_mcp_clients](docs/configuring_mcp_clients.md)

## 📊 Supported Specifications
Expand All @@ -347,6 +369,7 @@ Please refer to [configuring_mcp_clients](docs/configuring_mcp_clients.md)
| ✅ **JSON-RPC 2.0** | Full implementation for communication |
| ✅ **Tool Definition & Calling** | Define and call tools with rich argument types |
| ✅ **Resource & Resource Templates Management** | Create, read, update, and subscribe to resources |
| ✅ **Prompt Handling** | Create structured message templates for LLM interactions |
| ✅ **Transport Options** | STDIO, HTTP, and SSE for flexible integration |
| ✅ **Framework Integration** | Rails, Sinatra, Hanami, and any Rack-compatible framework |
| ✅ **Authentication** | Secure your AI endpoints with token authentication |
Expand Down Expand Up @@ -398,6 +421,7 @@ FastMcp.authenticated_rack_middleware(app,
- [🌐 Sinatra Integration](docs/sinatra_integration.md)
- [📚 Resources](docs/resources.md)
- [🛠️ Tools](docs/tools.md)
- [💬 Prompts](docs/prompts.md)
- [🔒 Security](docs/security.md)
- [🎯 Dynamic Filtering](docs/filtering.md)

Expand All @@ -408,6 +432,7 @@ Check out the [examples directory](examples) for more detailed examples:
- **🔨 Basic Examples**:
- [Simple Server](examples/server_with_stdio_transport.rb)
- [Tool Examples](examples/tool_examples.rb)
- [Prompt Examples](examples/prompts)

- **🌐 Web Integration**:
- [Rack Middleware](examples/rack_middleware.rb)
Expand Down Expand Up @@ -437,4 +462,4 @@ This project is available as open source under the terms of the [MIT License](ht

- The [Model Context Protocol](https://github.com/modelcontextprotocol) team for creating the specification
- The [Dry-Schema](https://github.com/dry-rb/dry-schema) team for the argument validation.
- All contributors to this project
- All contributors to this project
Loading