-
Notifications
You must be signed in to change notification settings - Fork 29
feat(prompts_sample): add sample for mcp prompts #343
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
0967e2a to
4a0b812
Compare
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 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
70e86fe to
a36a4ad
Compare
03d5e22 to
a0c8bdd
Compare
The main purpose of this pr s to show how can be used the available
get_prompt()LanGraph function for MCP servers.