MCPcopy Create free account
hub / github.com/InternScience/InternAgent / startup

Method startup

internagent/mas/interface.py:88–111  ·  view source on GitHub ↗

Initialize system components and mark as ready.

(self)

Source from the content-addressed store, hash-verified

86 logger.info("InternAgent interface initialized")
87
88 async def startup(self) -> None:
89 """Initialize system components and mark as ready."""
90 try:
91 # Initialize remote MCP tools if configured (asynchronous)
92 if self.sci_tools.get("remote", None):
93 logger.info(f"Found {len(self.sci_tools['remote'])} remote MCP server(s) in config:")
94 for tool in self.sci_tools['remote']:
95 logger.info(f" - {tool['id']}: {tool['url']}")
96 await init_mcp_tools(remote_servers=self.sci_tools['remote'])
97
98 # Log total tools registered
99 tools_registry = get_registry()
100 logger.info(f" - Tool names: {tools_registry.get_all_names()}")
101 logger.info(f" - Function tools: {len(tools_registry)}")
102 logger.info(f" - MCP tools: {tools_registry.total_tool_count() - len(tools_registry)}")
103 logger.info(f"Total tools registered: {tools_registry.total_tool_count()}")
104
105 await self.memory_manager.startup()
106 self.system_ready = True
107 logger.info("InternAgent system started successfully")
108 except Exception as e:
109 self.system_ready = False
110 logger.error(f"Error during system startup: {str(e)}")
111 raise
112
113 async def shutdown(self) -> None:
114 """Clean shutdown of system components."""

Callers 1

load_taskMethod · 0.45

Calls 5

init_mcp_toolsFunction · 0.85
get_registryFunction · 0.85
get_all_namesMethod · 0.80
total_tool_countMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected