Commit graph

955 commits

Author SHA1 Message Date
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
Sheldon Nunes
74737223a0 Fix tools with no args 2025-07-23 13:42:19 +12:00
Koichi ITO
6bace861b2
Merge pull request #83 from koic/make_default_protocol_version_latest_spec_version
Set default protocol version to the latest specification
2025-07-21 12:54:14 +09:00
Koichi ITO
2b36bf6b2d Set default protocol version to the latest specification
Currently, MCP has three versions: 2024-11-05, 2025-03-26, and 2025-06-18.

- https://modelcontextprotocol.io/specification/2024-11-05/basic/transports (stdio and HTTP with SSE)
- https://modelcontextprotocol.io/specification/2025-03-26/basic/transports (stdio and Streamable HTTP)
- https://modelcontextprotocol.io/specification/2025-06-18/basic/transports (stdio and Streamable HTTP)

The newer specification supports stdio and Streamable HTTP as transport mechanisms.
Only the oldest version, 2024-11-05, supports stdin and HTTP with SSE,
but that version is now considered legacy.

Given the current behavior of the Ruby SDK, it likely makes more sense to set
the default protocol version to the latest one, 2025-06-18, rather than the oldest, 2024-11-05.

Ideally, the implementation should adjust its behavior based on the version,
but this PR is limited to updating the default protocol version only.
2025-07-20 16:36:18 +09:00
Koichi ITO
e4d5f19574
Merge pull request #80 from koic/validate_protocol_version_value
Validate `protocol_version` value
2025-07-19 16:14:49 +09:00
Koichi ITO
54c1f969d6
Merge pull request #82 from honzasterba/fix_test_warnings
[tests] Fix test warnings
2025-07-18 11:28:18 +09:00
Jan Sterba
ed9e0fbc9c [tests] fix warnings and erros after warnings removed 2025-07-17 14:50:10 +02:00
Koichi ITO
f13522d416 Validate protocol_version value
## Motivation and Context

Currently, MCP supports the following three protocol versions:
"2025-06-18", "2025-03-26", and "2024-11-05".
https://modelcontextprotocol.io/introduction

As shown in the changes to `test/mcp/configuration_test.rb`,
the `protocol_version` value is not currently being validated,
which allows unexpected `protocol_version` values to be accepted.

This PR ensures that only supported protocol versions are accepted.

## How Has This Been Tested?

Existing tests have been updated and new tests have been added.

## Breaking Changes

None. If it becomes an issue, it means a value that was not originally intended has been used.

## Additional context

While one possible approach might be to fall back to a default protocol version
when an invalid `protocol_version` value is provided,
this PR opts to reject invalid `protocol_version` values explicitly.
The reasoning is that encouraging users to provide intentional,
valid input is preferable to silently falling back to a default,
which could lead to unexpected behavior.
2025-07-16 12:38:49 +09:00
Ateş Göral
efeef2831e
Merge pull request #79 from atesgoral/v0.2.0 v0.2.0
v0.2.0
2025-07-15 16:01:32 -04:00
Ates Goral
d853cc92d5 Add new version to CHANGELOG.md 2025-07-15 15:45:05 -04:00
Ates Goral
bdd118a568 Update release process
fixup: Remove "the"
2025-07-15 15:44:58 -04:00
Ates Goral
d234d011e6 Bump version 2025-07-15 15:40:15 -04:00
Ateş Göral
e2fe23b7be
Merge pull request #78 from atesgoral/changelog
Add CHANGELOG.md and update rules
2025-07-15 15:15:23 -04:00
Ates Goral
e046b8a95c Update CHANGELOG update rules and ask Cursor to populate Unreleased 2025-07-15 12:11:35 -04:00
Ates Goral
4dbbfdfcfa Add CHANGELOG.md 2025-07-15 11:16:42 -04:00
Topher Bullock
3d5451ad32
Merge pull request #77 from modelcontextprotocol/run-release-workflow-in-environment
run `workflows/release.yml` in release environment
2025-07-15 10:27:40 -04:00
Ateş Göral
fcb2a8cf0b
Merge pull request #75 from atesgoral/custom-methods
Add define_custom_method to define custom methods (and notifications)
2025-07-15 10:02:55 -04:00
Topher Bullock
520205cad2 run workflows/release.yml in release environment 2025-07-15 09:48:24 -04:00