MCP Server
AI Agent Integration
The Model Context Protocol (MCP) lets AI tools — Claude Desktop, Cursor, VS Code, and others — use GitForge as a tool. Create repos, read files, commit code, and manage branches directly from your AI assistant.
Quick Setup
Add the following configuration to your MCP client. You will need a Personal Access Token (gf_...).
{
"mcpServers": {
"gitforge": {
"command": "npx",
"args": ["-y", "@gitforge/mcp"],
"env": {
"GITFORGE_API_URL": "https://git-forge.dev",
"GITFORGE_TOKEN": "gf_your_token_here"
}
}
}
}Where to put this config
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows).
Go to Settings → MCP Servers and add the server configuration above.
Create or edit .vscode/mcp.json in your workspace root with the config above.
Available Tools
The MCP server exposes 18 tools grouped by category. Your AI assistant discovers these automatically once connected.
create_repoCreate a new Git repositorylist_reposList repositories with paginationdelete_repoDelete a repository (irreversible)list_filesList directory contents at a given ref (branch/tag/SHA)get_fileRead a file's content from a repository at a given refcreate_commitCreate a commit with file additions/modifications/deletions (no git client needed)get_commit_historyGet paginated commit history for a branch or reflist_branchesList branches in a repositorycreate_branchCreate a new branch from a base branch or SHAdelete_branchDelete a branchcreate_ephemeral_branchCreate a disposable ephemeral branch (auto-expires). Ideal for AI agent workspaces and previews.promote_ephemeral_branchPromote an ephemeral branch to a permanent branchsearch_codeSearch file contents within a repositoryget_diffCompare two branches/refs and get unified diffsget_remote_urlGet an authenticated git clone URL with a short-lived tokensearch_docsSearch GitForge documentation contentget_doc_pageGet the full content of a specific documentation pagecreate_sandbox_urlGenerate a time-limited, scoped Git remote URL for sandbox/agent useEnvironment Variables
GITFORGE_API_URLYour GitForge instance URL (e.g. https://git-forge.dev)GITFORGE_TOKENPersonal Access Token — create one at /settings/patsMCP_PORTPort for HTTP transport mode (default: 3002)Example Usage
Once connected, your AI assistant can interact with GitForge through natural language.
You: “Create a new repo called my-project”
Claude: [uses create_repo tool] → Created repo my-project (id: abc-123)
You: “Show me the contents of src/index.ts on main”
Claude: [uses get_file tool] → Returns the file content
You: “Add a README.md with project description and commit to main”
Claude: [uses create_commit tool] → Created commit abc123 on main
You: “Create a sandbox for repo X so I can test changes safely”
Claude: [uses create_sandbox_url tool] → Returns a scoped, time-limited clone URL with an ephemeral branch