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

[Feature Request]: explore ag2 usages in ModelContextProtocol (mcp) #136

Closed
ohdearquant opened this issue Dec 2, 2024 · 3 comments
Closed
Labels
enhancement New feature or request

Comments

@ohdearquant
Copy link
Collaborator

ohdearquant commented Dec 2, 2024

Is your feature request related to a problem? Please describe.

Model context protocol provides an interface for easy interaction between clients and server, enabling "client-agnostic" features. For example, custom memory agents, custom tool agents that can be persisted somewhere and be used across any mcp clients, let it be claude desktop or any future applications.

Describe the solution you'd like

integrate fastmcp / fly.io...etc, to allow easy deployment of agents, "agent as a service" (AAAS)

Additional context

@ohdearquant ohdearquant added the enhancement New feature or request label Dec 2, 2024
@ohdearquant
Copy link
Collaborator Author

the traditional init chat usage pattern does not work with mcp server due to speed, maybe ag2 should be used as client instead of server

@ohdearquant
Copy link
Collaborator Author

ohdearquant commented Dec 5, 2024

@sternakt @sonichi on the structured output data model from json_schema in #152 , I feel like using mcp servers as validation provider might be a good idea. mcp servers are called with cli, making it easy to put into json schema.

Why?

  • dynamic validation,
  • separation of concerns of response format and operations on the response

Next steps

@ohdearquant
Copy link
Collaborator Author

ohdearquant commented Dec 5, 2024

in attempt to work out best uses of mcp servers, I created automcp, taking inspiration from fastmcp. A few observations while building this:

  1. mcp servers should be quick, providing some kinds of just-in-time service
  2. mcp server is incredibly flexible, you can use any callable, just need to define a schema
  3. not too sure about the differentiation of prompts/tools/resources, nor its purpose
  4. does not support streaming

Issues with existing usage pattern of MCP

mcp now is used to gather context mainly, for example, read into github, read into files. One issue I encountered while using these is that sometimes I do not need the whole file(s) in the LLM conversation context, maybe I just want one piece of information, maybe I just want summary or derivatives. In other words, context management will be useful for improving the use of mcp.

another "issue" or design of MCP is single purposed tools, while this provides modularity, it can increase complexity quickly as more and more service gets connected to the client. Instead of listing out all tools, we can provide a single access point per service, this way service can maintain specific state.

example usage pattern design

{"user": "research on latest papers on XYZ, please implement the algorithms in python"}

{"client": ServiceRequest([
    ExecutionRequest(service=researcher, operation="query_arxiv", content=query1),
    ExecutionRequest(service=researcher, operation="query_arxiv", content=query2),
])}

{"server": "query results..."}
{"client": ServiceRequest([ExecutionRequest(service=researcher, operation="explain", content=...)])}

{"server": "analysis..."}
{"client": ExecutionRequest(service=coder, operation="plan", content=....)}

{"server": "plan..."}
{"client": ServiceRequest([
    ExecutionRequest(service=coder, operation="write_and_debug", content=stage1_part1),
    ExecutionRequest(service=coder, operation="write_and_debug", content=stage1_part2),
    ...
]}

{"server": "codes..., file saved at filepath..."}
{"client": ServiceRequest([
    ExecutionRequest(service=coder, operation="write_and_debug", content=stage2),
    ...
]}
...

{"user": "get these files into ag2 branch XYZ, and create pull request with useful description"}
{"client": ServiceRequest([ExecutionRequest(service=coder, operation="commit_to_gh", content="...")]}

https://github.com/ohdearquant/automcp

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

No branches or pull requests

1 participant