mcp 0.8.0 → 0.10.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/README.md +176 -5
- data/lib/mcp/client/stdio.rb +222 -0
- data/lib/mcp/client.rb +21 -3
- data/lib/mcp/progress.rb +22 -0
- data/lib/mcp/prompt.rb +4 -0
- data/lib/mcp/resource.rb +3 -0
- data/lib/mcp/server/transports/stdio_transport.rb +6 -4
- data/lib/mcp/server/transports/streamable_http_transport.rb +140 -31
- data/lib/mcp/server/transports.rb +10 -0
- data/lib/mcp/server.rb +71 -39
- data/lib/mcp/server_context.rb +44 -0
- data/lib/mcp/server_session.rb +79 -0
- data/lib/mcp/tool.rb +5 -0
- data/lib/mcp/transport.rb +2 -2
- data/lib/mcp/version.rb +1 -1
- data/lib/mcp.rb +11 -24
- metadata +8 -36
- data/.gitattributes +0 -4
- data/.github/dependabot.yml +0 -6
- data/.github/workflows/ci.yml +0 -54
- data/.github/workflows/conformance.yml +0 -29
- data/.github/workflows/release.yml +0 -57
- data/.gitignore +0 -11
- data/.rubocop.yml +0 -15
- data/AGENTS.md +0 -107
- data/CHANGELOG.md +0 -168
- data/CODE_OF_CONDUCT.md +0 -74
- data/Gemfile +0 -29
- data/RELEASE.md +0 -12
- data/Rakefile +0 -56
- data/SECURITY.md +0 -21
- data/bin/console +0 -15
- data/bin/generate-gh-pages.sh +0 -119
- data/bin/rake +0 -31
- data/bin/setup +0 -8
- data/conformance/README.md +0 -103
- data/conformance/expected_failures.yml +0 -9
- data/conformance/runner.rb +0 -101
- data/conformance/server.rb +0 -547
- data/dev.yml +0 -30
- data/docs/_config.yml +0 -6
- data/docs/index.md +0 -7
- data/docs/latest/index.html +0 -19
- data/examples/README.md +0 -197
- data/examples/http_client.rb +0 -184
- data/examples/http_server.rb +0 -169
- data/examples/stdio_server.rb +0 -94
- data/examples/streamable_http_client.rb +0 -207
- data/examples/streamable_http_server.rb +0 -172
- data/mcp.gemspec +0 -35
data/lib/mcp/transport.rb
CHANGED
|
@@ -36,8 +36,8 @@ module MCP
|
|
|
36
36
|
send_response(response) if response
|
|
37
37
|
end
|
|
38
38
|
|
|
39
|
-
# Send a notification to the client
|
|
40
|
-
# Returns true if the notification was sent successfully
|
|
39
|
+
# Send a notification to the client.
|
|
40
|
+
# Returns true if the notification was sent successfully.
|
|
41
41
|
def send_notification(method, params = nil)
|
|
42
42
|
raise NotImplementedError, "Subclasses must implement send_notification"
|
|
43
43
|
end
|
data/lib/mcp/version.rb
CHANGED
data/lib/mcp.rb
CHANGED
|
@@ -1,36 +1,23 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require_relative "json_rpc_handler"
|
|
4
|
-
require_relative "mcp/annotations"
|
|
5
4
|
require_relative "mcp/configuration"
|
|
6
|
-
require_relative "mcp/content"
|
|
7
|
-
require_relative "mcp/icon"
|
|
8
|
-
require_relative "mcp/instrumentation"
|
|
9
|
-
require_relative "mcp/methods"
|
|
10
|
-
require_relative "mcp/prompt"
|
|
11
|
-
require_relative "mcp/prompt/argument"
|
|
12
|
-
require_relative "mcp/prompt/message"
|
|
13
|
-
require_relative "mcp/prompt/result"
|
|
14
|
-
require_relative "mcp/resource"
|
|
15
|
-
require_relative "mcp/resource/contents"
|
|
16
|
-
require_relative "mcp/resource/embedded"
|
|
17
|
-
require_relative "mcp/resource_template"
|
|
18
|
-
require_relative "mcp/server"
|
|
19
|
-
require_relative "mcp/server/transports/streamable_http_transport"
|
|
20
|
-
require_relative "mcp/server/transports/stdio_transport"
|
|
21
5
|
require_relative "mcp/string_utils"
|
|
22
|
-
require_relative "mcp/tool"
|
|
23
|
-
require_relative "mcp/tool/input_schema"
|
|
24
|
-
require_relative "mcp/tool/output_schema"
|
|
25
|
-
require_relative "mcp/tool/response"
|
|
26
|
-
require_relative "mcp/tool/annotations"
|
|
27
6
|
require_relative "mcp/transport"
|
|
28
7
|
require_relative "mcp/version"
|
|
29
|
-
require_relative "mcp/client"
|
|
30
|
-
require_relative "mcp/client/http"
|
|
31
|
-
require_relative "mcp/client/tool"
|
|
32
8
|
|
|
33
9
|
module MCP
|
|
10
|
+
autoload :Annotations, "mcp/annotations"
|
|
11
|
+
autoload :Client, "mcp/client"
|
|
12
|
+
autoload :Content, "mcp/content"
|
|
13
|
+
autoload :Icon, "mcp/icon"
|
|
14
|
+
autoload :Prompt, "mcp/prompt"
|
|
15
|
+
autoload :Resource, "mcp/resource"
|
|
16
|
+
autoload :ResourceTemplate, "mcp/resource_template"
|
|
17
|
+
autoload :Server, "mcp/server"
|
|
18
|
+
autoload :ServerSession, "mcp/server_session"
|
|
19
|
+
autoload :Tool, "mcp/tool"
|
|
20
|
+
|
|
34
21
|
class << self
|
|
35
22
|
def configure
|
|
36
23
|
yield(configuration)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mcp
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.10.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Model Context Protocol
|
|
@@ -30,45 +30,14 @@ executables: []
|
|
|
30
30
|
extensions: []
|
|
31
31
|
extra_rdoc_files: []
|
|
32
32
|
files:
|
|
33
|
-
- ".gitattributes"
|
|
34
|
-
- ".github/dependabot.yml"
|
|
35
|
-
- ".github/workflows/ci.yml"
|
|
36
|
-
- ".github/workflows/conformance.yml"
|
|
37
|
-
- ".github/workflows/release.yml"
|
|
38
|
-
- ".gitignore"
|
|
39
|
-
- ".rubocop.yml"
|
|
40
|
-
- AGENTS.md
|
|
41
|
-
- CHANGELOG.md
|
|
42
|
-
- CODE_OF_CONDUCT.md
|
|
43
|
-
- Gemfile
|
|
44
33
|
- LICENSE
|
|
45
34
|
- README.md
|
|
46
|
-
- RELEASE.md
|
|
47
|
-
- Rakefile
|
|
48
|
-
- SECURITY.md
|
|
49
|
-
- bin/console
|
|
50
|
-
- bin/generate-gh-pages.sh
|
|
51
|
-
- bin/rake
|
|
52
|
-
- bin/setup
|
|
53
|
-
- conformance/README.md
|
|
54
|
-
- conformance/expected_failures.yml
|
|
55
|
-
- conformance/runner.rb
|
|
56
|
-
- conformance/server.rb
|
|
57
|
-
- dev.yml
|
|
58
|
-
- docs/_config.yml
|
|
59
|
-
- docs/index.md
|
|
60
|
-
- docs/latest/index.html
|
|
61
|
-
- examples/README.md
|
|
62
|
-
- examples/http_client.rb
|
|
63
|
-
- examples/http_server.rb
|
|
64
|
-
- examples/stdio_server.rb
|
|
65
|
-
- examples/streamable_http_client.rb
|
|
66
|
-
- examples/streamable_http_server.rb
|
|
67
35
|
- lib/json_rpc_handler.rb
|
|
68
36
|
- lib/mcp.rb
|
|
69
37
|
- lib/mcp/annotations.rb
|
|
70
38
|
- lib/mcp/client.rb
|
|
71
39
|
- lib/mcp/client/http.rb
|
|
40
|
+
- lib/mcp/client/stdio.rb
|
|
72
41
|
- lib/mcp/client/tool.rb
|
|
73
42
|
- lib/mcp/configuration.rb
|
|
74
43
|
- lib/mcp/content.rb
|
|
@@ -76,6 +45,7 @@ files:
|
|
|
76
45
|
- lib/mcp/instrumentation.rb
|
|
77
46
|
- lib/mcp/logging_message_notification.rb
|
|
78
47
|
- lib/mcp/methods.rb
|
|
48
|
+
- lib/mcp/progress.rb
|
|
79
49
|
- lib/mcp/prompt.rb
|
|
80
50
|
- lib/mcp/prompt/argument.rb
|
|
81
51
|
- lib/mcp/prompt/message.rb
|
|
@@ -86,8 +56,11 @@ files:
|
|
|
86
56
|
- lib/mcp/resource_template.rb
|
|
87
57
|
- lib/mcp/server.rb
|
|
88
58
|
- lib/mcp/server/capabilities.rb
|
|
59
|
+
- lib/mcp/server/transports.rb
|
|
89
60
|
- lib/mcp/server/transports/stdio_transport.rb
|
|
90
61
|
- lib/mcp/server/transports/streamable_http_transport.rb
|
|
62
|
+
- lib/mcp/server_context.rb
|
|
63
|
+
- lib/mcp/server_session.rb
|
|
91
64
|
- lib/mcp/string_utils.rb
|
|
92
65
|
- lib/mcp/tool.rb
|
|
93
66
|
- lib/mcp/tool/annotations.rb
|
|
@@ -98,13 +71,12 @@ files:
|
|
|
98
71
|
- lib/mcp/transport.rb
|
|
99
72
|
- lib/mcp/transports/stdio.rb
|
|
100
73
|
- lib/mcp/version.rb
|
|
101
|
-
- mcp.gemspec
|
|
102
74
|
homepage: https://github.com/modelcontextprotocol/ruby-sdk
|
|
103
75
|
licenses:
|
|
104
76
|
- Apache-2.0
|
|
105
77
|
metadata:
|
|
106
78
|
allowed_push_host: https://rubygems.org
|
|
107
|
-
changelog_uri: https://github.com/modelcontextprotocol/ruby-sdk/releases/tag/v0.
|
|
79
|
+
changelog_uri: https://github.com/modelcontextprotocol/ruby-sdk/releases/tag/v0.10.0
|
|
108
80
|
homepage_uri: https://github.com/modelcontextprotocol/ruby-sdk
|
|
109
81
|
source_code_uri: https://github.com/modelcontextprotocol/ruby-sdk
|
|
110
82
|
bug_tracker_uri: https://github.com/modelcontextprotocol/ruby-sdk/issues
|
|
@@ -123,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
123
95
|
- !ruby/object:Gem::Version
|
|
124
96
|
version: '0'
|
|
125
97
|
requirements: []
|
|
126
|
-
rubygems_version: 4.0.
|
|
98
|
+
rubygems_version: 4.0.6
|
|
127
99
|
specification_version: 4
|
|
128
100
|
summary: The official Ruby SDK for Model Context Protocol servers and clients
|
|
129
101
|
test_files: []
|
data/.gitattributes
DELETED
data/.github/dependabot.yml
DELETED
data/.github/workflows/ci.yml
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
name: CI
|
|
2
|
-
on: [push, pull_request]
|
|
3
|
-
|
|
4
|
-
jobs:
|
|
5
|
-
test:
|
|
6
|
-
runs-on: ubuntu-latest
|
|
7
|
-
permissions:
|
|
8
|
-
contents: read
|
|
9
|
-
strategy:
|
|
10
|
-
matrix:
|
|
11
|
-
entry:
|
|
12
|
-
- { ruby: '2.7', allowed-failure: false }
|
|
13
|
-
- { ruby: '3.0', allowed-failure: false }
|
|
14
|
-
- { ruby: '3.1', allowed-failure: false }
|
|
15
|
-
- { ruby: '3.2', allowed-failure: false }
|
|
16
|
-
- { ruby: '3.3', allowed-failure: false }
|
|
17
|
-
- { ruby: '3.4', allowed-failure: false }
|
|
18
|
-
- { ruby: '4.0', allowed-failure: false }
|
|
19
|
-
- { ruby: 'head', allowed-failure: true }
|
|
20
|
-
name: Test Ruby ${{ matrix.entry.ruby }}
|
|
21
|
-
steps:
|
|
22
|
-
- uses: actions/checkout@v6
|
|
23
|
-
- uses: ruby/setup-ruby@v1
|
|
24
|
-
with:
|
|
25
|
-
ruby-version: ${{ matrix.entry.ruby }}
|
|
26
|
-
bundler-cache: true
|
|
27
|
-
- run: bundle exec rake test
|
|
28
|
-
continue-on-error: ${{ matrix.entry.allowed-failure }}
|
|
29
|
-
|
|
30
|
-
rubocop:
|
|
31
|
-
runs-on: ubuntu-latest
|
|
32
|
-
permissions:
|
|
33
|
-
contents: read
|
|
34
|
-
name: RuboCop
|
|
35
|
-
steps:
|
|
36
|
-
- uses: actions/checkout@v6
|
|
37
|
-
- uses: ruby/setup-ruby@v1
|
|
38
|
-
with:
|
|
39
|
-
ruby-version: 4.0 # Specify the latest supported Ruby version.
|
|
40
|
-
bundler-cache: true
|
|
41
|
-
- run: bundle exec rake rubocop
|
|
42
|
-
|
|
43
|
-
yard:
|
|
44
|
-
runs-on: ubuntu-latest
|
|
45
|
-
permissions:
|
|
46
|
-
contents: read
|
|
47
|
-
name: YARD Documentation
|
|
48
|
-
steps:
|
|
49
|
-
- uses: actions/checkout@v6
|
|
50
|
-
- uses: ruby/setup-ruby@v1
|
|
51
|
-
with:
|
|
52
|
-
ruby-version: 4.0 # Specify the latest supported Ruby version.
|
|
53
|
-
bundler-cache: true
|
|
54
|
-
- run: bundle exec yard --no-output
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
name: Conformance Tests
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: [main]
|
|
6
|
-
pull_request:
|
|
7
|
-
workflow_dispatch:
|
|
8
|
-
|
|
9
|
-
concurrency:
|
|
10
|
-
group: conformance-${{ github.ref }}
|
|
11
|
-
cancel-in-progress: true
|
|
12
|
-
|
|
13
|
-
permissions:
|
|
14
|
-
contents: read
|
|
15
|
-
|
|
16
|
-
jobs:
|
|
17
|
-
server-conformance:
|
|
18
|
-
runs-on: ubuntu-latest
|
|
19
|
-
continue-on-error: true
|
|
20
|
-
steps:
|
|
21
|
-
- uses: actions/checkout@v6
|
|
22
|
-
- uses: ruby/setup-ruby@v1
|
|
23
|
-
with:
|
|
24
|
-
ruby-version: '4.0' # Specify the latest supported Ruby version.
|
|
25
|
-
bundler-cache: true
|
|
26
|
-
- uses: actions/setup-node@v4
|
|
27
|
-
with:
|
|
28
|
-
node-version: '24' # Specify the latest Node.js version.
|
|
29
|
-
- run: bundle exec rake conformance
|
|
@@ -1,57 +0,0 @@
|
|
|
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@v6
|
|
20
|
-
- name: Set up Ruby
|
|
21
|
-
uses: ruby/setup-ruby@v1
|
|
22
|
-
with:
|
|
23
|
-
bundler-cache: true
|
|
24
|
-
ruby-version: 4.0
|
|
25
|
-
- uses: rubygems/release-gem@v1
|
|
26
|
-
|
|
27
|
-
publish_gh_pages:
|
|
28
|
-
if: github.repository_owner == 'modelcontextprotocol'
|
|
29
|
-
name: Publish Documentation to GitHub Pages
|
|
30
|
-
runs-on: ubuntu-latest
|
|
31
|
-
needs: [publish_gem]
|
|
32
|
-
|
|
33
|
-
permissions:
|
|
34
|
-
contents: write
|
|
35
|
-
|
|
36
|
-
steps:
|
|
37
|
-
- uses: actions/checkout@v6
|
|
38
|
-
with:
|
|
39
|
-
fetch-depth: 0 # Fetch all history for all branches and tags
|
|
40
|
-
|
|
41
|
-
- name: Configure Git
|
|
42
|
-
run: |
|
|
43
|
-
git config --global user.name "github-actions[bot]"
|
|
44
|
-
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
|
45
|
-
|
|
46
|
-
- name: Get version tag
|
|
47
|
-
id: version
|
|
48
|
-
run: |
|
|
49
|
-
git fetch --tags
|
|
50
|
-
TAG=$(git describe --tags --exact-match HEAD)
|
|
51
|
-
echo "tag=${TAG}" >> $GITHUB_OUTPUT
|
|
52
|
-
|
|
53
|
-
- name: Generate GitHub Pages
|
|
54
|
-
run: ./bin/generate-gh-pages.sh ${{ steps.version.outputs.tag }}
|
|
55
|
-
|
|
56
|
-
- name: Push to gh-pages
|
|
57
|
-
run: git push origin gh-pages
|
data/.gitignore
DELETED
data/.rubocop.yml
DELETED
data/AGENTS.md
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
# AGENTS.md
|
|
2
|
-
|
|
3
|
-
## Project overview
|
|
4
|
-
|
|
5
|
-
This is the official Ruby SDK for the Model Context Protocol (MCP), implementing both server and client functionality for JSON-RPC 2.0 based communication between LLM applications and context providers.
|
|
6
|
-
|
|
7
|
-
## Dev environment setup
|
|
8
|
-
|
|
9
|
-
- Ruby 3.2.0+ required to run the full test suite, including all Sorbet-related features
|
|
10
|
-
- Run `bundle install` to install dependencies
|
|
11
|
-
- Dependencies: `json-schema` >= 4.1 - Schema validation
|
|
12
|
-
|
|
13
|
-
## Build and test commands
|
|
14
|
-
|
|
15
|
-
- `bundle install` - Install dependencies
|
|
16
|
-
- `rake test` - Run all tests
|
|
17
|
-
- `rake rubocop` - Run linter
|
|
18
|
-
- `rake` - Run tests and linting (default task)
|
|
19
|
-
- `ruby -I lib -I test test/path/to/specific_test.rb` - Run single test file
|
|
20
|
-
- `gem build mcp.gemspec` - Build the gem
|
|
21
|
-
|
|
22
|
-
## Testing instructions
|
|
23
|
-
|
|
24
|
-
- Test files are in `test/` directory with `_test.rb` suffix
|
|
25
|
-
- Run full test suite with `rake test`
|
|
26
|
-
- Run individual tests with `ruby -I lib -I test test/path/to/file_test.rb`
|
|
27
|
-
- Tests should pass before submitting PRs
|
|
28
|
-
|
|
29
|
-
## Code style guidelines
|
|
30
|
-
|
|
31
|
-
- Follow RuboCop rules (run `rake rubocop`)
|
|
32
|
-
- Use frozen string literals
|
|
33
|
-
- Follow Ruby community conventions
|
|
34
|
-
- Keep dependencies minimal
|
|
35
|
-
|
|
36
|
-
## Commit message conventions
|
|
37
|
-
|
|
38
|
-
- Use conventional commit format when possible
|
|
39
|
-
- Include clear, descriptive commit messages
|
|
40
|
-
- Releases are triggered by updating version in `lib/mcp/version.rb` and merging to main
|
|
41
|
-
|
|
42
|
-
## Release process
|
|
43
|
-
|
|
44
|
-
- Follow [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) format in CHANGELOG.md
|
|
45
|
-
- Update CHANGELOG.md before cutting releases
|
|
46
|
-
- Use git history and PR merge commits to construct changelog entries
|
|
47
|
-
- Format entries as: "Terse description of the change (#nnn)"
|
|
48
|
-
- Keep entries in flat list format (no nesting)
|
|
49
|
-
- Git tags mark commits that cut new releases
|
|
50
|
-
- Exclude maintenance PRs that don't concern end users
|
|
51
|
-
- Check upstream remote for PRs if available
|
|
52
|
-
|
|
53
|
-
## Architecture overview
|
|
54
|
-
|
|
55
|
-
### Core Components
|
|
56
|
-
|
|
57
|
-
**MCP::Server** (`lib/mcp/server.rb`):
|
|
58
|
-
|
|
59
|
-
- Main server class handling JSON-RPC requests
|
|
60
|
-
- Implements MCP protocol methods: initialize, ping, tools/list, tools/call, prompts/list, prompts/get, resources/list, resources/read
|
|
61
|
-
- Supports custom method registration via `define_custom_method`
|
|
62
|
-
- Handles instrumentation, exception reporting, and notifications
|
|
63
|
-
- Uses JsonRpcHandler for request processing
|
|
64
|
-
|
|
65
|
-
**MCP::Client** (`lib/mcp/client.rb`):
|
|
66
|
-
|
|
67
|
-
- Client interface for communicating with MCP servers
|
|
68
|
-
- Transport-agnostic design with pluggable transport layers
|
|
69
|
-
- Supports tool listing and invocation
|
|
70
|
-
|
|
71
|
-
**Transport Layer**:
|
|
72
|
-
|
|
73
|
-
- `MCP::Server::Transports::StdioTransport` - Command-line stdio transport
|
|
74
|
-
- `MCP::Server::Transports::StreamableHttpTransport` - HTTP with streaming support
|
|
75
|
-
- `MCP::Client::HTTP` - HTTP client transport (requires faraday gem)
|
|
76
|
-
|
|
77
|
-
**Protocol Components**:
|
|
78
|
-
|
|
79
|
-
- `MCP::Tool` - Tool definition with input/output schemas and annotations
|
|
80
|
-
- `MCP::Prompt` - Prompt templates with argument validation
|
|
81
|
-
- `MCP::Resource` - Resource registration and retrieval
|
|
82
|
-
- `MCP::Configuration` - Global configuration with exception reporting and instrumentation
|
|
83
|
-
|
|
84
|
-
### Key Patterns
|
|
85
|
-
|
|
86
|
-
**Three Ways to Define Components**:
|
|
87
|
-
|
|
88
|
-
1. Class inheritance (e.g., `class MyTool < MCP::Tool`)
|
|
89
|
-
2. Define methods (e.g., `MCP::Tool.define(name: "my_tool") { ... }`)
|
|
90
|
-
3. Server registration (e.g., `server.define_tool(name: "my_tool") { ... }`)
|
|
91
|
-
|
|
92
|
-
**Schema Validation**:
|
|
93
|
-
|
|
94
|
-
- Tools support input_schema and output_schema for JSON Schema validation
|
|
95
|
-
- Protocol version 2025-03-26+ supports tool annotations (destructive_hint, idempotent_hint, etc.)
|
|
96
|
-
- Validation is configurable via `configuration.validate_tool_call_arguments`
|
|
97
|
-
|
|
98
|
-
**Context Passing**:
|
|
99
|
-
|
|
100
|
-
- `server_context` hash passed through tool/prompt calls for request-specific data
|
|
101
|
-
- Methods can accept `server_context:` keyword argument for accessing context
|
|
102
|
-
|
|
103
|
-
### Integration patterns
|
|
104
|
-
|
|
105
|
-
- **Rails controllers**: Use `server.handle_json(request.body.read)` for HTTP endpoints
|
|
106
|
-
- **Command-line tools**: Use `StdioTransport.new(server).open` for CLI applications
|
|
107
|
-
- **HTTP services**: Use `StreamableHttpTransport` for web-based servers
|
data/CHANGELOG.md
DELETED
|
@@ -1,168 +0,0 @@
|
|
|
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.8.0] - 2026-03-03
|
|
11
|
-
|
|
12
|
-
### Added
|
|
13
|
-
|
|
14
|
-
- `Content::EmbeddedResource` class for embedded resource content type (#244)
|
|
15
|
-
- `Content::Audio` class for audio content type (#243)
|
|
16
|
-
- `$ref` support in `Tool::Schema` for protocol version 2025-11-25 (#242)
|
|
17
|
-
- MCP conformance test suite (#248)
|
|
18
|
-
|
|
19
|
-
### Fixed
|
|
20
|
-
|
|
21
|
-
- Handle `Errno::ECONNRESET` in SSE stream operations (#249)
|
|
22
|
-
- Fix default handler return values to comply with MCP spec (#247)
|
|
23
|
-
- Fix `Prompt#validate_arguments!` crash when arguments are `nil` (#246)
|
|
24
|
-
- Return 202 Accepted for SSE responses per MCP spec (#245)
|
|
25
|
-
- Fix `Content::Image#to_h` to return `mimeType` (camelCase) per MCP spec (#241)
|
|
26
|
-
|
|
27
|
-
## [0.7.1] - 2026-02-21
|
|
28
|
-
|
|
29
|
-
### Fixed
|
|
30
|
-
|
|
31
|
-
- Fix `Resource::Contents#to_h` to use correct property names per MCP spec (#235)
|
|
32
|
-
- Return JSON-RPC protocol errors for unknown tool calls (#231)
|
|
33
|
-
- Fix `logging/setLevel` to return empty hash per MCP specification (#230)
|
|
34
|
-
|
|
35
|
-
## [0.7.0] - 2026-02-14
|
|
36
|
-
|
|
37
|
-
### Added
|
|
38
|
-
|
|
39
|
-
- `logging` support (#103)
|
|
40
|
-
- Protocol version negotiation to server initialization (#223)
|
|
41
|
-
- Tool arguments to instrumentation data (#218)
|
|
42
|
-
- Client info to instrumentation callback (#221)
|
|
43
|
-
- `resource_templates` to `MCP::Client` (#225)
|
|
44
|
-
|
|
45
|
-
### Changed
|
|
46
|
-
|
|
47
|
-
- Extract `MCP::Annotations` into a dedicated file (#224)
|
|
48
|
-
|
|
49
|
-
### Fixed
|
|
50
|
-
|
|
51
|
-
- `Resource::Embedded` not setting `@resource` in `initialize` (#220)
|
|
52
|
-
|
|
53
|
-
## [0.6.0] - 2026-01-16
|
|
54
|
-
|
|
55
|
-
### Changed
|
|
56
|
-
|
|
57
|
-
- Update licensing to Apache 2.0 for new contributions (#213)
|
|
58
|
-
|
|
59
|
-
### Fixed
|
|
60
|
-
|
|
61
|
-
- Omit `icons` from responses when empty or nil to reduce context window usage (#212)
|
|
62
|
-
|
|
63
|
-
## [0.5.0] - 2026-01-11
|
|
64
|
-
|
|
65
|
-
### Added
|
|
66
|
-
|
|
67
|
-
- Protocol specification version "2025-11-25" support (#184)
|
|
68
|
-
- `icons` parameter support (#205)
|
|
69
|
-
- `websiteUrl` parameter in `serverInfo` (#188)
|
|
70
|
-
- `description` parameter in `serverInfo` (#201)
|
|
71
|
-
- `additionalProperties` support for schema validation (#198)
|
|
72
|
-
- "Draft" protocol version to supported versions (#179)
|
|
73
|
-
- `stateless` mode for high availability (#101)
|
|
74
|
-
- Exception messages for tool call errors (#194)
|
|
75
|
-
- Elicitation skeleton (#178)
|
|
76
|
-
- `prompts/list` and `prompts/get` support to client (#163)
|
|
77
|
-
- Accept header validation for HTTP client transport (#207)
|
|
78
|
-
- Ruby 2.7 - Ruby 3.1 support (#206)
|
|
79
|
-
|
|
80
|
-
### Changed
|
|
81
|
-
|
|
82
|
-
- Make tool names stricter (#204)
|
|
83
|
-
|
|
84
|
-
### Fixed
|
|
85
|
-
|
|
86
|
-
- Symlink path comparison in schema validation (#193)
|
|
87
|
-
- Duplicate tool names across namespaces now raise an error (#199)
|
|
88
|
-
- Tool error handling to follow MCP spec (#165)
|
|
89
|
-
- XSS vulnerability in json_rpc_handler (#175)
|
|
90
|
-
|
|
91
|
-
## [0.4.0] - 2025-10-15
|
|
92
|
-
|
|
93
|
-
### Added
|
|
94
|
-
|
|
95
|
-
- Client resources support with `resources/list` and `resources/read` methods (#160)
|
|
96
|
-
- `_meta` field support for Tool schema (#124)
|
|
97
|
-
- `_meta` field support for Prompt
|
|
98
|
-
- `title` field support for prompt arguments
|
|
99
|
-
- `call_tool_raw` method to client for accessing full tool responses (#149)
|
|
100
|
-
- Structured content support in tool responses (#147)
|
|
101
|
-
- AGENTS.md development guidance documentation (#134)
|
|
102
|
-
- Dependabot configuration for automated dependency updates (#138)
|
|
103
|
-
|
|
104
|
-
### Changed
|
|
105
|
-
|
|
106
|
-
- Set default `content` to empty array instead of `nil` (#150)
|
|
107
|
-
- Improved prompt spec compliance (#153)
|
|
108
|
-
- Allow output schema to be array of objects (#144)
|
|
109
|
-
- Return 202 response code for accepted JSON-RPC notifications (#114)
|
|
110
|
-
- Added validation to `MCP::Configuration` setters (#145)
|
|
111
|
-
- Updated metaschema URI format for cross-OS compatibility
|
|
112
|
-
|
|
113
|
-
### Fixed
|
|
114
|
-
|
|
115
|
-
- Client tools functionality and test coverage (#166)
|
|
116
|
-
- Client resources test for empty responses (#162)
|
|
117
|
-
- Documentation typos and incorrect examples (#157, #146)
|
|
118
|
-
- Removed redundant transport requires (#154)
|
|
119
|
-
- Cleaned up unused block parameters and magic comments
|
|
120
|
-
|
|
121
|
-
## [0.3.0] - 2025-09-14
|
|
122
|
-
|
|
123
|
-
### Added
|
|
124
|
-
|
|
125
|
-
- Tool output schema support with comprehensive validation (#122)
|
|
126
|
-
- HTTP client transport layer for MCP clients (#28)
|
|
127
|
-
- Tool annotations validation for protocol compatibility (#122)
|
|
128
|
-
- Server instructions support (#87)
|
|
129
|
-
- Title support in server info (#119)
|
|
130
|
-
- Default values for tool annotation hints (#118)
|
|
131
|
-
- Notifications/initialized method implementation (#84)
|
|
132
|
-
|
|
133
|
-
### Changed
|
|
134
|
-
|
|
135
|
-
- Make default protocol version the latest specification version (#83)
|
|
136
|
-
- Protocol version validation to ensure valid values (#80)
|
|
137
|
-
- Improved tool handling for tools with no arguments (#85, #86)
|
|
138
|
-
- Better error handling and response API (#109)
|
|
139
|
-
|
|
140
|
-
### Fixed
|
|
141
|
-
|
|
142
|
-
- JSON-RPC notification format in Streamable HTTP transport (#91)
|
|
143
|
-
- Errors when title is not specified (#126)
|
|
144
|
-
- Tools with missing arguments handling (#86)
|
|
145
|
-
- Namespacing issues in README examples (#89)
|
|
146
|
-
|
|
147
|
-
## [0.2.0] - 2025-07-15
|
|
148
|
-
|
|
149
|
-
### Added
|
|
150
|
-
|
|
151
|
-
- Custom methods support via `define_custom_method` (#75)
|
|
152
|
-
- Streamable HTTP transport implementation (#33)
|
|
153
|
-
- Tool argument validation against schemas (#43)
|
|
154
|
-
|
|
155
|
-
### Changed
|
|
156
|
-
|
|
157
|
-
- Server context is now optional for Tools and Prompts (#54)
|
|
158
|
-
- Improved capability handling and removed automatic capability determination (#61, #63)
|
|
159
|
-
- Refactored architecture in preparation for client support (#27)
|
|
160
|
-
|
|
161
|
-
### Fixed
|
|
162
|
-
|
|
163
|
-
- Input schema validation for schemas without required fields (#73)
|
|
164
|
-
- Error handling when sending notifications (#70)
|
|
165
|
-
|
|
166
|
-
## [0.1.0] - 2025-05-30
|
|
167
|
-
|
|
168
|
-
Initial release in collaboration with Shopify
|