Commit graph ruby-sdk/README.md
Author SHA1 Message Date
Koichi ITO
eecc0eaefb [Doc] Add links to badges
This PR adds links to the following two badges:

1. RubyGems badge: A link to the `mcp` gem will be added. The repository name is `ruby-sdk`,
following the modelcontextprotocol org's naming convention. Since the repository name and
the gem name are different, the link will help make it clear which gem it refers to.
2. MIT license badge: This will link to the MIT license file in the repository.

NOTE: Separately from this PR, the copyright notice in the MIT license should probably be addressed.
It currently says `Copyright (c) 2025 TODO: Write your name`, so the TODO should be resolved:
https://github.com/modelcontextprotocol/ruby-sdk/blob/v0.1.0/LICENSE.txt#L3

Other language SDKs seem to list `Anthropic, PBC` as the copyright holder,
though I would defer that decision to someone more knowledgeable.
2025-06-09 14:36:29 +09:00
Ateş Göral
9d78717718
Add CI badge
Co-authored-by: Koichi ITO <koic.ito@gmail.com>
2025-06-05 09:16:42 -04:00
Ates Goral
652a06ca6f Update title + desc and add badges 2025-06-05 00:57:47 -04:00
Koichi ITO
ced9481194 [Doc] Fix a typo 2025-06-05 11:19:31 +09:00
Koichi ITO
70680fce88 Fix build error
Follow-up to #27.

This PR fixes the following build error:

```console
$ bundle exec rake
/Users/koic/.rbenv/versions/3.5-dev/lib/ruby/3.5.0+1/bundled_gems.rb:59:in 'Kernel.require': cannot load such file -- mcp/transports/stdio (LoadError)
Did you mean?  mcp/transports/stdio_transport_test
        from /Users/koic/.rbenv/versions/3.5-dev/lib/ruby/3.5.0+1/bundled_gems.rb:59:in 'block (2 levels) in Kernel#replace_require'
        from /Users/koic/src/github.com/modelcontextprotocol/ruby-sdk/test/mcp/transports/stdio_transport_test.rb:4:in '<top (required)>'
        from /Users/koic/.rbenv/versions/3.5-dev/lib/ruby/3.5.0+1/bundled_gems.rb:59:in 'Kernel.require'
        from /Users/koic/.rbenv/versions/3.5-dev/lib/ruby/3.5.0+1/bundled_gems.rb:59:in 'block (2 levels) in Kernel#replace_require'
        from /Users/koic/.rbenv/versions/3.5-dev/lib/ruby/gems/3.5.0+1/gems/rake-13.3.0/lib/rake/rake_test_loader.rb:21:in 'block in <main>'
        from /Users/koic/.rbenv/versions/3.5-dev/lib/ruby/gems/3.5.0+1/gems/rake-13.3.0/lib/rake/rake_test_loader.rb:6:in 'Array#select'
        from /Users/koic/.rbenv/versions/3.5-dev/lib/ruby/gems/3.5.0+1/gems/rake-13.3.0/lib/rake/rake_test_loader.rb:6:in '<main>'
rake aborted!
Command failed with status (1)
/Users/koic/.rbenv/versions/3.5-dev/bin/bundle:25:in 'Kernel#load'
/Users/koic/.rbenv/versions/3.5-dev/bin/bundle:25:in '<main>'
Tasks: TOP => default => test
(See full trace by running task with --trace)
```

https://github.com/modelcontextprotocol/ruby-sdk/actions/runs/15428236624/job/43420346011

The following is stated in #27.

> Breaking Changes
> `MCP::Transports::StdioTransport` is now `MCP::Server::Transports::StdioTransport`

What is shown here is the new name `MCP::Server::Transports::StdioTransport`, not `MCP::Server::Transports::Stdio`.

Therefore, the file path has been updated from `lib/mcp/server/transports/stdio.rb` to `lib/mcp/server/transports/stdio_transport.rb` to
match the module name. If `MCP::Server::Transports::Stdio` is preferred instead, please let me know and I will open a separate PR.
2025-06-04 11:48:25 +09:00
Topher Bullock
e901f94a3d
Merge pull request #37 from koic/tweak_stdio_transport_example_code_in_the_readme
[Doc] Tweak stdio transport example code in the README
2025-06-03 17:28:53 -04:00
Topher Bullock
dcc31ca6fd
Merge pull request #27 from jcat4/refactor-for-client-support
Refactor in preparation for client support
2025-06-03 17:27:54 -04:00
Koichi ITO
6de5468c8b [Doc] Tweak stdio transport example code in the README
The example code is located at `./examples/stdio_server.rb`.
Also, the content provided as input via stdio has been updated to avoid returning an error data.
Using ping pong as an example, here's the difference:

## Before

An error data is returned.

```console
$ ./examples/stdio_server.rb
{"jsonrpc":"2.0","id":"1","result":"pong"}
{"jsonrpc":"2.0","id":null,"error":{"code":-32600,"message":"Invalid Request","data":"Method name must be a string and not start with \"rpc.\""}}
```

This error message is generated in the following location:
https://github.com/Shopify/json-rpc-handler/blob/v0.1.1/lib/json_rpc_handler.rb#L70

## After

The expected result is returned without error data.

```console
$ ./examples/stdio_server.rb
{"jsonrpc":"2.0","id":"1","method":"ping"}
{"jsonrpc":"2.0","id":"1","result":{}}
```

The other stdin example has been updated to use data that does not cause errors.

With this document update, users can verify the behavior of the MCP server via stdin without using an MCP client.
2025-06-03 23:41:13 +09:00
Joey Cardosi
d80b13736e
just redo all of it from scratch 2025-05-30 12:15:11 -04:00
Topher Bullock
5db96f0b5c document release process 2025-05-30 11:42:50 -04:00
Topher Bullock
bf07d4a02c update README and cursor rule 2025-05-29 17:11:45 -04:00
Koichi ITO
e526009b52 [Doc] Fix invalid syntax in README examples
This PR corrects invalid syntax in the README examples.
Additionally, all lambda blocks using `->` have been consistently
formatted with `{}`.
2025-05-23 15:39:59 +09:00
Kevin Fischer
7b390053bd
Update README and example with server version 2025-05-13 23:58:38 +09:00
Tyler Rowsell
baeb99ffbc Internal Release 0.7.0
- add support for resource templates
- improve capability negotiation on handlers
- clean up readme
- reduce default protocol version to "2024-11-05"
- address spec compliance of resources
- add debug gem to development
- alias ModelContextProtocol to MCP
- move prompt subclasses to subdir
- improve tool and prompt definition
- improve passing of server context to tools
- improve tool input schema validation
2025-05-08 17:38:19 -04:00
Tyler Rowsell
62184957e0 Internal Release 0.6.0
Rename Context Arg
2025-05-08 17:38:13 -04:00
Topher Bullock
6da8bfab1a Internal Release 0.5.2
Added
- Added stdio transport functionality.
Changed
- Added stdio details to the README.
2025-05-08 17:38:09 -04:00
Topher Bullock
d2b6a33788 Internal Release 0.5.1
- Allow protocol version to be set at the server level through configuration instead of a class method, providing more flexibility in protocol version management [#43](https://github.com/Shopify/mcp-ruby/pull/43) @topherbullock

- Fixed instrumentation handling to ensure accurate timing information and proper error reporting [#42](https://github.com/Shopify/mcp-ruby/pull/42) @tobiasbales
  - Improved error handling and reporting in the server
  - Fixed timing information collection in instrumentation
  - Added proper error types for different failure scenarios
  - Enhanced test coverage for error cases

- [Allow protocol version to be set at the server level #43](https://github.com/Shopify/mcp-ruby/pull/43) @topherbullock
- [Fix instrumentation handling #42](https://github.com/Shopify/mcp-ruby/pull/42) @tobiasbales
2025-05-08 17:38:05 -04:00
Topher Bullock
7175d49108 Internal Release 0.5.0
Bump protocol version to 2025-03-26
Provide fallback value for tool_name
Make configuration per server
Add support for tool annotations
document tool annotations
2025-05-08 17:38:02 -04:00
Topher Bullock
2eca3681df Internal Release 0.4.0
- Added support for handle_json method from JSON RPC gem to allow consumers to pass JSON strings
- Added context parameter to prompt templating system

- Updated tool and prompt registration to use class references instead of instances
- Changed tool response is_error to isError to match protocol specification
2025-05-08 17:37:57 -04:00
Topher Bullock
0645351585 Internal Release 0.3.0
Add configurable exception reporter
Avoid leaking tool exceptions by sending them to a configurable exception reporter
Add optional context to pass to tools
Add basic instrumentation data/labels
2025-05-08 17:37:54 -04:00
Ates Goral
c5591be30b Internal Release 0.2.4
- remove activesupport as a runtime dependency
- use alternative to activesupport/inflector methods
- use `json_rpc_handler` gem
- add json_rpc_handler to gem dependencies
2025-05-08 17:37:45 -04:00
Topher Bullock
6004f42573 Internal Release 0.2.0
- fix `lib/mcp-ruby` auto-import path
- implement server resources
- add basic listing of resources to Server
- allow setting handlers on Server
- wrap handler method results
- make tool definition more declarative
- make prompt definition more declarative
- bump dependency versions
2025-05-08 17:37:40 -04:00
Topher Bullock
a4df3b8688 Internal Release v0.1.1
- implement `Prompt`
- adjust Tool approach
- update readme for tool calling
- document usage of `Prompt`
2025-05-08 17:37:27 -04:00