Skip to content

Commit f60f88f

Browse files
committed
Update README
1 parent 6db10ec commit f60f88f

1 file changed

Lines changed: 53 additions & 6 deletions

File tree

README.md

Lines changed: 53 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,73 @@
11
# ModelContextProtocol
22

3-
3+
This gem enables the Model Context Protocol for Thor command-line applications.
44

55
## Installation
66

7-
TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
8-
97
Install the gem and add to the application's Gemfile by executing:
108

119
```bash
12-
bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
10+
bundle add modelcontextprotocol
1311
```
1412

1513
If bundler is not being used to manage dependencies, install the gem by executing:
1614

1715
```bash
18-
gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
16+
gem install modelcontextprotocol
1917
```
2018

2119
## Usage
2220

23-
TODO: Write usage instructions here
21+
**THIS DOES NOT WORK YET AND IS WHAT THIS PROJECT ASPIRES TO**
22+
23+
Include the `ModelContextProtocol::Thor` in a Thor command-line application to enable model context protocol for the CLI:
24+
25+
```ruby
26+
class MyCLI < Thor
27+
# Enables MCP for the CLI
28+
include ModelContextProtocol::Thor
29+
30+
desc "hello GREETING", "Say hello"
31+
def hello(name)
32+
puts "Hello #{name}"
33+
end
34+
end
35+
```
36+
37+
Then boot the model context server via:
38+
39+
```ruby
40+
MyCLI.mcp.start
41+
```
42+
43+
This boots a model context protocol server that connects to your tools that support MCP.
44+
45+
### Terminalwire
46+
47+
If you'd like to integrate your Rails SaaS to AI development tools, you maybe install Terminalwire Rails server and include it in the CLI.
48+
49+
```ruby
50+
class MyCLI < Thor
51+
# Enable streaming from the server to the Terminalwire thin client.
52+
include Terminalwire::Thor
53+
54+
# Enables MCP for the CLI
55+
include ModelContextProtocol::Thor
56+
57+
desc "hello GREETING", "Say hello"
58+
def hello(name)
59+
puts "Hello #{name}"
60+
end
61+
end
62+
```
63+
64+
You'll then need to [create a Terminalwire distribution](https://terminalwire.com/docs/rails/distribution) and provide your users with the one-liner curl installer:
65+
66+
```sh
67+
$ curl https://my-app.terminalwire.sh | bash
68+
```
69+
70+
Your users then boot the MCP server via `my-app mcp` to integrate with their MCP client.
2471

2572
## Development
2673

0 commit comments

Comments
 (0)