Skip to content

feat: Improve STDIO transport layer for large JSON-RPC inputs #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: server-prompts-feature
Choose a base branch
from
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@

# Ignore gem files
*.gem

# Ignore .DS_Store files
104 changes: 0 additions & 104 deletions .rspec_status

This file was deleted.

21 changes: 20 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.2] - 2025-04-04

### Changed
- Improved STDIO transport to better handle large JSON-RPC inputs
- Added proper buffering and size limits for input processing
- Enhanced error handling for JSON parsing and IO operations

## [1.1.1] - 2025-04-04

### Changed
- Fix: Removed unused pagination keys (as we don't have this feature yet) from API responses to align with MCP specification

## [1.1.0] - 2025-04-04

### Added
- Prompts Feature
- New flexible API for the `messages` method supporting both hash and array inputs
- Prompt ERB template support for JSON/XML structured data

## [1.0.0] - 2025-03-30

### Added
Expand All @@ -25,7 +44,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Namespace consistency correction (FastMCP -> FastMcp) throughout the codebase

### Improved
- ⚠️ [Breaking] Resource content declaration changes
- [Breaking] Resource content declaration changes
- Now resources implement `content` over `default_content`
- `content` is dynamically called when calling a resource, this implies we can declare dynamic resource contents like:
```ruby
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.0.0)
fast-mcp (1.1.2)
base64
dry-schema (~> 1.14)
json (~> 2.0)
Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ 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


## 💎 What Makes FastMCP Great
```ruby
# Define tools for AI models to use
Expand Down Expand Up @@ -285,6 +285,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 @@ -294,6 +295,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 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 All @@ -315,6 +317,7 @@ Please refer to [configuring_mcp_clients](docs/configuring_mcp_clients.md)
- [🌐 Sinatra Integration](docs/sinatra_integration.md)
- [📚 Resources](docs/resources.md)
- [🛠️ Tools](docs/tools.md)
- [💬 Prompts](docs/prompts.md)

## 💻 Examples

Expand All @@ -323,6 +326,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 @@ -353,3 +357,6 @@ 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

## How to add a MCP server to Claude, Cursor, or other MCP clients?
Please refer to [configuring_mcp_clients](docs/configuring_mcp_clients.md)
Loading