-
-
Notifications
You must be signed in to change notification settings - Fork 144
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
Request for MCP (Model Context Protocol) Support #49
Comments
@bigpo Thanks for the request! What is your vision for MCP integration, or what would you say is currently preventing you from creating agents that interface with MCP servers? Sorry, I am not yet too familiar with MCP as I have not had time yet to look into it closely, so please help me get a clear vision on this! |
@KennyVaneetvelde Thank you for your response and interest! Integrating MCP support into the atomic agents framework would enable seamless interaction with a growing ecosystem of interoperable tools and AI systems. MCP is designed to be lightweight, extensible, and aligns well with the modular nature of atomic agents. Currently, creating agents that interface with MCP servers requires duplicating integration work for each tool, as the framework lacks built-in support for the protocol. By adopting MCP, atomic agents could simplify this process by providing native compatibility, enabling users to:
Adding MCP could be relatively straightforward by aligning it with the current structure for tools in atomic agents. Please consider supporting MCP to enable effortless integration with the expanding ecosystem of MCP-compatible tools and enhance the framework’s interoperability and functionality. |
Also, as a developer/consumer of the framework, what would your expected usage be? I am interested but I'll need a lot more practical info, not just a generic description of what MCP is and can do This info is important because if it's mostly just about not wanting to do boilerplate code, it could just be something in the CLI that scaffolds a basic tool with MCP support but I'll have to know exactly what you expect from it.. |
I believe a concrete example can be drawn from the official documentation: MCP Quickstart - Client. The following code demonstrates how tools can be registered with an MCP server: async def connect_to_server(self, server_script_path: str):
"""Connect to an MCP server
Args:
server_script_path: Path to the server script (.py or .js)
"""
is_python = server_script_path.endswith('.py')
is_js = server_script_path.endswith('.js')
if not (is_python or is_js):
raise ValueError("Server script must be a .py or .js file")
command = "python" if is_python else "node"
server_params = StdioServerParameters(
command=command,
args=[server_script_path],
env=None
)
stdio_transport = await self.exit_stack.enter_async_context(stdio_client(server_params))
self.stdio, self.write = stdio_transport
self.session = await self.exit_stack.enter_async_context(ClientSession(self.stdio, self.write))
await self.session.initialize()
# List available tools
response = await self.session.list_tools()
tools = response.tools
print("\nConnected to server with tools:", [tool.name for tool in tools]) Additionally, tools can then be utilized as follows: async def process_query(self, query: str) -> str:
...
response = await self.session.list_tools()
available_tools = [{
"name": tool.name,
"description": tool.description,
"input_schema": tool.inputSchema
} for tool in response.tools]
# Initial Claude API call
response = self.anthropic.messages.create(
model="claude-3-5-sonnet-20241022",
max_tokens=1000,
messages=messages,
tools=available_tools
) I believe the main advantage of supporting MCP is the ability to reuse the extensive toolset within the MCP ecosystem, which can significantly enhance the utility of the framework. However, my perspective may be limited, and there could be additional factors I haven’t fully considered. Please feel free to evaluate this suggestion critically and from multiple angles. |
Hmm I'll have a look at it and play around with it when I have some time, but in the meanwhile if you can come up with an example that actually uses atomic agents and shows where the problem is, that would be extremely helpful! Should anyone get to it before I do, I believe a viable first attempt might be to just make a tool with a dynamically constructed output schema |
Hello,
I’d like to ask if it would be possible to support the Model Context Protocol (MCP). MCP is an open protocol released by Anthropic, and so far, many third-party MCP server implementations have emerged. Integrating MCP could provide seamless access to this growing ecosystem of tools.
Is there any plan to support MCP in the future? Thank you!
The text was updated successfully, but these errors were encountered: