Class: MCPClient::ServerBase
- Inherits:
-
Object
- Object
- MCPClient::ServerBase
- Defined in:
- lib/mcp_client/server_base.rb
Overview
Base class for MCP servers - serves as the interface for different server implementations
Direct Known Subclasses
Instance Method Summary collapse
-
#call_tool(tool_name, parameters) ⇒ Object
Call a tool with the given parameters.
-
#cleanup ⇒ Object
Clean up the server connection.
-
#connect ⇒ Boolean
Initialize a connection to the MCP server.
-
#list_tools ⇒ Array<MCPClient::Tool>
List all tools available from the MCP server.
Instance Method Details
#call_tool(tool_name, parameters) ⇒ Object
Call a tool with the given parameters
22 23 24 |
# File 'lib/mcp_client/server_base.rb', line 22 def call_tool(tool_name, parameters) raise NotImplementedError, 'Subclasses must implement call_tool' end |
#cleanup ⇒ Object
Clean up the server connection
27 28 29 |
# File 'lib/mcp_client/server_base.rb', line 27 def cleanup raise NotImplementedError, 'Subclasses must implement cleanup' end |
#connect ⇒ Boolean
Initialize a connection to the MCP server
8 9 10 |
# File 'lib/mcp_client/server_base.rb', line 8 def connect raise NotImplementedError, 'Subclasses must implement connect' end |
#list_tools ⇒ Array<MCPClient::Tool>
List all tools available from the MCP server
14 15 16 |
# File 'lib/mcp_client/server_base.rb', line 14 def list_tools raise NotImplementedError, 'Subclasses must implement list_tools' end |