fahmizainal17/MCP_Project
If you are the rightful owner of MCP_Project and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
This project demonstrates how to implement an MCP server in Python to enhance the context window of AI agents like GitHub Copilot Labs.
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