-
Notifications
You must be signed in to change notification settings - Fork 6
Populate empty package READMEs with usage examples #196
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
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
1bde601
Initial plan
Copilot 85509b7
Populate package READMEs with documentation
Copilot efc82c8
Fix class names in README examples to match actual API
Copilot 5051e92
Fix API method calls in README examples
Copilot 19e1e5e
Fix remaining API details in README examples
Copilot 5c21554
Simplify READMEs to show only basic use cases
Copilot f146a68
Address feedback: Add ChatPrompt, functions, MCP server/client, A2A s…
Copilot eb5e629
Fix MCP Server example to match actual test implementation with use_t…
Copilot 0adb7ef
Fix MCP Client example to use use_mcp_server() with URL instead of in…
Copilot c5599a4
Fix A2A title and OpenAI example to use ChatPrompt
Copilot 235f340
Remove port specification from DevTools example
Copilot 80baf09
Update A2A examples to match test implementation with proper AgentCar…
Copilot a67178f
Update documentation link for Teams SDK
heyitsaamir 16ff31b
Update README.md
heyitsaamir 6fa2d3e
Update documentation link for MCP integration
heyitsaamir ed82309
Merge branch 'main' into copilot/populate-empty-readmes
heyitsaamir File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| # Microsoft Teams MCP Plugin | ||
|
|
||
| <p> | ||
| <a href="https://pypi.org/project/microsoft-teams-mcpplugin/" target="_blank"> | ||
| <img src="https://img.shields.io/pypi/v/microsoft-teams-mcpplugin" /> | ||
| </a> | ||
| <a href="https://pypi.org/project/microsoft-teams-mcpplugin/" target="_blank"> | ||
| <img src="https://img.shields.io/pypi/dw/microsoft-teams-mcpplugin" /> | ||
| </a> | ||
| </p> | ||
|
|
||
| Model Context Protocol (MCP) integration for Microsoft Teams AI applications. | ||
heyitsaamir marked this conversation as resolved.
Show resolved
Hide resolved
heyitsaamir marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Enables Teams bots to both expose tools as MCP servers and use MCP servers as clients. | ||
|
|
||
| [📖 Documentation](https://microsoft.github.io/teams-sdk/python/in-depth-guides/ai/mcp/) | ||
|
|
||
| ## Installation | ||
|
|
||
| ```bash | ||
| uv add microsoft-teams-mcpplugin | ||
| ``` | ||
|
|
||
| ## Usage | ||
|
|
||
| ### MCP Client (Use MCP Servers) | ||
|
|
||
| ```python | ||
| from microsoft.teams.apps import App | ||
| from microsoft.teams.mcpplugin import McpClientPlugin | ||
| from microsoft.teams.ai import ChatPrompt | ||
| from microsoft.teams.openai import OpenAICompletionsAIModel | ||
|
|
||
| # Create MCP client plugin | ||
| mcp_client = McpClientPlugin() | ||
|
|
||
| # Connect to MCP servers | ||
| mcp_client.use_mcp_server("https://example.com/mcp") | ||
|
|
||
| # Use with ChatPrompt | ||
| model = OpenAICompletionsAIModel(api_key="your-api-key", model="gpt-4") | ||
| prompt = ChatPrompt(model, plugins=[mcp_client]) | ||
| ``` | ||
|
|
||
| ### MCP Server (Expose Tools) | ||
|
|
||
| ```python | ||
| from microsoft.teams.apps import App | ||
| from microsoft.teams.mcpplugin import McpServerPlugin | ||
| from microsoft.teams.ai import Function | ||
| from pydantic import BaseModel | ||
|
|
||
| # Create MCP server plugin | ||
| mcp_server = McpServerPlugin(name="my-mcp-server") | ||
|
|
||
| # Define a tool | ||
| class EchoParams(BaseModel): | ||
| input: str | ||
|
|
||
| async def echo_handler(params: EchoParams) -> str: | ||
| return f"You said {params.input}" | ||
heyitsaamir marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| # Register tool with MCP server | ||
| mcp_server.use_tool( | ||
| Function( | ||
| name="echo", | ||
| description="Echo back whatever you said", | ||
| parameter_schema=EchoParams, | ||
| handler=echo_handler | ||
| ) | ||
| ) | ||
|
|
||
| app = App(plugins=[mcp_server]) | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.