-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathgit-mcp.py
More file actions
23 lines (20 loc) · 836 Bytes
/
git-mcp.py
File metadata and controls
23 lines (20 loc) · 836 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from praisonaiagents import Agent, MCP
import os
# pip install mcp-server-git
# Get Git credentials from environment
git_username = os.getenv("GIT_USERNAME")
git_email = os.getenv("GIT_EMAIL")
git_token = os.getenv("GIT_TOKEN") # For private repos
# Use a single string command with Git configuration
git_agent = Agent(
instructions="""You are a helpful assistant that can perform Git operations.
Use the available tools when relevant to manage repositories, commits, and branches.""",
llm="gpt-4o-mini",
tools=MCP("python -m mcp_server_git",
env={
"GIT_USERNAME": git_username,
"GIT_EMAIL": git_email,
"GIT_TOKEN": git_token
})
)
git_agent.start("Clone and analyze the repository at https://github.com/modelcontextprotocol/servers")