Unravel Engine C++ Reference
Loading...
Searching...
No Matches
unravel::mcp_manager Class Reference

#include <mcp_manager.h>

Public Member Functions

 mcp_manager ()
 
 ~mcp_manager ()
 
auto init (rtti::context &ctx) -> bool
 
auto deinit (rtti::context &ctx) -> bool
 
void start ()
 
void stop ()
 
auto is_running () const -> bool
 
auto is_enabled () const -> bool
 
auto get_host () const -> const char *
 
auto get_port () const -> int
 
auto get_endpoint_url () const -> std::string
 
auto get_health_url () const -> std::string
 
auto get_tool_count () const -> size_t
 
auto get_request_count () const -> uint64_t
 
auto get_tool_call_count () const -> uint64_t
 
auto get_error_count () const -> uint64_t
 
auto snapshot_activity () const -> std::vector< mcp_activity_entry >
 
void clear_activity ()
 
template<typename Fn >
auto invoke_on_main (Fn &&fn, std::chrono::milliseconds timeout=std::chrono::milliseconds(5000)) -> std::optional< std::invoke_result_t< std::decay_t< Fn > > >
 

Static Public Attributes

static constexpr const char * k_host = "127.0.0.1"
 
static constexpr int k_default_port = 27182
 
static constexpr size_t k_max_activity_entries = 256
 

Detailed Description

Definition at line 39 of file mcp_manager.h.

Constructor & Destructor Documentation

◆ mcp_manager()

unravel::mcp_manager::mcp_manager ( )
default

◆ ~mcp_manager()

unravel::mcp_manager::~mcp_manager ( )

Definition at line 17 of file mcp_manager.cpp.

Member Function Documentation

◆ clear_activity()

void unravel::mcp_manager::clear_activity ( )

Definition at line 187 of file mcp_manager.cpp.

◆ deinit()

auto unravel::mcp_manager::deinit ( rtti::context & ctx) -> bool

Definition at line 54 of file mcp_manager.cpp.

◆ get_endpoint_url()

auto unravel::mcp_manager::get_endpoint_url ( ) const -> std::string

Definition at line 151 of file mcp_manager.cpp.

◆ get_error_count()

auto unravel::mcp_manager::get_error_count ( ) const -> uint64_t

Definition at line 176 of file mcp_manager.cpp.

◆ get_health_url()

auto unravel::mcp_manager::get_health_url ( ) const -> std::string

Definition at line 156 of file mcp_manager.cpp.

◆ get_host()

auto unravel::mcp_manager::get_host ( ) const -> const char*

Definition at line 141 of file mcp_manager.cpp.

◆ get_port()

auto unravel::mcp_manager::get_port ( ) const -> int

Definition at line 146 of file mcp_manager.cpp.

◆ get_request_count()

auto unravel::mcp_manager::get_request_count ( ) const -> uint64_t

Definition at line 166 of file mcp_manager.cpp.

◆ get_tool_call_count()

auto unravel::mcp_manager::get_tool_call_count ( ) const -> uint64_t

Definition at line 171 of file mcp_manager.cpp.

◆ get_tool_count()

auto unravel::mcp_manager::get_tool_count ( ) const -> size_t

Definition at line 161 of file mcp_manager.cpp.

◆ init()

auto unravel::mcp_manager::init ( rtti::context & ctx) -> bool

Definition at line 31 of file mcp_manager.cpp.

◆ invoke_on_main()

template<typename Fn >
auto unravel::mcp_manager::invoke_on_main ( Fn && fn,
std::chrono::milliseconds timeout = std::chrono::milliseconds(5000) ) -> std::optional<std::invoke_result_t<std::decay_t<Fn>>>
inline

Run fn on the editor main thread and wait. Safe from MCP HTTP workers. fn must return a value (use bool for success/fail). Returns nullopt on timeout / exception.

Definition at line 71 of file mcp_manager.h.

◆ is_enabled()

auto unravel::mcp_manager::is_enabled ( ) const -> bool

Definition at line 136 of file mcp_manager.cpp.

◆ is_running()

auto unravel::mcp_manager::is_running ( ) const -> bool

Definition at line 131 of file mcp_manager.cpp.

◆ snapshot_activity()

auto unravel::mcp_manager::snapshot_activity ( ) const -> std::vector<mcp_activity_entry>

Definition at line 181 of file mcp_manager.cpp.

◆ start()

void unravel::mcp_manager::start ( )

Definition at line 61 of file mcp_manager.cpp.

◆ stop()

void unravel::mcp_manager::stop ( )

Definition at line 110 of file mcp_manager.cpp.

Member Data Documentation

◆ k_default_port

int unravel::mcp_manager::k_default_port = 27182
staticconstexpr

Definition at line 43 of file mcp_manager.h.

◆ k_host

const char* unravel::mcp_manager::k_host = "127.0.0.1"
staticconstexpr

Definition at line 42 of file mcp_manager.h.

◆ k_max_activity_entries

size_t unravel::mcp_manager::k_max_activity_entries = 256
staticconstexpr

Definition at line 44 of file mcp_manager.h.


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