feat(prompts_sample): add sample for mcp prompts#343
Open
Conversation
0967e2a to
4a0b812
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds a sample implementation demonstrating MCP (Model Context Protocol) prompts through a code refactoring assistant. The sample includes an MCP server with tools for analyzing Python code, detecting code smells, and generating structured refactoring guidance using prompts.
Key Changes
- Adds MCP server with code analysis tools and refactoring prompts
- Implements LangGraph agent that uses MCP tools to analyze code and select appropriate refactoring strategies
- Provides comprehensive refactoring guidance for extract method, simplify conditionals, remove duplication, and improve naming patterns
Reviewed changes
Copilot reviewed 21 out of 22 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Adds dependencies for MCP, Anthropic SDK, cryptography, and related packages |
| pyproject.toml | Configures workspace to include new sample project |
| samples/mcp-refactoring-assistant/pyproject.toml | Project configuration with dependencies for MCP, LangChain, and LangGraph |
| samples/mcp-refactoring-assistant/server.py | MCP server exposing tools (complexity analysis, code smell detection, refactoring guide) and prompts |
| samples/mcp-refactoring-assistant/graph.py | LangGraph agent that orchestrates code analysis and refactoring recommendation workflow |
| samples/mcp-refactoring-assistant/tools/*.py | Implementation of code analysis heuristics and refactoring guidance mapping |
| samples/mcp-refactoring-assistant/prompts/*.py | Detailed refactoring prompts with examples and best practices |
| Configuration files | LangGraph config, UiPath config, entry points, and bindings |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
5d267e0 to
70e86fe
Compare
radu-mocanu
reviewed
Dec 22, 2025
radu-mocanu
reviewed
Dec 22, 2025
radu-mocanu
reviewed
Dec 22, 2025
radu-mocanu
reviewed
Dec 22, 2025
radu-mocanu
reviewed
Dec 22, 2025
03d5e22 to
a0c8bdd
Compare
radu-mocanu
reviewed
Dec 23, 2025
radu-mocanu
reviewed
Dec 23, 2025
Collaborator
radu-mocanu
left a comment
There was a problem hiding this comment.
Other than the comment above LGTM
39e1ee0 to
cf29fdd
Compare
cf29fdd to
ea534db
Compare
ea534db to
934a7a1
Compare
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.
The main purpose of this pr s to show how can be used the available
get_prompt()LanGraph function for MCP servers.