Skip to main content
Glama
blade47

ShadowGit MCP Server

by blade47

list_repos

Discover and retrieve all accessible ShadowGit repositories for debugging and code analysis. Start here to identify available repositories for detailed git history exploration.

Instructions

List all available ShadowGit repositories. Call this first to discover available repositories.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function that executes list_repos: fetches repositories from RepositoryManager, formats list, and returns detailed text response with workflow instructions.
    async handle(): Promise<MCPToolResponse> { const repos = this.repositoryManager.getRepositories(); if (repos.length === 0) { return createTextResponse( `No repositories found in ShadowGit. To add repositories: 1. Open the ShadowGit application 2. Click "Add Repository" 3. Select the repository you want to track ShadowGit will automatically create shadow repositories (.shadowgit.git) to track changes.` ); } const repoList = formatRepositoryList(repos); const firstRepo = repos[0].name; return createTextResponse( `🚀 **ShadowGit MCP Server Connected** ${'='.repeat(50)} 📁 **Available Repositories (${repos.length})** ${repoList} ${'='.repeat(50)} ⚠️ **CRITICAL: Required Workflow for ALL Changes** ${'='.repeat(50)} **You MUST follow this 4-step workflow:** 1️⃣ **START SESSION** (before ANY edits) \`start_session({repo: "${firstRepo}", description: "your task"})\` 2️⃣ **MAKE YOUR CHANGES** Edit code, fix bugs, add features 3️⃣ **CREATE CHECKPOINT** (after changes complete) \`checkpoint({repo: "${firstRepo}", title: "Clear commit message"})\` 4️⃣ **END SESSION** (to resume auto-commits) \`end_session({sessionId: "...", commitHash: "..."})\` ${'='.repeat(50)} 💡 **Quick Start Examples:** \`\`\`javascript // Check recent history git_command({repo: "${firstRepo}", command: "log -5"}) // Start your work session start_session({repo: "${firstRepo}", description: "Fixing authentication bug"}) \`\`\` 📖 **NEXT STEP:** Call \`start_session()\` before making any changes!` ); }
  • Registers the list_repos tool in the MCP server's ListToolsRequestHandler with name, description, and empty input schema.
    name: 'list_repos', description: 'List all available ShadowGit repositories. Use this first to discover which repositories you can work with.', inputSchema: { type: 'object', properties: {}, }, },
  • Dispatches list_repos tool calls to the ListReposHandler.handle() method in the CallToolRequestHandler switch statement.
    case 'list_repos': return await this.listReposHandler.handle();
  • Instantiates the ListReposHandler instance with the RepositoryManager dependency.
    this.listReposHandler = new ListReposHandler(this.repositoryManager);
  • Helper function used by the handler to format the repository list for display.
    export function formatRepositoryList(repos: Array<{ name: string; path: string }>): string { if (repos.length === 0) { return 'No repositories available.'; } return repos.map(r => ` ${r.name}:\n Path: ${r.path}`).join('\n\n'); }

Other Tools

Related Tools

Latest Blog Posts

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/blade47/shadowgit-mcp'

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