Koichi ITO
ef56280518
Add title to serverInfo
...
Follow-up to #109 .
`title` has also been added to `serverInfo` and `clientInfo` by
https://github.com/modelcontextprotocol/modelcontextprotocol/pull/663 .
Since `clientInfo` is not treated as product code, support is implemented only in `serverInfo`.
See also https://modelcontextprotocol.io/specification/2025-06-18/schema#implementation .
2025-08-29 14:36:39 +09:00
Koichi ITO
9486c63545
Merge pull request #117 from koic/extract_tool_annotations_tests
...
Extract `MCP::Tool::Annotations` unit tests
2025-08-27 14:57:48 +09:00
Koichi ITO
092aebf1a4
Extract MCP::Tool::Annotations unit tests
...
The tests related to `MCP::Tool::Annotations` will be extracted from the `MCP::ToolTest` test class
into a dedicated `MCP::Tool::AnnotationsTest` unit test class as a testing pair.
This improves test clarity, file level test independence, and file level execution speed.
It also ensures consistent placement as a testing pair under `MCP::Tool::*`:
```console
$ ls lib/mcp/tool/
annotations.rb input_schema.rb response.rb
$ ls test/mcp/tool/
annotations_test.rb input_schema_test.rb response_test.rb
```
2025-08-27 13:33:21 +09:00
Koichi ITO
aec8fb8b00
Merge pull request #116 from koic/tweak_assert_equal_argument_order_in_tests
...
Tweak `assert_equal` argument order in tests
2025-08-27 11:07:00 +09:00
Koichi ITO
ae5a41588e
Tweak assert_equal argument order in tests
...
The argument order for `assert_equal` is expected, actual:
https://github.com/minitest/minitest/blob/v5.25.5/lib/minitest/assertions.rb#L214
This PR corrects the arguments that were reversed to the expected order.
It also enables `Minitest/LiteralAsActualArgument`, which can detect and
autocorrect some of these cases:
https://docs.rubocop.org/rubocop-minitest/0.38/cops_minitest.html#minitestliteralasactualargument
2025-08-27 01:43:55 +09:00
Koichi ITO
022b3ff640
Merge pull request #84 from planio-gmbh/fix/implement-notifications-initialized
...
implements the notifications/initialized method
2025-08-26 05:54:07 +09:00
Koichi ITO
f4228612a8
Merge pull request #115 from koic/tweak_list_of_instrumentation_in_the_readme
...
[Docs] Fix broken list rendering of Instrumentation in the README
2025-08-25 15:25:29 +09:00
Jens Kraemer
be5e7db2a6
implements the notifications/initialized method
...
- According to
https://modelcontextprotocol.io/specification/2025-06-18/basic/lifecycle ,
"After successful initialization, the client MUST send an initialized
notification to indicate it is ready to begin normal operations".
2025-08-25 13:44:21 +08:00
Koichi ITO
e3e67aac08
[Docs] Fix broken list rendering of Instrumentation in the README
...
This PR fixes the broken rendering of the following list:
https://github.com/modelcontextprotocol/ruby-sdk/tree/v0.2.0?tab=readme-ov-file#instrumentation
2025-08-25 10:45:22 +09:00
Koichi ITO
541bbe0859
Merge pull request #113 from koic/document_title_as_draft_and_restore_annotations_title
...
Document `title` as Draft and restore `annotations.title`
2025-08-24 01:23:19 +09:00
Koichi ITO
b4da129aa0
Document title as Draft and restore annotations.title
...
Follow-up to #109 .
The introduction of `title` in #109 is still a draft and is not supported in the latest specification, `Version 2025-06-18 (latest)`.
In this PR, the README.md will be updated to mention this point and restore the references to the removed `annotations.title`.
This aims to inform users that, as of `Version 2025-06-18 (latest)`, the use of `annotations.title` is considered stable.
Additionally, separate validation for these parameters could be added.
Please refer to the following comment regarding `annotations.title` and `title`:
https://github.com/modelcontextprotocol/modelcontextprotocol/pull/663#issuecomment-2963519737
2025-08-23 00:12:12 +09:00
Topher Bullock
06bf90dd98
Merge pull request #97 from honzasterba/rubymine_test_runner_support
...
[test] minites-reporters do not work with RubyMine
2025-08-20 16:25:13 -04:00
Topher Bullock
62360338f4
Merge pull request #109 from jdnvn/main
...
Add title to tools, prompts and resources
2025-08-20 16:19:38 -04:00
Koichi ITO
002df2c774
Merge pull request #107 from pusewicz/response-keyword-boolean
...
Response error keyword argument
2025-08-20 18:26:17 +09:00
Jan Sterba
1895168115
[test] remove minitest-reporters
...
gem not compatible with rubymine test runner
2025-08-20 11:17:20 +02:00
Koichi ITO
f63f360a7b
Merge pull request #108 from koic/remove_redundant_parentheses
...
[Docs] Remove redundant parentheses
2025-08-19 00:25:56 +09:00
Piotr Usewicz
6689db2ca0
Nicer error API
...
Both the combination of positional argument and naming does not feel
like Ruby.
This change makes `is_error` argument a keyword argument called `error`.
Thanks to this, the usage is more self-explanatory:
```ruby
response = Response.new([], error: true)
```
2025-08-18 16:50:20 +02:00
jdnvn
8b4085468e
add titles to tools, prompts and resources
2025-08-17 22:58:15 -04:00
Koichi ITO
f3ad5ff20b
[Docs] Remove redundant parentheses
...
In Ruby, it is generally not customary to add parentheses to methods without arguments.
This PR removes such redundant parentheses from the documentation.
2025-08-18 01:11:27 +09:00
Koichi ITO
d1c6a46e1a
Merge pull request #105 from siddhantbajaj/handle-notification-initialized-method
...
Return HTTP status code 202 for notification initialized method
2025-08-13 00:38:36 +09:00
Siddhant Bajaj
4a65f62158
Return HTTP status code 202 for notification initialized method
2025-08-11 10:40:17 -04:00
Koichi ITO
33258623a7
Merge pull request #106 from koic/remove_useless_code_in_test_helper
...
Remove useless code in test/test_helper.rb
2025-08-11 03:37:54 +09:00
Koichi ITO
216266756a
Remove useless code in test/test_helper.rb
...
This PR removes useless code in test/test_helper.rb.
2025-08-10 01:11:21 +08:00
Koichi ITO
930173a04e
Merge pull request #87 from koic/add_instructions_support_to_mcp_server
...
Add `instructions` support to `MCP::Server`
2025-08-09 03:22:08 +09:00
Koichi ITO
22a7db73fd
Merge pull request #104 from koic/fix_an_incorrect_url
...
[Doc] Fix an incorrect URL
2025-08-08 01:31:08 +09:00
Koichi ITO
2e4e80f727
[Doc] Fix an incorrect URL
...
This PR fixes the following incorrect URL:
https://spec.MCP.io/specification/2025-03-26/basic/utilities/ping/#behavior-requirements
The specification version used in the official links follows "2025-06-18,"
which is the version consistently used throughout the README.md.
2025-08-07 12:45:50 +09:00
Koichi ITO
f6f064ab71
Add instructions support to MCP::Server
...
The response of the `init` method can include `instructions`.
https://modelcontextprotocol.io/specification/2025-06-18/basic/lifecycle
`instructions` appear to be supported starting from the 2025-03-26 specification.
- https://modelcontextprotocol.io/specification/2025-03-26/basic/lifecycle (supports `instructions`)
- https://modelcontextprotocol.io/specification/2024-11-05/basic/lifecycle (does not support `instructions`)
If `instructions` is used with an unsupported protocol version, an `ArgumentError` will be raised.
As additional context, the TypeScript SDK also treats `instructions` as optional.
https://github.com/modelcontextprotocol/typescript-sdk/blob/1.16.0/src/types.ts#L356-L361
2025-08-07 12:17:57 +09:00
Koichi ITO
122bbd0c6c
Merge pull request #102 from koic/remove_redundant_required_features
...
Remove redundant `require` statements
2025-08-04 06:22:56 +09:00
Koichi ITO
31929784d8
Merge pull request #90 from koic/doc_fix_incorrect_example_for_configuring_protocol_version
...
[Doc] Fix incorrect example for configuring protocol version
2025-08-03 16:23:12 +09:00
Koichi ITO
7a9a6e496c
Merge pull request #92 from koic/update_links_of_mcp_specification
...
[Doc] Update links of the MCP specification
2025-08-03 16:03:30 +09:00
Koichi ITO
c5dde9ce2b
Remove redundant require statements
...
This PR removes redundant `require` statements.
2025-08-02 00:57:31 +09:00
Koichi ITO
2c3f218d8f
Merge pull request #100 from pusewicz/default-input-schema
...
Empty inputSchema requires the type key
2025-08-01 01:50:17 +09:00
Piotr Usewicz
2508defc79
inputSchema interface requires type key
...
When defining a tool without any arguments taken, it should be allowed
to not have to define the `input_schema` at all, and the default value
for such a scenario should be `{ type: "object" }` as per the schema.
16d91abb68/schema/2025-06-18/schema.ts (L896-L900)
2025-07-31 08:36:18 +02:00
Koichi ITO
645386eed5
Merge pull request #93 from andyw8/andyw8/clarify-resource-read-handler-example-in-readme
...
Clarify resource read handler in README
2025-07-31 11:42:50 +09:00
Koichi ITO
4ba1e2b7f4
Merge pull request #95 from andyw8/andyw8/fix-resource-example
...
Fix stdio server resource example
2025-07-30 12:45:19 +09:00
Koichi ITO
d1ca0cbcfe
Merge pull request #91 from dak2/fix/json-rpc-of-notification
...
Fix JSON-RPC notification format in Streamable HTTP transport
2025-07-29 02:05:16 +09:00
Koichi ITO
eaa9d58a15
[Doc] Update links of the MCP specification
...
Follow-up to 0695a497 .
This PR updates URLs that were changed due to the redesign of the MCP website:
https://modelcontextprotocol.io
2025-07-28 02:28:05 +09:00
Ateş Göral
db1ae35cec
Merge pull request #94 from andyw8/andyw8/use-valid-syntax-for-uri-examples
...
Use valid syntax for URIs in examples and tests
2025-07-27 11:40:14 -04:00
Andy Waite
ffb04e13ef
Clarify resource read handler in README
2025-07-27 11:31:22 -04:00
Andy Waite
8b92ce005f
Use valid syntax for URI examples
2025-07-27 11:29:03 -04:00
Koichi ITO
52c92c7af5
Merge pull request #96 from dak2/fix/typo
...
[Doc] Fix a typo in READEME.md
2025-07-27 11:53:22 +09:00
dak2
f6eb5ed785
Fix a typo in READEME.md
2025-07-27 10:34:14 +09:00
Andy Waite
d7a1e742a1
Fix stdio server resource example
2025-07-26 19:38:02 -04:00
Koichi ITO
d2ca47be19
[Doc] Fix incorrect example for configuring protocol version
...
`MCP::Server` does not have a `protocol_version=` method.
```console
$ bin/console
irb(main):001> MCP::Server.protocol_version = "2024-11-05"
(irb):1:in '<main>': undefined method 'protocol_version=' for class MCP::Server (NoMethodError)
from bin/console:15:in '<main>'
```
This PR fixes an incorrect example that causes the above error.
2025-07-26 23:47:56 +09:00
dak2
e7fafddf94
Fix JSON-RPC notification format in Streamable HTTP transport
...
Update send_notification method to properly construct JSON-RPC notification objects with jsonrpc version and method fields.
This ensures notifications conform to the JSON-RPC 2.0 specification when sent over HTTP transport.
https://www.jsonrpc.org/specification#notification
Another goal is to standardise the `send_notification` interface.
Before the revision, it was sufficient to pass the method and parameters in the case of stdio.
However, in the case of Streamable, a hash based on the JSON-RPC specification must be passed.
2025-07-26 17:58:31 +09:00
Koichi ITO
eb6156c272
Merge pull request #89 from andyw8/andyw8/fix-namespacing-in-readme-examples
...
Fix namespacing in README examples
2025-07-26 14:54:02 +09:00
Andy Waite
f2f7a3fc12
Fix namespacing in README examples
2025-07-25 16:59:54 -04:00
Koichi ITO
4f9bc6e316
Merge pull request #86 from alexandru-calinoiu/account-for-missing-arguments
...
Account for missing arguments
2025-07-25 01:37:36 +09:00
calin
47215c98ce
Account for missing arguments
2025-07-23 15:17:23 +03:00
Koichi ITO
a84b56c87a
Merge pull request #85 from SheldonNunes/sheldon.fix-tools-with-no-args
...
Fix tools with no args
2025-07-23 12:06:56 +09:00