mcp 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.cursor/rules/release-changelogs.mdc +11 -24
- data/.github/workflows/release.yml +25 -0
- data/.rubocop.yml +5 -3
- data/CHANGELOG.md +57 -0
- data/Gemfile +16 -6
- data/README.md +439 -61
- data/examples/README.md +197 -0
- data/examples/http_client.rb +184 -0
- data/examples/http_server.rb +171 -0
- data/examples/stdio_server.rb +6 -6
- data/examples/streamable_http_client.rb +203 -0
- data/examples/streamable_http_server.rb +173 -0
- data/lib/mcp/client/http.rb +88 -0
- data/lib/mcp/client/tool.rb +16 -0
- data/lib/mcp/client.rb +88 -0
- data/lib/mcp/configuration.rb +22 -3
- data/lib/mcp/methods.rb +55 -33
- data/lib/mcp/prompt.rb +15 -4
- data/lib/mcp/resource.rb +8 -6
- data/lib/mcp/resource_template.rb +8 -6
- data/lib/mcp/server/capabilities.rb +96 -0
- data/lib/mcp/server/transports/stdio_transport.rb +57 -0
- data/lib/mcp/server/transports/streamable_http_transport.rb +301 -0
- data/lib/mcp/server.rb +116 -52
- data/lib/mcp/tool/annotations.rb +4 -4
- data/lib/mcp/tool/input_schema.rb +49 -1
- data/lib/mcp/tool/output_schema.rb +66 -0
- data/lib/mcp/tool/response.rb +15 -4
- data/lib/mcp/tool.rb +38 -7
- data/lib/mcp/transport.rb +16 -4
- data/lib/mcp/transports/stdio.rb +8 -28
- data/lib/mcp/version.rb +1 -1
- data/lib/mcp.rb +20 -12
- data/mcp.gemspec +1 -2
- metadata +21 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 984645dda3d0d04a93b2831354691c475b42d2826462156167a3f1e1104b85d0
|
4
|
+
data.tar.gz: 20f96310129418791e0f5ae7f11b8a67605ff82e7ad29dfdfc414fd24157cf97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9c323d818625f25999d1a2bb7ed1f16783cc295f8676c47bb58a96c284da133a2a5cc5c17086bc72216783325317543031288f1f8f804165503286ec0b1d2e8
|
7
|
+
data.tar.gz: f0b2c995f44682257a642316c6df3aa20bde04db6de92842e35b323460238860890d3e197cc916ec68f96a57f8c24f12877805fc14b8fd27e46999bf4b3d2aa4
|
@@ -1,30 +1,17 @@
|
|
1
1
|
---
|
2
|
-
description:
|
3
|
-
globs:
|
2
|
+
description: Updating CHANGELOG.md before cutting a new release of the gem
|
3
|
+
globs: CHANGELOG.md
|
4
4
|
alwaysApply: false
|
5
5
|
---
|
6
|
-
|
6
|
+
|
7
|
+
- start by refreshing your knowledge on the Keep a Changelog convention by reading the format spec referenced at the top of CHANGELOG.md
|
8
|
+
- stick to Keep a Changelog
|
9
|
+
- entries should be terse and in a top-level flat list: do not nest
|
10
|
+
- follow this format for entries:
|
11
|
+
- Terse description of the change (#nnn)
|
7
12
|
- git tags are used to mark the commit that cut a new release of the gem
|
8
13
|
- the gem version is located in [version.rb](mdc:lib/mcp/version.rb)
|
9
14
|
- use the git history, especially merge commits from PRs to construct the changelog
|
10
|
-
- when necessary, look at the diff of files changed to determine
|
11
|
-
|
12
|
-
|
13
|
-
- ## Fixed; bugfixes that are forward compatible
|
14
|
-
|
15
|
-
use the following format for changelogs:
|
16
|
-
|
17
|
-
```
|
18
|
-
## Added
|
19
|
-
- New functionality added that was not present before
|
20
|
-
|
21
|
-
## Changed
|
22
|
-
- Alterations to functionality that may indicate breaking changes
|
23
|
-
|
24
|
-
## Fixed
|
25
|
-
- Bug fixes
|
26
|
-
|
27
|
-
#### Full change list:
|
28
|
-
- [Name of the PR #123](https:/github.com/modelcontextprotocol/ruby-sdk/pull/123) @github-author-username
|
29
|
-
- [Name of the PR #456](https:/github.com/modelcontextprotocol/ruby-sdk/pull/456) @another-github-author
|
30
|
-
```
|
15
|
+
- when necessary, look at the diff of files changed to determine the true nature of the change
|
16
|
+
- maintenance PRs that don't concern end users of the gem should not be listed in the changelog
|
17
|
+
- when checking PRs, see if there's an upstream remote, and if so, fetch PRs from upstream instead of origin
|
@@ -0,0 +1,25 @@
|
|
1
|
+
name: Release new version
|
2
|
+
on:
|
3
|
+
push:
|
4
|
+
branches: [main]
|
5
|
+
paths:
|
6
|
+
- "lib/mcp/version.rb"
|
7
|
+
jobs:
|
8
|
+
publish_gem:
|
9
|
+
if: github.repository_owner == 'modelcontextprotocol'
|
10
|
+
name: Release Gem Version to RubyGems.org
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
|
13
|
+
environment: release
|
14
|
+
|
15
|
+
permissions:
|
16
|
+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
|
17
|
+
contents: write # IMPORTANT: this permission is required for `rake release` to push the release tag
|
18
|
+
steps:
|
19
|
+
- uses: actions/checkout@v4
|
20
|
+
- name: Set up Ruby
|
21
|
+
uses: ruby/setup-ruby@v1
|
22
|
+
with:
|
23
|
+
bundler-cache: true
|
24
|
+
ruby-version: 3.4
|
25
|
+
- uses: rubygems/release-gem@v1
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
All notable changes to this project will be documented in this file.
|
4
|
+
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
|
+
|
8
|
+
## [Unreleased]
|
9
|
+
|
10
|
+
## [0.3.0] - 2025-09-14
|
11
|
+
|
12
|
+
### Added
|
13
|
+
|
14
|
+
- Tool output schema support with comprehensive validation (#122)
|
15
|
+
- HTTP client transport layer for MCP clients (#28)
|
16
|
+
- Tool annotations validation for protocol compatibility (#122)
|
17
|
+
- Server instructions support (#87)
|
18
|
+
- Title support in server info (#119)
|
19
|
+
- Default values for tool annotation hints (#118)
|
20
|
+
- Notifications/initialized method implementation (#84)
|
21
|
+
|
22
|
+
### Changed
|
23
|
+
|
24
|
+
- Make default protocol version the latest specification version (#83)
|
25
|
+
- Protocol version validation to ensure valid values (#80)
|
26
|
+
- Improved tool handling for tools with no arguments (#85, #86)
|
27
|
+
- Better error handling and response API (#109)
|
28
|
+
|
29
|
+
### Fixed
|
30
|
+
|
31
|
+
- JSON-RPC notification format in Streamable HTTP transport (#91)
|
32
|
+
- Errors when title is not specified (#126)
|
33
|
+
- Tools with missing arguments handling (#86)
|
34
|
+
- Namespacing issues in README examples (#89)
|
35
|
+
|
36
|
+
## [0.2.0] - 2025-07-15
|
37
|
+
|
38
|
+
### Added
|
39
|
+
|
40
|
+
- Custom methods support via `define_custom_method` (#75)
|
41
|
+
- Streamable HTTP transport implementation (#33)
|
42
|
+
- Tool argument validation against schemas (#43)
|
43
|
+
|
44
|
+
### Changed
|
45
|
+
|
46
|
+
- Server context is now optional for Tools and Prompts (#54)
|
47
|
+
- Improved capability handling and removed automatic capability determination (#61, #63)
|
48
|
+
- Refactored architecture in preparation for client support (#27)
|
49
|
+
|
50
|
+
### Fixed
|
51
|
+
|
52
|
+
- Input schema validation for schemas without required fields (#73)
|
53
|
+
- Error handling when sending notifications (#70)
|
54
|
+
|
55
|
+
## [0.1.0] - 2025-05-30
|
56
|
+
|
57
|
+
Initial release
|
data/Gemfile
CHANGED
@@ -6,12 +6,22 @@ source "https://rubygems.org"
|
|
6
6
|
gemspec
|
7
7
|
|
8
8
|
# Specify development dependencies below
|
9
|
-
gem "minitest",
|
10
|
-
gem "rake",
|
11
|
-
gem "rubocop-minitest"
|
12
|
-
gem "rubocop-rake"
|
9
|
+
gem "rubocop-minitest", require: false
|
10
|
+
gem "rubocop-rake", require: false
|
13
11
|
gem "rubocop-shopify", require: false
|
14
12
|
|
15
|
-
gem "
|
16
|
-
gem "
|
13
|
+
gem "puma", ">= 5.0.0"
|
14
|
+
gem "rack", ">= 2.0.0"
|
15
|
+
gem "rackup", ">= 2.1.0"
|
16
|
+
|
17
|
+
gem "activesupport"
|
17
18
|
gem "debug"
|
19
|
+
gem "rake", "~> 13.0"
|
20
|
+
gem "sorbet-static-and-runtime"
|
21
|
+
|
22
|
+
group :test do
|
23
|
+
gem "faraday", ">= 2.0"
|
24
|
+
gem "minitest", "~> 5.1", require: false
|
25
|
+
gem "mocha"
|
26
|
+
gem "webmock"
|
27
|
+
end
|