f65bd9bbf5
2. allow manus agent to connect to mcp servers whilst keeping the local tool set 3. include automatic mcp config loading
28 lines
708 B
Python
28 lines
708 B
Python
import asyncio
|
|
|
|
from app.agent.manus import Manus
|
|
from app.logger import logger
|
|
|
|
|
|
async def main():
|
|
# Create and initialize Manus agent
|
|
agent = await Manus.create()
|
|
try:
|
|
prompt = input("Enter your prompt: ")
|
|
if not prompt.strip():
|
|
logger.warning("Empty prompt provided.")
|
|
return
|
|
|
|
logger.warning("Processing your request...")
|
|
await agent.run(prompt)
|
|
logger.info("Request processing completed.")
|
|
except KeyboardInterrupt:
|
|
logger.warning("Operation interrupted.")
|
|
finally:
|
|
# Ensure agent resources are cleaned up before exiting
|
|
await agent.cleanup()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(main())
|