def METHOD_NAME(self, port: int = 8000, router: APIRouter = base_router):
    """
    Start the agent server.
    """
    config = Config()
    config.bind = [f"localhost:{port}"]
    app = FastAPI(
        title="Auto-GPT Forge",
        description="Modified version of The Agent Protocol.",
        version="v0.4",
    )
    # Add CORS middleware
    origins = [
        "http://localhost:5000",
        "http://127.0.0.1:5000",
        # Add any other origins you want to whitelist
    ]
    app.add_middleware(
        CORSMiddleware,
        allow_origins=origins,
        allow_credentials=True,
        allow_methods=["*"],
        allow_headers=["*"],
    )
    app.include_router(router)
    app.add_middleware(AgentMiddleware, agent=self)
    config.loglevel = "ERROR"
    config.bind = [f"0.0.0.0:{port}"]
    LOG.info(f"Agent server starting on http://{config.bind[0]}")
    asyncio.run(serve(app, config))