Skip to main content
Glama

Git Repo Browser MCP

config-operations.js1.23 kB
import { simpleGit } from "./common.js"; /** * Configures git settings for the repository * @param {string} repoPath - Path to the local repository * @param {string} scope - Configuration scope (local, global, system) * @param {string} key - Configuration key * @param {string} value - Configuration value * @returns {Object} - Configuration result */ export async function handleGitConfig({ repo_path, scope = "local", key, value, }) { try { const git = simpleGit(repo_path); // Set the configuration await git.addConfig(key, value, false, scope); return { content: [ { type: "text", text: JSON.stringify( { success: true, message: `Set ${scope} config ${key}=${value}`, key: key, value: value, scope: scope, }, null, 2 ), }, ], }; } catch (error) { return { content: [ { type: "text", text: JSON.stringify( { error: `Failed to set git config: ${error.message}` }, null, 2 ), }, ], isError: true, }; } }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bsreeram08/git-commands-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server