Skip to content
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

Add support for MCP servers #7620

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

ryanhoangt
Copy link
Contributor

@ryanhoangt ryanhoangt commented Apr 1, 2025

  • This change is worth documenting at https://docs.all-hands.dev/
  • Include this change in the Release Notes. If checked, you must provide an end-user friendly description for your change below

End-user friendly description of the problem this fixes or functionality that this introduces.

Add support for MCP servers

TODOs:

  • Error handling, e.g. when user provides invalid server configs,...
  • FE support
  • Add usage documentation
  • Support SSE servers

Give a summary of what the PR does, explaining any non-trivial design decisions.

This PR adds support for using MCP servers via microagent by:

  1. Users provide MCP server configs via knowledge microagent, for instance:
---
 name: postgresql-db-local
 type: knowledge
 agent: CodeActAgent
 version: 1.0.0
 triggers:
 - postgres
 - postgresql
 mcp_servers:
   postgres:
     command: "npx"
     args:
     - "-y"
     - "@modelcontextprotocol/server-postgres"
     - "postgresql://postgres:yourpassword@localhost:5432/postgres"
---

# Use MCP server to interact with a local PostgreSQL database
  1. When loading the microagent, we make a load_tools request to MCP servers specified in all the microagents, and append the tools' definition to the corresponding microagent content.
  2. The agent can call the tool when needed using a custom mcp_call_tool.

  • Another option is to append the tool definition into the list of tools available for CodeActAgent, but this might confuse the agent if e.g. the MCP tools overlap with the existing tools.
  • Example of a convo:
Screenshot 2025-04-02 at 02 19 23

Link of any specific issues this addresses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant