-
Notifications
You must be signed in to change notification settings - Fork 1
Add MCP Client Plugin #123
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
base: main
Are you sure you want to change the base?
Conversation
a5e63b5
to
8bec039
Compare
6319495
to
8119150
Compare
8bec039
to
42fd24c
Compare
8119150
to
12fb7c4
Compare
42fd24c
to
5503bba
Compare
12fb7c4
to
7aad6f3
Compare
5503bba
to
2760793
Compare
7aad6f3
to
28547fa
Compare
2760793
to
1988f88
Compare
28547fa
to
8f9ee4d
Compare
1988f88
to
dc07c98
Compare
8f9ee4d
to
53904b3
Compare
dc07c98
to
9bbccd2
Compare
53904b3
to
ce8c753
Compare
1. Initializes an AI package (should we call it ai-core?) 2. Initializes some protocols for AI Models 3. Created ChatPrompt class 4. Built the models for Openai/AzureOpenai chat-completions 5. Add ai-test to test functionality 6. (Also added an "Agent" class that's basically ChatPrompt, but more "stateful". ChatPrompt is stateless, but "Agent" isn't). Thinking through if I like this approach or not. #### PR Dependency Tree * **PR #119** 👈 * **PR #120** * **PR #121** * **PR #123** This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal)
9bbccd2
to
c0b82b4
Compare
ce8c753
to
26f7245
Compare
c0b82b4
to
60ce16a
Compare
26f7245
to
6945a2d
Compare
60ce16a
to
2aec517
Compare
6945a2d
to
b55047d
Compare
2aec517
to
2f9b8b8
Compare
b55047d
to
d2af4bb
Compare
2f9b8b8
to
79fcd47
Compare
d2af4bb
to
c665257
Compare
79fcd47
to
ca9ea18
Compare
c665257
to
823205d
Compare
ca9ea18
to
fbd74d4
Compare
823205d
to
e2e5046
Compare
fbd74d4
to
fd5d185
Compare
e2e5046
to
1e3fd19
Compare
fd5d185
to
c33a02a
Compare
d4f3440
to
78b1105
Compare
Add support for OpenAI Responses API. 1. Adds a new OpenAI Model to itneract with Responses API 2. Move completions to its own file 3. Responses has a stateful and a stateless API. In this PR i have support for both. (not streaming yet tho) 4. Responses stateful, required me to save the last message from the model, so i had to make some minor changes to the ListStorage api. #### PR Dependency Tree * **PR #120** 👈 * **PR #121** * **PR #123** * **PR #126** This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal)
c33a02a
to
d550503
Compare
78b1105
to
d806277
Compare
Adds lifecycle methods for ChatPrompt which add support for AI Plugins. This is needed to add plugins to augment the operation of the chat prompt. #### PR Dependency Tree * **PR #121** 👈 * **PR #123** * **PR #126** This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal)
d806277
to
ed39d07
Compare
packages/mcp/README.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we offer this in external instead of packages?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm, good point. i think that's a good idea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, idk, the external thing seems like overkill to me now. I say let's keep it in packages. Simpler to maintain. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @aacebo had it as external cause it's not apart of our 'core' offerings - that makes more sense to me, and easier to deal with if it eventually gets removed/deprecated/revised into a diff concept, etc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds MCP (Model Context Protocol) client plugin support to the Teams AI SDK, enabling integration with MCP servers for enhanced AI agent capabilities.
- Introduces a new MCP package with client plugin functionality for connecting to MCP servers
- Updates function handling system to support both Pydantic models and raw JSON schemas
- Refactors chat prompt function building to integrate plugin system architecture
Reviewed Changes
Copilot reviewed 14 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
packages/mcp/ | Core MCP package with AI plugin and transport layer for MCP server communication |
packages/openai/ | Updated OpenAI models to handle flexible function schemas and improved function argument parsing |
packages/ai/ | Enhanced Function type to accept dict schemas and improved plugin integration in ChatPrompt |
tests/mcp/ | Test application demonstrating MCP client integration with Azure OpenAI |
Configuration files | Updated project configuration to include new MCP package |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
from microsoft.teams.common.logging import ConsoleLogger | ||
from pydantic import BaseModel | ||
|
||
from mcp import ClientSession |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: move external imports to top (mb we can add this into ruff?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me do this in a separate PR. I'll run import reordering across all files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://docs.astral.sh/ruff/settings/#lint_isort_sections going to use this (just so i remember)
self.refetch_timeout_ms = refetch_timeout_ms | ||
|
||
|
||
class McpClientPlugin(BaseAIPlugin): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we add a few tests for these files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah good idea
01b8ea3
to
a4709fd
Compare
Adds support for MCP clients in an MCP plugin. Makes use of the AI plugin system introduced in #121 .
This is roughly how the system works:
PR Dependency Tree
This tree was auto-generated by Charcoal