-
Notifications
You must be signed in to change notification settings - Fork 6.6k
[RFC] Feat: Add MCP server tool calling support. #7781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Very good features |
@notsyncing Hi. I'm the product manager of RAGFlow. Soooooo thanks for opening this PR. Supporting MCP in Agent module is on our plan. Could you send me an email at [email protected] so we can better align our vision with your work? |
Sure! I have sent you a mail. |
This PR will be split into smaller parts as requested from the RAGFlow team. Closing for now. |
Really appreciate @notsyncing 's great work. We will work together to bring this feature to the community!🔥 🔥 🔥 |
### What problem does this PR solve? This is a cherry-pick from #7781 as requested. ### Type of change - [x] New Feature (non-breaking change which adds functionality) Co-authored-by: Kevin Hu <[email protected]>
What problem does this PR solve?
Hello, we are exposing some MCP endpoints on our backend service, and we want to use it in the
Generate
component for tool calling, so I created this PR.This PR does two things:
Added a MCP Server page in the settings. It can add, modify, or delete available MCP servers. MCP servers are bound to per tenant.
An
MCPServerService
was added for CRUD of these servers (api/db/services/mcp_server_service.py
).Supported MCP server types are:
SSE
andStreamable HTTP
.It can also define custom HTTP headers which will be sent to MCP servers, the headers can use variables.
it includes a new table
mcp_server
, and a new settings page above.Generate
component:You can select one or more MCP servers configured in the settings page for the LLM to use. This dropdown is also controlled by the
is_tools
property of the selected LLM.You can also bind variables to MCP servers.
An example MCP tool server is also added in
mcp/server/simple_tools_server.py
. It contains a bad calculator tool, which computesa + b + 200
. You can start it with command:python mcp/server/simple_tools_server.py
in the ragflow venv.With that server started at
localhost:8080
, theGenerate
component can use it:Type of change