Skip to content

armgit / camel

Public Imported from GitHub
0

🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org

docs: minor update on cookbook sql (#2573)

Parth Sharma58575fd9255e
diff --git a/docs/cookbooks/mcp/agents_with_sql_mcp.ipynb b/docs/cookbooks/mcp/agents_with_sql_mcp.ipynb
index 951a69765..f695c14d8 100644
--- a/docs/cookbooks/mcp/agents_with_sql_mcp.ipynb
+++ b/docs/cookbooks/mcp/agents_with_sql_mcp.ipynb
@@ -75,7 +75,7 @@
"metadata": {},
"outputs": [],
"source": [
- "%pip install \"camel-ai[all]==0.2.57\""
+ "%pip install \"camel-ai[all]==0.2.62\""
]
},
{
@@ -114,15 +114,15 @@
"\n",
"```json\n",
"{\n",
- " \"servers\": [\n",
- " {\n",
+ " \"mcpServers\": {\n",
+ " \"sql_server\": {\n",
" \"type\": \"script\",\n",
" \"command\": \"python\",\n",
" \"args\": [\"sql_server_mcp.py\"],\n",
" \"transport\": \"stdio\"\n",
" }\n",
- " ]\n",
- "}\n",
+ " }\n",
+ "} \n",
"```\n",
"\n",
"This configuration tells CAMEL how to start and communicate with your SQL MCP server."
@@ -327,9 +327,8 @@
" \n",
" mcp_toolkit = MCPToolkit(config_path=str(config_file_path))\n",
" \n",
- " tools = None\n",
- " async with mcp_toolkit.connection() as toolkit_connection:\n",
- " tools = toolkit_connection.get_tools()\n",
+ " await mcp_toolkit.connect()\n",
+ " tools = mcp_toolkit.get_tools()\n",
" \n",
" # Get API key securely from user input\n",
" openrouter_api_key = getpass('Enter your OpenRouter API key: ')\n",
@@ -340,7 +339,7 @@
" try:\n",
" model = ModelFactory.create(\n",
" model_platform=ModelPlatformType.OPENROUTER,\n",
- " model_type=\"anthropic/claude-3.7-sonnet\",\n",
+ " model_type=\"google/gemini-2.5-pro-preview\",\n",
" api_key=openrouter_api_key,\n",
" model_config_dict={\n",
" \"temperature\": 0.2,\n",
@@ -399,6 +398,8 @@
" except Exception as e:\n",
" logger.error(f\"An error occurred: {str(e)}\")\n",
" print(f\"\\nError: {str(e)}\")\n",
+ " finally:\n",
+ " await mcp_toolkit.disconnect() # final cleanup\n",
"\n",
"\n",
"if __name__ == \"__main__\":\n",