#14 Feature: Git Trees support

Chiuso
aperto 9 mesi fa da claude · 2 commenti

Description

Add support for Gogs Git Trees functionality to the MCP server.

Why This Feature?

Git trees provide low-level access to repository structure, enabling advanced operations like directory browsing at specific commits, analyzing file hierarchies, and building custom repository explorers.

Requirements

  • Implement get_tree tool - Get a git tree by SHA
  • Add proper TypeScript types for Tree and TreeEntry objects
  • Support recursive tree fetching
  • Support tree entry types (blob, tree, commit)
  • Support tree entry modes (file permissions)
  • Update documentation with usage examples

API Endpoints to Implement

  • GET /repos/:owner/:repo/git/trees/:sha - Get a tree

Related

Requested by @fszontagh in #4

API Reference

See Gogs API documentation for git data (trees) endpoints.

## Description Add support for Gogs Git Trees functionality to the MCP server. ## Why This Feature? Git trees provide low-level access to repository structure, enabling advanced operations like directory browsing at specific commits, analyzing file hierarchies, and building custom repository explorers. ## Requirements - Implement `get_tree` tool - Get a git tree by SHA - Add proper TypeScript types for Tree and TreeEntry objects - Support recursive tree fetching - Support tree entry types (blob, tree, commit) - Support tree entry modes (file permissions) - Update documentation with usage examples ## API Endpoints to Implement - `GET /repos/:owner/:repo/git/trees/:sha` - Get a tree ## Related Requested by @fszontagh in #4 ## API Reference See Gogs API documentation for git data (trees) endpoints.
Claude Coding Agent ha commentato 9 mesi fa
Proprietario

@fszontagh I'm starting work on this issue now! I'll implement the get_tree tool to fetch git trees by SHA, add the necessary TypeScript types for Tree and TreeEntry objects, and update the documentation. This will enable low-level access to repository structure for advanced operations like directory browsing at specific commits.

My plan:

  1. Add Tree and TreeEntry TypeScript types to src/types.ts
  2. Implement getTree method in src/gogs-client.ts
  3. Add get_tree tool with Zod schema to src/index.ts
  4. Update README.md documentation
  5. Test the implementation
  6. Commit and push changes
@fszontagh I'm starting work on this issue now! I'll implement the `get_tree` tool to fetch git trees by SHA, add the necessary TypeScript types for Tree and TreeEntry objects, and update the documentation. This will enable low-level access to repository structure for advanced operations like directory browsing at specific commits. My plan: 1. Add Tree and TreeEntry TypeScript types to src/types.ts 2. Implement getTree method in src/gogs-client.ts 3. Add get_tree tool with Zod schema to src/index.ts 4. Update README.md documentation 5. Test the implementation 6. Commit and push changes
Claude Coding Agent ha commentato 9 mesi fa
Proprietario

@fszontagh Git Trees support has been successfully implemented! 🎉

Implementation Summary

Completed Tasks:

  1. Added GogsTree and GogsTreeEntry TypeScript types to src/types.ts
  2. Implemented getTree() method in src/gogs-client.ts to call the Gogs API
  3. Added get_tree tool with Zod schema validation to src/server.ts
  4. Updated README.md with complete documentation for the new tool
  5. Updated CLAUDE.md to include get_tree in the Content Access tools category
  6. Built and tested the implementation successfully
  7. Committed and pushed changes with reference to issue #14

What's New

The get_tree tool provides low-level access to repository structure at specific commits or tree SHAs. It returns tree entries including:

  • Files (blobs) - with file modes and permissions
  • Directories (trees) - for recursive exploration
  • Submodules (commits) - for git submodule references

Usage Example

{
  "owner": "claude",
  "repo": "gogs-mcp",
  "sha": "e0d4057733b2eb15c9aa5d55cf47b2dabdbdc0dd"
}

Testing

Tested the implementation against the live Gogs API and confirmed it correctly returns:

  • Tree SHA and URL
  • Array of tree entries with path, mode, type, size, SHA, and URL
  • Proper handling of different entry types (blob, tree, commit)

Commit

Changes have been committed and pushed: 28f1a45 - "feat: add Git Trees support #14"

The feature is now ready to use! 🚀

@fszontagh Git Trees support has been successfully implemented! 🎉 ## Implementation Summary ✅ **Completed Tasks:** 1. Added `GogsTree` and `GogsTreeEntry` TypeScript types to `src/types.ts` 2. Implemented `getTree()` method in `src/gogs-client.ts` to call the Gogs API 3. Added `get_tree` tool with Zod schema validation to `src/server.ts` 4. Updated README.md with complete documentation for the new tool 5. Updated CLAUDE.md to include get_tree in the Content Access tools category 6. Built and tested the implementation successfully 7. Committed and pushed changes with reference to issue #14 ## What's New The `get_tree` tool provides low-level access to repository structure at specific commits or tree SHAs. It returns tree entries including: - **Files (blobs)** - with file modes and permissions - **Directories (trees)** - for recursive exploration - **Submodules (commits)** - for git submodule references ## Usage Example ```json { "owner": "claude", "repo": "gogs-mcp", "sha": "e0d4057733b2eb15c9aa5d55cf47b2dabdbdc0dd" } ``` ## Testing Tested the implementation against the live Gogs API and confirmed it correctly returns: - Tree SHA and URL - Array of tree entries with path, mode, type, size, SHA, and URL - Proper handling of different entry types (blob, tree, commit) ## Commit Changes have been committed and pushed: `28f1a45` - "feat: add Git Trees support #14" The feature is now ready to use! 🚀
Sign in to join this conversation.
Nessuna milestone
Nessun assegnatario
1 Partecipanti
Caricamento...
Annulla
Salva
Non ci sono ancora contenuti.