ask-ruby-harness-mcp 0.1.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 +7 -0
- data/CHANGELOG.md +9 -0
- data/LICENSE +21 -0
- data/README.md +51 -0
- data/bin/ask-ruby-harness-mcp +6 -0
- data/lib/ask/ruby/mcp/version.rb +9 -0
- data/lib/ask/ruby/mcp.rb +53 -0
- metadata +126 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 013367f3da6645a75632cf5b76158ba1aa5ac439a1e240f573c22b03f1773928
|
|
4
|
+
data.tar.gz: 768cf4ba14cfa3e5e089ceae7182b3ab523939aa8b0a4cf327765714fb703bbc
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: e41afc11dd26921853a34896419751ea4137e661929afc785284607d0c1f649074a5dcfb8dfd02041ad5cb528306d672c2a42eb0a08d73160e41074cfccbd076
|
|
7
|
+
data.tar.gz: b161310ac3451f414fdef057353c72ca51986bcf4829e7243ed26b276af22c39ff92e993179a871c97fd2d645240eea238629def2c69f8b188b17cd1600160cc
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
## [0.1.0] — 2026-08-10
|
|
2
|
+
|
|
3
|
+
### Added
|
|
4
|
+
|
|
5
|
+
- **MCP server for any Ruby project** — `ask-ruby-harness-mcp` executable
|
|
6
|
+
exposing the ask-ruby-harness tools (QueryDatabase, ReadModel, ReadLog,
|
|
7
|
+
RunCommand, SchemaGraph, RunTests) over stdio. Serves the project in the
|
|
8
|
+
current working directory; works in monorepos via `run_tests` subproject
|
|
9
|
+
detection.
|
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Kaka Ruto
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Ask Ruby Harness MCP
|
|
2
|
+
|
|
3
|
+
MCP server exposing the [ask-ruby-harness](https://github.com/ask-rb/ask-ruby-harness)
|
|
4
|
+
tools over the Model Context Protocol — for **any Ruby project**.
|
|
5
|
+
|
|
6
|
+
| Tool | What it does |
|
|
7
|
+
|---|---|
|
|
8
|
+
| `query_database` | Read-only SQL (non-SELECT rejected; SELECT-only in production) |
|
|
9
|
+
| `read_model` | Inspect an ActiveRecord model's columns, associations, validations |
|
|
10
|
+
| `read_log` | Read log files with filtering and rotation support |
|
|
11
|
+
| `run_command` | Run shell commands, gated by permission rules |
|
|
12
|
+
| `schema_graph` | Full schema introspection: models, tables, columns, associations |
|
|
13
|
+
| `run_tests` | Structured test results with failure reruns (rails test / rspec / rake test) |
|
|
14
|
+
|
|
15
|
+
The server serves the project in its working directory — point your MCP
|
|
16
|
+
client at it from any Ruby project root (works in monorepos: `run_tests`
|
|
17
|
+
with a `file:` inside a subproject runs that project's suite).
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
ask-ruby-harness-mcp
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Register it as a stdio MCP server in your client (e.g. `~/.zcode/cli/config.json`
|
|
26
|
+
or a workspace `.zcode/config.json`):
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"mcp": {
|
|
31
|
+
"servers": {
|
|
32
|
+
"ask-ruby-harness-mcp": {
|
|
33
|
+
"type": "stdio",
|
|
34
|
+
"command": "ask-ruby-harness-mcp",
|
|
35
|
+
"cwd": "/path/to/your/ruby/project"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Development
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
bundle install
|
|
46
|
+
bundle exec rake test
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## License
|
|
50
|
+
|
|
51
|
+
MIT — see LICENSE.
|
data/lib/ask/ruby/mcp.rb
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "ask/ruby/harness"
|
|
4
|
+
require "ask/mcp"
|
|
5
|
+
require_relative "mcp/version"
|
|
6
|
+
|
|
7
|
+
module Ask
|
|
8
|
+
module Ruby
|
|
9
|
+
module MCP
|
|
10
|
+
PROTOCOL_VERSION = "2025-06-18"
|
|
11
|
+
|
|
12
|
+
class << self
|
|
13
|
+
# All ask-ruby-harness tools wrapped as MCP tool instances.
|
|
14
|
+
def tools
|
|
15
|
+
@tools ||= Ask::Ruby::Harness::HARNESS_TOOLS.map(&:new)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# Start the MCP stdio server, serving the project in the current
|
|
19
|
+
# working directory (ask-ruby-harness's app_root).
|
|
20
|
+
#
|
|
21
|
+
# $ ask-ruby-harness-mcp
|
|
22
|
+
#
|
|
23
|
+
# The server listens for JSON-RPC messages on stdin and writes
|
|
24
|
+
# responses to stdout — the standard MCP stdio transport. Register
|
|
25
|
+
# this executable as an MCP server in your client configuration:
|
|
26
|
+
#
|
|
27
|
+
# "mcp": {
|
|
28
|
+
# "servers": {
|
|
29
|
+
# "ask-ruby-harness-mcp": {
|
|
30
|
+
# "type": "stdio",
|
|
31
|
+
# "command": "ask-ruby-harness-mcp",
|
|
32
|
+
# "args": []
|
|
33
|
+
# }
|
|
34
|
+
# }
|
|
35
|
+
# }
|
|
36
|
+
def start
|
|
37
|
+
Ask::MCP::Server.start_stdio(
|
|
38
|
+
name: "ask-ruby-harness-mcp",
|
|
39
|
+
version: VERSION,
|
|
40
|
+
tools: tools,
|
|
41
|
+
capabilities: { tools: {} },
|
|
42
|
+
debug: ENV["DEBUG"] == "1"
|
|
43
|
+
)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Get or clear the cache (useful in tests).
|
|
47
|
+
def reset!
|
|
48
|
+
@tools = nil
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: ask-ruby-harness-mcp
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Kaka Ruto
|
|
8
|
+
bindir: bin
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: ask-ruby-harness
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - ">="
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '0.1'
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - ">="
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '0.1'
|
|
26
|
+
- !ruby/object:Gem::Dependency
|
|
27
|
+
name: ask-mcp
|
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - ">="
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: 0.4.4
|
|
33
|
+
type: :runtime
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - ">="
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: 0.4.4
|
|
40
|
+
- !ruby/object:Gem::Dependency
|
|
41
|
+
name: minitest
|
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - "~>"
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '5.25'
|
|
47
|
+
type: :development
|
|
48
|
+
prerelease: false
|
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
50
|
+
requirements:
|
|
51
|
+
- - "~>"
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: '5.25'
|
|
54
|
+
- !ruby/object:Gem::Dependency
|
|
55
|
+
name: rake
|
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
|
57
|
+
requirements:
|
|
58
|
+
- - "~>"
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
version: '13.0'
|
|
61
|
+
type: :development
|
|
62
|
+
prerelease: false
|
|
63
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
64
|
+
requirements:
|
|
65
|
+
- - "~>"
|
|
66
|
+
- !ruby/object:Gem::Version
|
|
67
|
+
version: '13.0'
|
|
68
|
+
- !ruby/object:Gem::Dependency
|
|
69
|
+
name: mocha
|
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
|
71
|
+
requirements:
|
|
72
|
+
- - "~>"
|
|
73
|
+
- !ruby/object:Gem::Version
|
|
74
|
+
version: '3.1'
|
|
75
|
+
type: :development
|
|
76
|
+
prerelease: false
|
|
77
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
78
|
+
requirements:
|
|
79
|
+
- - "~>"
|
|
80
|
+
- !ruby/object:Gem::Version
|
|
81
|
+
version: '3.1'
|
|
82
|
+
description: |
|
|
83
|
+
Exposes the ask-ruby-harness tools (QueryDatabase, ReadModel, ReadLog,
|
|
84
|
+
RunCommand, SchemaGraph, RunTests) as MCP tools for any Ruby project.
|
|
85
|
+
Coding agents like Claude Code, Cursor, or any MCP-compatible client can
|
|
86
|
+
connect to query the database, inspect models, read logs, run commands,
|
|
87
|
+
and run tests with structured results.
|
|
88
|
+
email:
|
|
89
|
+
- kaka@myrrlabs.com
|
|
90
|
+
executables:
|
|
91
|
+
- ask-ruby-harness-mcp
|
|
92
|
+
extensions: []
|
|
93
|
+
extra_rdoc_files: []
|
|
94
|
+
files:
|
|
95
|
+
- CHANGELOG.md
|
|
96
|
+
- LICENSE
|
|
97
|
+
- README.md
|
|
98
|
+
- bin/ask-ruby-harness-mcp
|
|
99
|
+
- lib/ask/ruby/mcp.rb
|
|
100
|
+
- lib/ask/ruby/mcp/version.rb
|
|
101
|
+
homepage: https://github.com/ask-rb/ask-ruby-harness-mcp
|
|
102
|
+
licenses:
|
|
103
|
+
- MIT
|
|
104
|
+
metadata:
|
|
105
|
+
homepage_uri: https://github.com/ask-rb/ask-ruby-harness-mcp
|
|
106
|
+
source_code_uri: https://github.com/ask-rb/ask-ruby-harness-mcp
|
|
107
|
+
changelog_uri: https://github.com/ask-rb/ask-ruby-harness-mcp/blob/master/CHANGELOG.md
|
|
108
|
+
rdoc_options: []
|
|
109
|
+
require_paths:
|
|
110
|
+
- lib
|
|
111
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
112
|
+
requirements:
|
|
113
|
+
- - ">="
|
|
114
|
+
- !ruby/object:Gem::Version
|
|
115
|
+
version: '3.2'
|
|
116
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
117
|
+
requirements:
|
|
118
|
+
- - ">="
|
|
119
|
+
- !ruby/object:Gem::Version
|
|
120
|
+
version: '0'
|
|
121
|
+
requirements: []
|
|
122
|
+
rubygems_version: 4.0.3
|
|
123
|
+
specification_version: 4
|
|
124
|
+
summary: MCP server for Ruby project introspection — exposes ask-ruby-harness tools
|
|
125
|
+
over the Model Context Protocol
|
|
126
|
+
test_files: []
|