MCP_Project
This project provides an implementation of an MCP server in Python to enhance AI systems like GitHub Copilot Labs. It facilitates the use of tools, resources, and prompts to improve context awareness in AI agents. The project is geared towards developers looking to integrate context protocol capabilities into AI-driven applications.
MCP Project: Using MCP Server to Enhance AI Context Window
This project demonstrates how to implement an MCP (Model Context Protocol) server in Python using tools, prompts, and resources to enrich the context window of an AI agent like GitHub Copilot Labs.
π§ What Is This?
A fully working MCP backend that:
- β Exposes tools (live API functions)
- β Serves resources (structured memory like user profiles)
- β Provides prompts (templates to shape agent behavior)
Designed to integrate directly with GitHub Copilot Labs or any MCP-compatible client.
What you have to know
This figure is a simplified version of the MCP architecture.
π Workflow Overview
- Define your tools, prompts, and resources in
server.py
. - Start the MCP server.
- Launch VSCode with Copilot Labs and connect to your server using
mcp.json
. - Use tools/resources/prompts right inside your chat agent.
π οΈ Tools
Tools are dynamic APIs that can be called from within the agent.
π¦ Resources
Resources provide context like profiles, docs, knowledge snippets.
β¨ Prompts
Prompts are templates used by the agent to condition its behavior.
π Setup & Running
1. Clone and install dependencies
git clone https://github.com/YOUR_USERNAME/MCP_Project.git
cd MCP_Project
python3 -m venv venv_fahmi
source venv_fahmi/bin/activate
pip install mcp textblob requests
python -m textblob.download_corpora
2. Run your MCP server
python server.py
You should see a message like:
MCP server is running at http://127.0.0.1:6274
π§ͺ Testing in GitHub Copilot (VSCode)
1. Install Copilot Labs Extension
2. Add an MCP config in VSCode
Create .vscode/mcp.json
with the following content:
{
"servers": {
"my-mcp-server": {
"type": "stdio",
"command": "python3",
"args": [
"/Users/your_username/Desktop/MCP_Workspace/MCP_Project/server.py"
]
}
}
}
β Make sure the path is correct to your
server.py
.
3. Start MCP Server
From terminal:
source venv_fahmi/bin/activate
python server.py
You should see logs confirming the server is active.
π§ Example Use Cases
-
Ask the agent: βUse the
sentiment_analysis_api
tool to check if the text βIβm so excited to codeβ is positive.β -
Or test the job board fetch: βUse the
access_job_board_api
to get the latest jobs.β
π Project Structure
MCP_Workspace/
βββ MCP_Project/
β βββ image/
β β βββ example-tool.png
β β βββ example-resource.png
β β βββ example-prompt.png
β βββ server.py
βββ .vscode/
β βββ mcp.json
βββ venv_fahmi/
βββ README.md