MCP ExplorerExplorer

Mcproto

@wasssonon a year ago
2 MIT
FreeCommunity
AI Systems
Easily run or chain together MCP servers alongside your normal Ruby logic.

Overview

What is Mcproto

MCProto is a Ruby gem designed to facilitate the chaining of MCP servers with Ruby logic, allowing for the creation of custom solutions.

Use cases

Use cases for MCProto include triggering actions based on user input (like emails), sending invitations, and managing workflows that involve multiple sequential processes.

How to use

After installing the gem, create an initializer in ‘config/initializers/mcproto.rb’ to set up your servers. You can define multiple servers by specifying their classes, host, and port, and then start them using the ‘start!’ method.

Key features

Key features of MCProto include the ability to chain multiple servers together, access shared context data between servers, and integrate Ruby logic seamlessly with MCP servers.

Where to use

MCProto can be used in web applications, backend services, and any Ruby-based projects that require the orchestration of multiple MCP servers for complex workflows.

Content

MCProto

Installation

TODO: Launch - Gem hasn’t been made public

Usage

MCProto is a Ruby gem that allows you to chain MCP servers and auxiliary ruby code together for custom solutions.

After installing the gem, create an initializer, config/initializers/mcproto.rb and create your servers:

# Create any number of servers by passing in server classes, host, and port.
beta_invite_server = MCProto::Server.new(
  InviteUserToBeta,
  host: 'localhost',
  port: 3000
)

# Perform logic you may need before starting the servers.
beta_invite_server.start!

Ex: An MCP server can be run on its own

# servers/tag_user.rb
class TriggerByEmail
  include MCProto 
  
  delegate :email, to: :context
  
  resource do
    # TODO
    # define your resource (ex: db table)
    { name: 'email', description: 'Trigger by email' }
  end
  
  tool do
    # TODO
    description "Run when use email is mentioned."
  end
  
  call do
    run unless email_exists?(email)
  end
  
  private
  
  def email_exists?(email)
    #...
  end
end

Or, chain them together:

# servers/invite_user_to_beta.rb
class InviteUserToBeta
  include MCProto::Chain
  
  chain [ TriggerByEmail, SendEmailInvite ]
end

Each server can access the context object and read data from previous servers, or add their own data to the context.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Mcproto project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers