Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Refactors the MCP server example to use the official mcp Python SDK (FastMCP) and exposes Microsoft Teams bot actions as MCP tools, replacing the previous custom plugin-based setup.
Changes:
- Migrates MCP integration to
FastMCPwith@mcp.tool()-decorated Teams tools (messaging, reactions, members). - Mounts the MCP HTTP app into the Teams bot FastAPI server and adds MCP lifespan integration.
- Updates example docs and dependencies to match the new architecture.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| examples/mcp-server/src/main.py | Replaces custom MCP plugin registration with FastMCP tools; adds conversation/activity tracking and mounts MCP app into the Teams server. |
| examples/mcp-server/pyproject.toml | Drops obsolete Teams MCP plugin/devtools deps and adds mcp SDK dependency. |
| examples/mcp-server/README.md | Updates setup/run instructions and documents the new Teams-focused MCP tools and Inspector workflow. |
Comments suppressed due to low confidence (1)
examples/mcp-server/src/main.py:1
- These in-memory maps grow without bounds (especially
activity_storageandbot_activity_storageif many messages are received/sent). For a long-running sample, this can lead to unbounded memory growth. Consider adding a simple eviction strategy (TTL, max size, or LRU) or documenting that this is intentionally ephemeral demo storage.
"""
lilyydu
reviewed
Apr 15, 2026
heyitsaamir
approved these changes
Apr 16, 2026
Collaborator
heyitsaamir
left a comment
There was a problem hiding this comment.
This is a great PR!
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request significantly refactors the MCP server Teams bot sample to provide a robust, human-in-the-loop toolkit using the official
mcpSDK, with clear separation of concerns and improved documentation. The changes introduce a modular structure, new tool definitions for user interaction and approvals, and improved state management. The README and project metadata are also updated for clarity and accuracy.Key changes:
1. Major refactor and modularization
app.py(Teams bot handlers),mcp_tools.py(MCP tool definitions),state.py(in-memory state), andmain.py(entry point and server wiring), replacing the previous monolithic and example-based implementation.2. New MCP tools for human-in-the-loop workflows
mcp_tools.py:notify,ask,get_reply,request_approval, andget_approval, enabling agents to notify users, ask questions, and request approvals through Teams with polling for responses.models.py.3. Improved state management
state.pyto track conversations, pending asks, approvals, and user-to-request mappings, supporting the new tools and workflows.4. Documentation and metadata updates
README.mdto explain setup, architecture, tool usage, workflows, and limitations, providing a much clearer guide for users and developers.pyproject.tomlto accurately describe the project and its dependencies, switching to themcpSDK.5. Removal of legacy/demo code
echo,get_weather,calculate,alert) and the old MCP server plugin setup, replacing them with the new modular and production-like approach.