mcp 0.7.1 → 0.9.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 +180 -5
- data/lib/mcp/client/stdio.rb +222 -0
- data/lib/mcp/client.rb +12 -2
- data/lib/mcp/content.rb +28 -1
- data/lib/mcp/progress.rb +21 -0
- data/lib/mcp/prompt.rb +8 -3
- data/lib/mcp/resource.rb +3 -0
- data/lib/mcp/server/transports/stdio_transport.rb +1 -1
- data/lib/mcp/server/transports/streamable_http_transport.rb +13 -24
- data/lib/mcp/server/transports.rb +10 -0
- data/lib/mcp/server.rb +62 -7
- data/lib/mcp/server_context.rb +26 -0
- data/lib/mcp/tool/schema.rb +0 -4
- data/lib/mcp/tool.rb +5 -0
- data/lib/mcp/version.rb +1 -1
- data/lib/mcp.rb +10 -24
- metadata +7 -31
- data/.gitattributes +0 -4
- data/.github/dependabot.yml +0 -6
- data/.github/workflows/ci.yml +0 -54
- data/.github/workflows/release.yml +0 -57
- data/.gitignore +0 -10
- data/.rubocop.yml +0 -15
- data/AGENTS.md +0 -107
- data/CHANGELOG.md +0 -151
- data/CODE_OF_CONDUCT.md +0 -74
- data/Gemfile +0 -29
- data/RELEASE.md +0 -12
- data/Rakefile +0 -17
- 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/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/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,151 +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.7.1] - 2026-02-21
|
|
11
|
-
|
|
12
|
-
### Fixed
|
|
13
|
-
|
|
14
|
-
- Fix `Resource::Contents#to_h` to use correct property names per MCP spec (#235)
|
|
15
|
-
- Return JSON-RPC protocol errors for unknown tool calls (#231)
|
|
16
|
-
- Fix `logging/setLevel` to return empty hash per MCP specification (#230)
|
|
17
|
-
|
|
18
|
-
## [0.7.0] - 2026-02-14
|
|
19
|
-
|
|
20
|
-
### Added
|
|
21
|
-
|
|
22
|
-
- `logging` support (#103)
|
|
23
|
-
- Protocol version negotiation to server initialization (#223)
|
|
24
|
-
- Tool arguments to instrumentation data (#218)
|
|
25
|
-
- Client info to instrumentation callback (#221)
|
|
26
|
-
- `resource_templates` to `MCP::Client` (#225)
|
|
27
|
-
|
|
28
|
-
### Changed
|
|
29
|
-
|
|
30
|
-
- Extract `MCP::Annotations` into a dedicated file (#224)
|
|
31
|
-
|
|
32
|
-
### Fixed
|
|
33
|
-
|
|
34
|
-
- `Resource::Embedded` not setting `@resource` in `initialize` (#220)
|
|
35
|
-
|
|
36
|
-
## [0.6.0] - 2026-01-16
|
|
37
|
-
|
|
38
|
-
### Changed
|
|
39
|
-
|
|
40
|
-
- Update licensing to Apache 2.0 for new contributions (#213)
|
|
41
|
-
|
|
42
|
-
### Fixed
|
|
43
|
-
|
|
44
|
-
- Omit `icons` from responses when empty or nil to reduce context window usage (#212)
|
|
45
|
-
|
|
46
|
-
## [0.5.0] - 2026-01-11
|
|
47
|
-
|
|
48
|
-
### Added
|
|
49
|
-
|
|
50
|
-
- Protocol specification version "2025-11-25" support (#184)
|
|
51
|
-
- `icons` parameter support (#205)
|
|
52
|
-
- `websiteUrl` parameter in `serverInfo` (#188)
|
|
53
|
-
- `description` parameter in `serverInfo` (#201)
|
|
54
|
-
- `additionalProperties` support for schema validation (#198)
|
|
55
|
-
- "Draft" protocol version to supported versions (#179)
|
|
56
|
-
- `stateless` mode for high availability (#101)
|
|
57
|
-
- Exception messages for tool call errors (#194)
|
|
58
|
-
- Elicitation skeleton (#178)
|
|
59
|
-
- `prompts/list` and `prompts/get` support to client (#163)
|
|
60
|
-
- Accept header validation for HTTP client transport (#207)
|
|
61
|
-
- Ruby 2.7 - Ruby 3.1 support (#206)
|
|
62
|
-
|
|
63
|
-
### Changed
|
|
64
|
-
|
|
65
|
-
- Make tool names stricter (#204)
|
|
66
|
-
|
|
67
|
-
### Fixed
|
|
68
|
-
|
|
69
|
-
- Symlink path comparison in schema validation (#193)
|
|
70
|
-
- Duplicate tool names across namespaces now raise an error (#199)
|
|
71
|
-
- Tool error handling to follow MCP spec (#165)
|
|
72
|
-
- XSS vulnerability in json_rpc_handler (#175)
|
|
73
|
-
|
|
74
|
-
## [0.4.0] - 2025-10-15
|
|
75
|
-
|
|
76
|
-
### Added
|
|
77
|
-
|
|
78
|
-
- Client resources support with `resources/list` and `resources/read` methods (#160)
|
|
79
|
-
- `_meta` field support for Tool schema (#124)
|
|
80
|
-
- `_meta` field support for Prompt
|
|
81
|
-
- `title` field support for prompt arguments
|
|
82
|
-
- `call_tool_raw` method to client for accessing full tool responses (#149)
|
|
83
|
-
- Structured content support in tool responses (#147)
|
|
84
|
-
- AGENTS.md development guidance documentation (#134)
|
|
85
|
-
- Dependabot configuration for automated dependency updates (#138)
|
|
86
|
-
|
|
87
|
-
### Changed
|
|
88
|
-
|
|
89
|
-
- Set default `content` to empty array instead of `nil` (#150)
|
|
90
|
-
- Improved prompt spec compliance (#153)
|
|
91
|
-
- Allow output schema to be array of objects (#144)
|
|
92
|
-
- Return 202 response code for accepted JSON-RPC notifications (#114)
|
|
93
|
-
- Added validation to `MCP::Configuration` setters (#145)
|
|
94
|
-
- Updated metaschema URI format for cross-OS compatibility
|
|
95
|
-
|
|
96
|
-
### Fixed
|
|
97
|
-
|
|
98
|
-
- Client tools functionality and test coverage (#166)
|
|
99
|
-
- Client resources test for empty responses (#162)
|
|
100
|
-
- Documentation typos and incorrect examples (#157, #146)
|
|
101
|
-
- Removed redundant transport requires (#154)
|
|
102
|
-
- Cleaned up unused block parameters and magic comments
|
|
103
|
-
|
|
104
|
-
## [0.3.0] - 2025-09-14
|
|
105
|
-
|
|
106
|
-
### Added
|
|
107
|
-
|
|
108
|
-
- Tool output schema support with comprehensive validation (#122)
|
|
109
|
-
- HTTP client transport layer for MCP clients (#28)
|
|
110
|
-
- Tool annotations validation for protocol compatibility (#122)
|
|
111
|
-
- Server instructions support (#87)
|
|
112
|
-
- Title support in server info (#119)
|
|
113
|
-
- Default values for tool annotation hints (#118)
|
|
114
|
-
- Notifications/initialized method implementation (#84)
|
|
115
|
-
|
|
116
|
-
### Changed
|
|
117
|
-
|
|
118
|
-
- Make default protocol version the latest specification version (#83)
|
|
119
|
-
- Protocol version validation to ensure valid values (#80)
|
|
120
|
-
- Improved tool handling for tools with no arguments (#85, #86)
|
|
121
|
-
- Better error handling and response API (#109)
|
|
122
|
-
|
|
123
|
-
### Fixed
|
|
124
|
-
|
|
125
|
-
- JSON-RPC notification format in Streamable HTTP transport (#91)
|
|
126
|
-
- Errors when title is not specified (#126)
|
|
127
|
-
- Tools with missing arguments handling (#86)
|
|
128
|
-
- Namespacing issues in README examples (#89)
|
|
129
|
-
|
|
130
|
-
## [0.2.0] - 2025-07-15
|
|
131
|
-
|
|
132
|
-
### Added
|
|
133
|
-
|
|
134
|
-
- Custom methods support via `define_custom_method` (#75)
|
|
135
|
-
- Streamable HTTP transport implementation (#33)
|
|
136
|
-
- Tool argument validation against schemas (#43)
|
|
137
|
-
|
|
138
|
-
### Changed
|
|
139
|
-
|
|
140
|
-
- Server context is now optional for Tools and Prompts (#54)
|
|
141
|
-
- Improved capability handling and removed automatic capability determination (#61, #63)
|
|
142
|
-
- Refactored architecture in preparation for client support (#27)
|
|
143
|
-
|
|
144
|
-
### Fixed
|
|
145
|
-
|
|
146
|
-
- Input schema validation for schemas without required fields (#73)
|
|
147
|
-
- Error handling when sending notifications (#70)
|
|
148
|
-
|
|
149
|
-
## [0.1.0] - 2025-05-30
|
|
150
|
-
|
|
151
|
-
Initial release in collaboration with Shopify
|
data/CODE_OF_CONDUCT.md
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
# Contributor Covenant Code of Conduct
|
|
2
|
-
|
|
3
|
-
## Our Pledge
|
|
4
|
-
|
|
5
|
-
In the interest of fostering an open and welcoming environment, we as
|
|
6
|
-
contributors and maintainers pledge to making participation in our project and
|
|
7
|
-
our community a harassment-free experience for everyone, regardless of age, body
|
|
8
|
-
size, disability, ethnicity, gender identity and expression, level of experience,
|
|
9
|
-
nationality, personal appearance, race, religion, or sexual identity and
|
|
10
|
-
orientation.
|
|
11
|
-
|
|
12
|
-
## Our Standards
|
|
13
|
-
|
|
14
|
-
Examples of behavior that contributes to creating a positive environment
|
|
15
|
-
include:
|
|
16
|
-
|
|
17
|
-
* Using welcoming and inclusive language
|
|
18
|
-
* Being respectful of differing viewpoints and experiences
|
|
19
|
-
* Gracefully accepting constructive criticism
|
|
20
|
-
* Focusing on what is best for the community
|
|
21
|
-
* Showing empathy towards other community members
|
|
22
|
-
|
|
23
|
-
Examples of unacceptable behavior by participants include:
|
|
24
|
-
|
|
25
|
-
* The use of sexualized language or imagery and unwelcome sexual attention or
|
|
26
|
-
advances
|
|
27
|
-
* Trolling, insulting/derogatory comments, and personal or political attacks
|
|
28
|
-
* Public or private harassment
|
|
29
|
-
* Publishing others' private information, such as a physical or electronic
|
|
30
|
-
address, without explicit permission
|
|
31
|
-
* Other conduct which could reasonably be considered inappropriate in a
|
|
32
|
-
professional setting
|
|
33
|
-
|
|
34
|
-
## Our Responsibilities
|
|
35
|
-
|
|
36
|
-
Project maintainers are responsible for clarifying the standards of acceptable
|
|
37
|
-
behavior and are expected to take appropriate and fair corrective action in
|
|
38
|
-
response to any instances of unacceptable behavior.
|
|
39
|
-
|
|
40
|
-
Project maintainers have the right and responsibility to remove, edit, or
|
|
41
|
-
reject comments, commits, code, wiki edits, issues, and other contributions
|
|
42
|
-
that are not aligned to this Code of Conduct, or to ban temporarily or
|
|
43
|
-
permanently any contributor for other behaviors that they deem inappropriate,
|
|
44
|
-
threatening, offensive, or harmful.
|
|
45
|
-
|
|
46
|
-
## Scope
|
|
47
|
-
|
|
48
|
-
This Code of Conduct applies both within project spaces and in public spaces
|
|
49
|
-
when an individual is representing the project or its community. Examples of
|
|
50
|
-
representing a project or community include using an official project e-mail
|
|
51
|
-
address, posting via an official social media account, or acting as an appointed
|
|
52
|
-
representative at an online or offline event. Representation of a project may be
|
|
53
|
-
further defined and clarified by project maintainers.
|
|
54
|
-
|
|
55
|
-
## Enforcement
|
|
56
|
-
|
|
57
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
58
|
-
reported by contacting the project team at topher.bullock@shopify.com. All
|
|
59
|
-
complaints will be reviewed and investigated and will result in a response that
|
|
60
|
-
is deemed necessary and appropriate to the circumstances. The project team is
|
|
61
|
-
obligated to maintain confidentiality with regard to the reporter of an incident.
|
|
62
|
-
Further details of specific enforcement policies may be posted separately.
|
|
63
|
-
|
|
64
|
-
Project maintainers who do not follow or enforce the Code of Conduct in good
|
|
65
|
-
faith may face temporary or permanent repercussions as determined by other
|
|
66
|
-
members of the project's leadership.
|
|
67
|
-
|
|
68
|
-
## Attribution
|
|
69
|
-
|
|
70
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
|
71
|
-
available at [http://contributor-covenant.org/version/1/4][version]
|
|
72
|
-
|
|
73
|
-
[homepage]: http://contributor-covenant.org
|
|
74
|
-
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
source "https://rubygems.org"
|
|
4
|
-
|
|
5
|
-
# Specify runtime dependencies in the gemspec
|
|
6
|
-
gemspec
|
|
7
|
-
|
|
8
|
-
# Specify development dependencies below
|
|
9
|
-
gem "rubocop-minitest", require: false
|
|
10
|
-
gem "rubocop-rake", require: false
|
|
11
|
-
gem "rubocop-shopify", ">= 2.18", require: false if RUBY_VERSION >= "3.1"
|
|
12
|
-
|
|
13
|
-
gem "puma", ">= 5.0.0"
|
|
14
|
-
gem "rackup", ">= 2.1.0"
|
|
15
|
-
|
|
16
|
-
gem "activesupport"
|
|
17
|
-
# Fix io-console install error when Ruby 3.0.
|
|
18
|
-
gem "debug" if RUBY_VERSION >= "3.1"
|
|
19
|
-
gem "rake", "~> 13.0"
|
|
20
|
-
gem "sorbet-static-and-runtime" if RUBY_VERSION >= "3.0"
|
|
21
|
-
gem "yard", "~> 0.9"
|
|
22
|
-
gem "yard-sorbet", "~> 0.9" if RUBY_VERSION >= "3.1"
|
|
23
|
-
|
|
24
|
-
group :test do
|
|
25
|
-
gem "faraday", ">= 2.0"
|
|
26
|
-
gem "minitest", "~> 5.1", require: false
|
|
27
|
-
gem "mocha"
|
|
28
|
-
gem "webmock"
|
|
29
|
-
end
|
data/RELEASE.md
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
## Releases
|
|
2
|
-
|
|
3
|
-
This gem is published to [RubyGems.org](https://rubygems.org/gems/mcp)
|
|
4
|
-
|
|
5
|
-
Releases are triggered by PRs to the `main` branch updating the version number in `lib/mcp/version.rb`.
|
|
6
|
-
|
|
7
|
-
1. **Update the version number** in `lib/mcp/version.rb`, following [semver](https://semver.org/)
|
|
8
|
-
2. **Update CHANGELOG.md**, backfilling the changes since the last release if necessary, and adding a new section for the new version, clearing out the Unreleased section
|
|
9
|
-
3. **Create a PR and get approval from a maintainer**
|
|
10
|
-
4. **Merge your PR to the main branch** - This will automatically trigger the release workflow via GitHub Actions
|
|
11
|
-
|
|
12
|
-
When changes are merged to the `main` branch, the GitHub Actions workflow (`.github/workflows/release.yml`) is triggered and the gem is published to RubyGems.
|
data/Rakefile
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "bundler/gem_tasks"
|
|
4
|
-
require "rake/testtask"
|
|
5
|
-
|
|
6
|
-
Rake::TestTask.new(:test) do |t|
|
|
7
|
-
t.ruby_opts = ["-W0", "-W:deprecated"]
|
|
8
|
-
t.libs << "test"
|
|
9
|
-
t.libs << "lib"
|
|
10
|
-
t.test_files = FileList["test/**/*_test.rb"]
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
require "rubocop/rake_task"
|
|
14
|
-
|
|
15
|
-
RuboCop::RakeTask.new
|
|
16
|
-
|
|
17
|
-
task default: [:test, :rubocop]
|
data/SECURITY.md
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# Security Policy
|
|
2
|
-
|
|
3
|
-
Thank you for helping keep the Model Context Protocol and its ecosystem secure.
|
|
4
|
-
|
|
5
|
-
## Reporting Security Issues
|
|
6
|
-
|
|
7
|
-
If you discover a security vulnerability in this repository, please report it through
|
|
8
|
-
the [GitHub Security Advisory process](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability)
|
|
9
|
-
for this repository.
|
|
10
|
-
|
|
11
|
-
Please **do not** report security vulnerabilities through public GitHub issues, discussions,
|
|
12
|
-
or pull requests.
|
|
13
|
-
|
|
14
|
-
## What to Include
|
|
15
|
-
|
|
16
|
-
To help us triage and respond quickly, please include:
|
|
17
|
-
|
|
18
|
-
- A description of the vulnerability
|
|
19
|
-
- Steps to reproduce the issue
|
|
20
|
-
- The potential impact
|
|
21
|
-
- Any suggested fixes (optional)
|
data/bin/console
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
# frozen_string_literal: true
|
|
3
|
-
|
|
4
|
-
require "bundler/setup"
|
|
5
|
-
require "mcp"
|
|
6
|
-
|
|
7
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
|
8
|
-
# with your gem easier. You can also use a different console, if you like.
|
|
9
|
-
|
|
10
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
|
11
|
-
# require "pry"
|
|
12
|
-
# Pry.start
|
|
13
|
-
|
|
14
|
-
require "irb"
|
|
15
|
-
IRB.start(__FILE__)
|
data/bin/generate-gh-pages.sh
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
set -e
|
|
3
|
-
|
|
4
|
-
# Generates versioned documentation links and commits to gh-pages branch
|
|
5
|
-
#
|
|
6
|
-
# PURPOSE:
|
|
7
|
-
# This script generates a landing page with links to API documentation on
|
|
8
|
-
# RubyDoc.info for a specific version tag. This script is invoked by the
|
|
9
|
-
# publish-gh-pages job in the GitHub Actions workflow
|
|
10
|
-
# (.github/workflows/release.yml) when a release is published.
|
|
11
|
-
#
|
|
12
|
-
# HOW IT WORKS:
|
|
13
|
-
# - Creates isolated git worktrees for the specified tag and gh-pages branch
|
|
14
|
-
# - Copies static Jekyll template files from docs/
|
|
15
|
-
# - Generates _data/versions.yml with list of versions
|
|
16
|
-
# - Commits changes to gh-pages (does not push automatically)
|
|
17
|
-
#
|
|
18
|
-
# WORKFLOW:
|
|
19
|
-
# 1. Run this script with a tag name: `generate-gh-pages.sh v1.2.3`
|
|
20
|
-
# 2. Script generates docs and commits to local gh-pages branch
|
|
21
|
-
# 3. Push gh-pages branch to deploy: `git push origin gh-pages`
|
|
22
|
-
|
|
23
|
-
# Parse semantic version from tag name (ignoring arbitrary prefixes)
|
|
24
|
-
if [[ "${1}" =~ ([0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)?)$ ]]; then
|
|
25
|
-
VERSION="v${BASH_REMATCH[1]}"
|
|
26
|
-
else
|
|
27
|
-
echo "Error: Must specify a tag name that contains a valid semantic version"
|
|
28
|
-
echo "Usage: ${0} <tag-name>"
|
|
29
|
-
echo "Examples:"
|
|
30
|
-
echo " ${0} 1.2.3"
|
|
31
|
-
echo " ${0} v2.0.0-rc.1"
|
|
32
|
-
exit 1
|
|
33
|
-
fi
|
|
34
|
-
|
|
35
|
-
TAG_NAME="${1}"
|
|
36
|
-
REPO_ROOT="$(git rev-parse --show-toplevel)"
|
|
37
|
-
|
|
38
|
-
echo "Generating documentation for tag: ${TAG_NAME}"
|
|
39
|
-
|
|
40
|
-
# Create temporary directories for both worktrees
|
|
41
|
-
WORKTREE_DIR=$(mktemp -d)
|
|
42
|
-
GHPAGES_WORKTREE_DIR=$(mktemp -d)
|
|
43
|
-
|
|
44
|
-
# Set up trap to clean up both worktrees on exit
|
|
45
|
-
trap 'git worktree remove --force "${WORKTREE_DIR}" 2>/dev/null || true; \
|
|
46
|
-
git worktree remove --force "${GHPAGES_WORKTREE_DIR}" 2>/dev/null || true' EXIT
|
|
47
|
-
|
|
48
|
-
echo "Creating worktree for ${TAG_NAME}..."
|
|
49
|
-
git worktree add --quiet "${WORKTREE_DIR}" "${TAG_NAME}"
|
|
50
|
-
|
|
51
|
-
# Check if gh-pages branch exists
|
|
52
|
-
if git show-ref --verify --quiet refs/heads/gh-pages; then
|
|
53
|
-
echo "Creating worktree for existing gh-pages branch..."
|
|
54
|
-
git worktree add --quiet "${GHPAGES_WORKTREE_DIR}" gh-pages
|
|
55
|
-
elif git ls-remote --exit-code --heads origin gh-pages > /dev/null 2>&1; then
|
|
56
|
-
echo "Creating worktree for gh-pages branch from remote..."
|
|
57
|
-
git worktree add --quiet "${GHPAGES_WORKTREE_DIR}" -b gh-pages origin/gh-pages
|
|
58
|
-
else
|
|
59
|
-
echo "Creating worktree for new orphan gh-pages branch..."
|
|
60
|
-
git worktree add --quiet --detach "${GHPAGES_WORKTREE_DIR}"
|
|
61
|
-
git -C "${GHPAGES_WORKTREE_DIR}" checkout --orphan gh-pages
|
|
62
|
-
git -C "${GHPAGES_WORKTREE_DIR}" rm -rf . > /dev/null 2>&1 || true
|
|
63
|
-
fi
|
|
64
|
-
|
|
65
|
-
# Change to gh-pages worktree
|
|
66
|
-
cd "${GHPAGES_WORKTREE_DIR}"
|
|
67
|
-
|
|
68
|
-
# Determine if this tag is the latest version
|
|
69
|
-
echo "Determining if ${VERSION} is the latest version..."
|
|
70
|
-
|
|
71
|
-
# Get all existing version tags from the repository (reverse sorted, newest first)
|
|
72
|
-
ALL_VERSIONS=$(
|
|
73
|
-
git -C "${REPO_ROOT}" tag --list | \
|
|
74
|
-
sed -nE 's/^[^0-9]*([0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)?)$/v\1/p' | \
|
|
75
|
-
sort -Vr
|
|
76
|
-
)
|
|
77
|
-
|
|
78
|
-
# Get the latest version from all version tags
|
|
79
|
-
LATEST_VERSION=$(echo "${ALL_VERSIONS}" | head -n 1)
|
|
80
|
-
|
|
81
|
-
if [ "${VERSION}" = "${LATEST_VERSION}" ]; then
|
|
82
|
-
echo "${VERSION} is the latest version"
|
|
83
|
-
else
|
|
84
|
-
echo "${VERSION} is not the latest version (latest is ${LATEST_VERSION})"
|
|
85
|
-
fi
|
|
86
|
-
|
|
87
|
-
# Update custom documentation for latest version
|
|
88
|
-
if [ "${VERSION}" = "${LATEST_VERSION}" ]; then
|
|
89
|
-
echo "Updating custom documentation..."
|
|
90
|
-
|
|
91
|
-
# Clean up old custom docs from gh-pages root
|
|
92
|
-
echo "Cleaning gh-pages root..."
|
|
93
|
-
git ls-tree --name-only HEAD | xargs -r git rm -rf
|
|
94
|
-
|
|
95
|
-
# Copy custom docs from docs/ directory
|
|
96
|
-
echo "Copying custom docs from ${WORKTREE_DIR}/docs/..."
|
|
97
|
-
cp -r "${WORKTREE_DIR}/docs/." "${GHPAGES_WORKTREE_DIR}/"
|
|
98
|
-
fi
|
|
99
|
-
|
|
100
|
-
# Generate version data for Jekyll
|
|
101
|
-
echo "Generating _data/versions.yml..."
|
|
102
|
-
mkdir -p _data
|
|
103
|
-
echo "${ALL_VERSIONS}" | sed 's/^v/- /' > _data/versions.yml
|
|
104
|
-
|
|
105
|
-
# Stage all changes
|
|
106
|
-
git add .
|
|
107
|
-
|
|
108
|
-
# Commit if there are changes
|
|
109
|
-
if git diff --staged --quiet; then
|
|
110
|
-
echo "No changes to commit"
|
|
111
|
-
else
|
|
112
|
-
echo "Committing documentation for ${VERSION}..."
|
|
113
|
-
git commit -m "Add ${VERSION} docs"
|
|
114
|
-
|
|
115
|
-
echo "Documentation committed to gh-pages branch!"
|
|
116
|
-
echo "Push to remote to deploy to GitHub Pages"
|
|
117
|
-
fi
|
|
118
|
-
|
|
119
|
-
echo "Done!"
|
data/bin/rake
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
# frozen_string_literal: true
|
|
3
|
-
|
|
4
|
-
#
|
|
5
|
-
# This file was generated by Bundler.
|
|
6
|
-
#
|
|
7
|
-
# The application 'rake' is installed as part of a gem, and
|
|
8
|
-
# this file is here to facilitate running it.
|
|
9
|
-
#
|
|
10
|
-
|
|
11
|
-
require "pathname"
|
|
12
|
-
ENV["BUNDLE_GEMFILE"] ||= File.expand_path(
|
|
13
|
-
"../../Gemfile",
|
|
14
|
-
Pathname.new(__FILE__).realpath,
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
|
18
|
-
|
|
19
|
-
if File.file?(bundle_binstub)
|
|
20
|
-
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
|
21
|
-
load(bundle_binstub)
|
|
22
|
-
else
|
|
23
|
-
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
|
24
|
-
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
require "rubygems"
|
|
29
|
-
require "bundler/setup"
|
|
30
|
-
|
|
31
|
-
load Gem.bin_path("rake", "rake")
|
data/bin/setup
DELETED
data/dev.yml
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
name: mcp-ruby
|
|
2
|
-
|
|
3
|
-
type: ruby
|
|
4
|
-
|
|
5
|
-
up:
|
|
6
|
-
- ruby
|
|
7
|
-
- bundler
|
|
8
|
-
|
|
9
|
-
commands:
|
|
10
|
-
console:
|
|
11
|
-
desc: Open console with the gem loaded
|
|
12
|
-
run: bin/console
|
|
13
|
-
build:
|
|
14
|
-
desc: Build the gem using rake build
|
|
15
|
-
run: bin/rake build
|
|
16
|
-
test:
|
|
17
|
-
desc: Run tests
|
|
18
|
-
syntax:
|
|
19
|
-
argument: file
|
|
20
|
-
optional: args...
|
|
21
|
-
run: |
|
|
22
|
-
if [[ $# -eq 0 ]]; then
|
|
23
|
-
bin/rake test
|
|
24
|
-
else
|
|
25
|
-
bin/rake -I test "$@"
|
|
26
|
-
fi
|
|
27
|
-
style:
|
|
28
|
-
desc: Run rubocop
|
|
29
|
-
aliases: [rubocop, lint]
|
|
30
|
-
run: bin/rake rubocop
|
data/docs/_config.yml
DELETED
data/docs/index.md
DELETED
data/docs/latest/index.html
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
# Empty Jekyll front matter to enable Liquid templating (see {{ ... }} below)
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
<!DOCTYPE html>
|
|
6
|
-
<html>
|
|
7
|
-
<head>
|
|
8
|
-
<meta charset="utf-8">
|
|
9
|
-
<title>Redirecting to latest documentation...</title>
|
|
10
|
-
<meta http-equiv="refresh" content="0; url=https://rubydoc.info/gems/mcp">
|
|
11
|
-
<link rel="canonical" href="https://rubydoc.info/gems/mcp">
|
|
12
|
-
</head>
|
|
13
|
-
<body>
|
|
14
|
-
<p>Redirecting to <a href="https://rubydoc.info/gems/mcp">latest documentation</a>...</p>
|
|
15
|
-
<script>
|
|
16
|
-
window.location.href = "https://rubydoc.info/gems/mcp";
|
|
17
|
-
</script>
|
|
18
|
-
</body>
|
|
19
|
-
</html>
|