Entropic 2.3.8
Local-first agentic inference engine
Loading...
Searching...
No Matches
entropic::BashServer Class Reference

Bash MCP server for shell command execution. More...

#include <entropic/mcp/servers/bash.h>

Inheritance diagram for entropic::BashServer:
Collaboration diagram for entropic::BashServer:

Public Member Functions

 BashServer (const std::filesystem::path &working_dir, const std::string &data_dir, int timeout=30)
 Construct with working directory and data dir.
 
 ~BashServer () override
 Destructor.
 
std::string get_permission_pattern (const std::string &tool_name, const std::string &args_json) const override
 Permission pattern: "execute:{base_cmd} *".
 
bool set_working_dir (const std::string &path) override
 Set working directory.
 
const std::filesystem::path & working_dir () const
 Get the working directory.
 
int timeout () const
 Get command timeout.
 
- Public Member Functions inherited from entropic::MCPServerBase
 MCPServerBase (std::string name)
 Construct with server name.
 
const std::string & name () const
 Get the server name.
 
void register_tool (ToolBase *tool)
 Register a tool with this server.
 
std::string list_tools () const
 List all registered tools as a JSON array string.
 
std::string execute (const std::string &tool_name, const std::string &args_json)
 Execute a tool and wrap result in ServerResponse JSON.
 
virtual bool skip_duplicate_check (const std::string &tool_name) const
 Check if a tool should skip duplicate detection.
 
virtual bool configure (const std::string &config_json)
 Configure the server after creation.
 
const ToolRegistryregistry () const
 Get the tool registry (const).
 

Additional Inherited Members

- Protected Attributes inherited from entropic::MCPServerBase
std::string name_
 Server name.
 
ToolRegistry registry_
 Tool registry.
 

Detailed Description

Bash MCP server for shell command execution.

Single tool: execute. Blocks dangerous commands, captures stdout + stderr, enforces timeout.

Version
1.8.5

Definition at line 28 of file bash.h.

Constructor & Destructor Documentation

◆ BashServer()

entropic::BashServer::BashServer ( const std::filesystem::path &  working_dir,
const std::string &  data_dir,
int  timeout = 30 
)

Construct with working directory and data dir.

Parameters
working_dirDefault working directory for commands.
data_dirPath to bundled data directory.
timeoutCommand timeout in seconds.
Version
1.8.5
Parameters
working_dirDefault working directory for commands.
data_dirPath to bundled data directory.
timeoutCommand timeout in seconds.

Definition at line 164 of file bash.cpp.

Member Function Documentation

◆ get_permission_pattern()

std::string entropic::BashServer::get_permission_pattern ( const std::string &  tool_name,
const std::string &  args_json 
) const
overridevirtual

Permission pattern: "execute:{base_cmd} *".

Parameters
tool_nameTool name.
args_jsonArguments JSON.
Returns
Permission pattern with base command.
Version
1.8.5
Parameters
tool_nameTool name.
args_jsonArguments JSON.
Returns
Permission pattern with base command extracted.

Reimplemented from entropic::MCPServerBase.

Definition at line 200 of file bash.cpp.

◆ set_working_dir()

bool entropic::BashServer::set_working_dir ( const std::string &  path)
overridevirtual

Set working directory.

Set the working directory.

Parameters
pathNew working directory.
Returns
true on success.
Version
1.8.5
Parameters
pathNew working directory.
Returns
true on success.

Reimplemented from entropic::MCPServerBase.

Definition at line 223 of file bash.cpp.

◆ timeout()

int entropic::BashServer::timeout ( ) const

Get command timeout.

Returns
Timeout in seconds.
Version
1.8.5
Returns
Timeout in seconds.

Definition at line 245 of file bash.cpp.

◆ working_dir()

const std::filesystem::path & entropic::BashServer::working_dir ( ) const

Get the working directory.

Returns
Working directory path.
Version
1.8.5
Returns
Working directory path.

Definition at line 235 of file bash.cpp.


The documentation for this class was generated from the following files: