Bharadwaj-Valluri-cmm/mcp-server-demo
3.2
If you are the rightful owner of mcp-server-demo and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
This project demonstrates a simple MCP (Model Context Protocol) server implementation in Python, providing tools, resources, and prompts for interaction via stdio.
Tools
4
Resources
0
Prompts
0
PDLC MCP Server Demo
This project demonstrates a simple MCP (Model Context Protocol) server implementation in Python. It provides tools, resources, and prompts for interacting with the server via stdio.
Features
- Palindrome Checker: Checks if a string is a palindrome.
- Addition Tool: Adds two numbers (with an extra +3 for demonstration).
- GitHub Connector: Fetches GitHub user details.
- Greeting Resource: Returns a greeting for a given name.
- Prompt Generator: Generates greeting prompts in different styles.
- Math Expression Evaluator: Evaluates mathematical expressions.
- Code Generator: Generates Python code for a given task.
File Structure
PDLC/
├── main.py # Main MCP server implementation
├── __pycache__/ # Python cache files
└── mcp-server-demo/
├── pyproject.toml # Project configuration
├── README.md # Demo README
└── __pycache__/
Getting Started
- Install dependencies
- Ensure you have Python 3.8+ installed.
- Install required packages:
pip install requests
- Run the MCP server
- From the project root:
python main.py - Or use the configured command in
.vscode/mcp.jsonfor stdio mode. For example, if you haveuv.exeinstalled and configured:C:\Users\ei1eipe\.local\bin\uv.exe run main.py - You can also run other configured servers, such as:
C:\Users\ei1eipe\.local\bin\uv.exe
- From the project root:
Customization
- Add new tools by decorating functions with
@mcp.tool(). - Add resources with
@mcp.resource(). - Add prompts with
@mcp.prompt().
Connecting MCP with Copilot
You can integrate your MCP server with GitHub Copilot or similar AI coding assistants to automate code generation and enhance developer productivity. Here’s how you can connect and use Copilot with your MCP server:
Integration Steps
- Ensure Copilot is enabled in your IDE (e.g., VS Code).
- Start your MCP server using one of the methods described above.
- Use Copilot to interact with MCP tools by writing prompts or code that calls the MCP server’s exposed functions (such as
add,connect_github, etc.). - Leverage Copilot for code generation by using the
generate_codetool, which is designed to work with Copilot-like models:
result = generate_code("Sort a list of numbers", lang="python")
print(result)