Welcome to the github-agent repository! This project demonstrates the Model Context Protocol (MCP), a powerful standard for connecting AI assistants to external data sources and tools.
The Model Context Protocol (MCP) is an open protocol that standardizes how AI applications interact with external systems. It provides a unified way for AI assistants like Claude, ChatGPT, and others to access data and tools from various sources.
- MCP Servers: Programs that expose data and functionality through the MCP protocol
- MCP Clients: AI applications (like Cursor, Claude Desktop) that connect to MCP servers
- Resources: Data sources that can be read by the AI (files, databases, APIs)
- Tools: Functions that the AI can execute (create files, run queries, interact with services)
- Prompts: Templated interactions that can be invoked by users
- Standardization: One protocol for all integrations, reducing complexity
- Security: Controlled access to external resources with proper authentication
- Flexibility: Connect to databases, APIs, file systems, and more
- Composability: Mix and match different MCP servers for your needs
- Developer-Friendly: Simple to implement both servers and clients
- Database Access: Query and update databases directly from your AI assistant
- File Management: Read, write, and organize files across your system
- API Integration: Connect to GitHub, Slack, Jira, and other services
- Custom Tools: Build specialized tools for your specific workflows
- Knowledge Bases: Access documentation, wikis, and internal knowledge
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ │ │ │ │ │
│ AI Client │◄───────►│ MCP Server │◄───────►│ External │
│ (Cursor) │ MCP │ (GitHub) │ │ Resources │
│ │ │ │ │ (GitHub) │
└─────────────┘ └─────────────┘ └─────────────┘
- Client: Your AI application (e.g., Cursor, Claude Desktop)
- MCP Server: Middleware that implements the MCP protocol
- Resources: External systems (GitHub, databases, file systems, etc.)
For GitHub integration (as used in this demo):
npm install -g @modelcontextprotocol/server-githubAdd the MCP server to your configuration file (e.g., ~/.cursor/mcp.json):
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "your_token_here"
}
}
}
}- Go to https://github.com/settings/tokens
- Create a new Personal Access Token (Classic or Fine-grained)
- Grant necessary permissions:
- Classic Token:
repo(Full control of repositories) - Fine-grained Token: Contents (Read and write), Metadata (Read-only)
- Classic Token:
After configuring, restart your AI application to load the MCP server.
- @modelcontextprotocol/server-github: GitHub integration
- @modelcontextprotocol/server-filesystem: Local file access
- @modelcontextprotocol/server-postgres: PostgreSQL database
- @modelcontextprotocol/server-sqlite: SQLite database
- @modelcontextprotocol/server-slack: Slack integration
Many community-built servers are available for services like:
- Google Drive
- AWS S3
- MongoDB
- Redis
- And many more!
"Create a new repository called 'my-project' and add a README"
"List all open issues in my repository and summarize them"
"Find all instances of the function 'processData' across my repositories"
"Create a pull request from the feature branch to main"
You can create custom MCP servers to integrate with any system:
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
const server = new Server({
name: 'my-custom-server',
version: '1.0.0',
});
// Define resources
server.setRequestHandler('resources/list', async () => {
return {
resources: [
{ uri: 'custom://data', name: 'My Data', mimeType: 'application/json' }
]
};
});
// Define tools
server.setRequestHandler('tools/list', async () => {
return {
tools: [
{ name: 'my_tool', description: 'Does something useful', inputSchema: {...} }
]
};
});- Official Documentation: https://modelcontextprotocol.io
- GitHub Repository: https://github.com/modelcontextprotocol
- Specification: https://spec.modelcontextprotocol.io
- Community: Join discussions and find more servers
This repository was created using the Model Context Protocol! It demonstrates:
- ✅ Creating a repository via MCP
- ✅ Managing files through MCP
- ✅ Authenticating with GitHub using MCP
- ✅ Automated workflows with AI assistance
Feel free to explore MCP and contribute examples of how you're using it! The protocol is open-source and designed for the community.
This project is open source and available under the MIT License.
Built with ❤️ using the Model Context Protocol