Skip to content

.Net: Python: MCP Client support for Agents #11190

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

Closed
rohit-ganguly opened this issue Mar 25, 2025 · 2 comments
Closed

.Net: Python: MCP Client support for Agents #11190

rohit-ganguly opened this issue Mar 25, 2025 · 2 comments
Assignees
Labels
.NET Issue or Pull requests regarding .NET code python Pull requests for the Python Semantic Kernel

Comments

@rohit-ganguly
Copy link
Member


Feature Request: MCP Client support with Python Agents

Hi all,

I've been going deep into building custom agents in Python for a while, and noticed a huge feature gap that I think SK could benefit from filling. Anthrophic's modelcontextprotocol/python-sdk doesn't currently provide a good client implementation that acts as a 'translation layer' from MCP tools to the way model providers expect tools to be passed in. It actually just forces the docstrings into system prompt which is not great.

This causes a huge headache making boilerplate to make my MCP tools understandable by Claude, OpenAI, etc.

The way this is done by other community-authored MCP clients/agents like Pydantic AI is by smartly reading docstrings in Google, Sphinx, or NumPy format. I think it would be super valuable to tackle this - with the rise of MCP, people know how to build servers - the 'agent' (client) is the new area that people need guidance on, which is where SK can help a lot here.

C# doesn't have this problem as there's interfaces via Microsoft.Extensions.AI, but Python really feels this problem. I think there's a lot of value in solving this!

@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code python Pull requests for the Python Semantic Kernel triage labels Mar 25, 2025
@github-actions github-actions bot changed the title Python: MCP Client support for Agents .Net: Python: MCP Client support for Agents Mar 25, 2025
@nmoeller
Copy link
Contributor

I am currently working on something like this in Python #10778. I would be very happy to hear your feedback about this, the idea is pretty simple converting tools into KernelFunctions, internally SemanticKernel will send the Functions than as tools parameter to the corresponding API's.

github-merge-queue bot pushed a commit that referenced this issue Apr 3, 2025
### Motivation and Context

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->
Adds MCP server configs and a function that turns the server into a
plugin, with each tools of the server represented as a function.
Adds a sample showing how to use that with a Github MCP server.

Closes: #10785 and #11190

With special thanks to @nmoeller 

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄

---------

Co-authored-by: Nico Möller <[email protected]>
glorious-beard pushed a commit to glorious-beard/semantic-kernel that referenced this issue Apr 6, 2025
…soft#11334)

### Motivation and Context

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->
Adds MCP server configs and a function that turns the server into a
plugin, with each tools of the server represented as a function.
Adds a sample showing how to use that with a Github MCP server.

Closes: microsoft#10785 and microsoft#11190

With special thanks to @nmoeller 

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄

---------

Co-authored-by: Nico Möller <[email protected]>
@eavanvalkenburg
Copy link
Member

This is done and released in 1.28.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.NET Issue or Pull requests regarding .NET code python Pull requests for the Python Semantic Kernel
Projects
Status: No status
Development

No branches or pull requests

5 participants