camel icon indicating copy to clipboard operation
camel copied to clipboard

docs : Cookbook on using MCP with CAMEL on SQL

Open parthshr370 opened this issue 9 months ago • 10 comments

Description

PR for the Cookbook - https://github.com/camel-ai/camel/issues/1983

Checklist

Go over all the following points, and put an x in all the boxes that apply.

  • [x] I have read the CONTRIBUTION guide (required)
  • [x] I have linked this PR to an issue using the Development section on the right sidebar or by adding Fixes #issue-number in the PR description (required)
  • [x] I have checked if any dependencies need to be added or updated in pyproject.toml and uv lock
  • [x] I have updated the tests accordingly (required for a bug fix or a new feature)
  • [ ] I have updated the documentation if needed:
  • [ ] I have added examples if this is a new feature

If you are unsure about any of these, don't hesitate to ask. We are here to help!

parthshr370 avatar Mar 31 '25 16:03 parthshr370

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Thanks @parthshr370 . I'm a bit confused about the entire process.

Under normal circumstances, we set up a server first. Then, we have a config.json file, and the agent uses this config.json to connect to the MCP server. However, there doesn't seem to be any config.json file.

zjrwtx avatar Apr 01 '25 05:04 zjrwtx

Thanks @parthshr370 . I'm a bit confused about the entire process.

Under normal circumstances, we set up a server first. Then, we have a config.json file, and the agent uses this config.json to connect to the MCP server. However, there doesn't seem to be any config.json file.

image image

zjrwtx avatar Apr 01 '25 05:04 zjrwtx

Thanks @parthshr370 . I'm a bit confused about the entire process.

Under normal circumstances, we set up a server first. Then, we have a config.json file, and the agent uses this config.json to connect to the MCP server. However, there doesn't seem to be any config.json file.

@zjrwtx there are two ways to implement an mcp server

  • One through typscript and json as you mentioned
  • Other through the python sdk

While apps like cusor , claude desktop(client) use the simple json cofig as it is just npm install <server_name> and then the config for the same

Agent libs like CAMEL are best suited for Python sdk implementation , where we write a server with a set of rules and then connect the camel-agent to it (client)

The client calls the custom server written in python and then does the task

Also from my experience we see a lot of dependencies error in lot of linux distro while going the server.json route(mostly npx dependencies)

You can refer this for python sdk - https://github.com/modelcontextprotocol/python-sdk

parthshr370 avatar Apr 01 '25 05:04 parthshr370

Thanks @parthshr370 . I'm a bit confused about the entire process. Under normal circumstances, we set up a server first. Then, we have a config.json file, and the agent uses this config.json to connect to the MCP server. However, there doesn't seem to be any config.json file.

@zjrwtx there are two ways to implement an mcp server

  • One through typscript and json as you mentioned
  • Other through the python sdk

While apps like cusor , claude desktop(client) use the simple json cofig as it is just npm install <server_name> and then the config for the same

Agent libs like CAMEL are best suited for Python sdk implementation , where we write a server with a set of rules and then connect the camel-agent to it (client)

The client calls the custom server written in python and then does the task

Also from my experience we see a lot of dependencies error in lot of linux distro while going the server.json route(mostly npx dependencies)

You can refer this for python sdk - https://github.com/modelcontextprotocol/python-sdk thanks @parthshr370 ,i see

zjrwtx avatar Apr 01 '25 05:04 zjrwtx

hello @JoyceXu02 have made the specific changes asked you can take a look

parthshr370 avatar Apr 01 '25 13:04 parthshr370

Hi @parthshr370, I think the statements here are not accurate. MCP server can be implement in more languages.

There are two approaches to implementing an MCP server:

TypeScript with JSON Config: This approach is typically used with npm-based clients (such as Cursor or Claude Desktop), where a config.json file is used to configure and connect to the server.

Python SDK Approach: In this notebook, we use the Python SDK. Here, you write the MCP server in Python and connect directly without a config.json file.

MuggleJinx avatar Apr 23 '25 19:04 MuggleJinx

I am not sure if it's really necessary to give all details about "Building the SQL MCP Server". I think the main focus of this cookbook is about user using the SQL MCP server, not implementing the MCP server from scratch and use. It gets too long, especially for user who doesn't really care about the detail implementations.

I think we can skip the 1st half part of the cookbook, the details of implementing. Just find a SQL MCP server on the Internet (there are a lot), and tell user how to config it with Camel agents.

MuggleJinx avatar Apr 23 '25 19:04 MuggleJinx

Hello @MuggleJinx i will fix wrt to the comments

I have my own implementation of the server here so should I just link the server and the just focus on the implementation part with camel?

parthshr370 avatar Apr 23 '25 19:04 parthshr370

Hello @MuggleJinx i will fix wrt to the comments

I have my own implementation of the server here so should I just link the server and the just focus on the implementation part with camel?

Sure, that would be great. Then you can config like npx -y github:your-username/your-repo for node project for example. Then focus on the usage of agents calling the MCP tools to do the tasks.

MuggleJinx avatar Apr 23 '25 19:04 MuggleJinx

It looks like the cookbook in this PR differs from the one in Colab: link. Could you please unify the two so they are consistent?

Sorry , did that please check now

parthshr370 avatar May 22 '25 19:05 parthshr370