This document provides practical examples of using the Gogs MCP Server with AI assistants like Claude.
Once configured in Claude Desktop, you can interact naturally with your Gogs server:
{
"mcpServers": {
"gogs": {
"command": "node",
"args": ["/path/to/gogs-mcp-server/dist/index.js"],
"env": {
"GOGS_SERVER_URL": "https://gogs.example.com",
"GOGS_ACCESS_TOKEN": "abc123..."
}
}
}
}
You: "List all my repositories on Gogs"
Claude will use the list_user_repositories tool to fetch your repositories and present them in a readable format.
You: "Search for repositories containing 'docker' in their name"
Claude will use the search_repositories tool with query "docker" and show results.
You: "Show me information about the repository user/my-project"
Claude will use the get_repository tool to fetch and display repository details.
You: "Show me the contents of README.md from owner/repo"
Claude will use the get_contents tool to fetch and display the file contents.
You: "Get the raw content of src/main.go from the develop branch of owner/repo"
Claude will use the get_raw_content tool with the specified parameters.
You: "What files are in the src/ directory of owner/repo?"
Claude will use the get_contents tool to list directory contents.
You: "Create a new repository called 'test-project' with description 'My test project'"
Claude will use the create_repository tool to create the repository.
You: "Create a private Go repository with MIT license and appropriate gitignore"
Claude will use the create_repository tool with:
private: truelicense: "MIT License"gitignores: "Go"auto_init: trueYou: "List all branches in owner/repo"
Claude will use the list_branches tool to fetch branch information.
You: "Show me the recent commits from the main branch of owner/repo"
Claude will use the get_commits tool to fetch commit history.
You: "What are the latest 5 commits on the develop branch?"
Claude will use the get_commits tool with sha: "develop" to get recent commits.
You: "Search for users named 'john'"
Claude will use the search_users tool with query "john".
You: "Get information about user 'johndoe'"
Claude will use the get_user tool to fetch user details.
You: "Who am I logged in as?"
Claude will use the get_current_user tool to show your authenticated user info.
You: "Review the latest changes in owner/repo on the feature-branch branch"
Claude will:
get_commits to fetch recent commits from feature-branchget_contents to read modified filesYou: "Analyze the structure of owner/repo and tell me what kind of project it is"
Claude will:
get_repository to get basic infoget_contents to explore root directoryget_contents or get_raw_content to read key files (package.json, go.mod, etc.)You: "I want to migrate my project from GitHub to Gogs. Can you help me create the repository?"
Claude will:
create_repository with appropriate parametersInstead of: "Look at that file" Use: "Show me the contents of src/main.go from the master branch of owner/repo"
The MCP server allows natural interaction. You can say:
You can ask Claude to perform multiple operations:
Claude can maintain context across multiple queries:
If you encounter errors, Claude will explain them:
page parameter for more commits)limit parameter to adjust)When using the MCP server:
You: "Search through the codebase of owner/repo for the function 'handleRequest'"
Claude will:
get_contents to explore directoriesget_raw_content to read likely filesYou: "What are the differences between the main and develop branches in owner/repo?"
Claude will:
get_commits on both branchesYou: "Create a new Node.js repository with TypeScript setup, MIT license, and Node.js gitignore"
Claude will use create_repository with:
{
"name": "<project-name>",
"description": "TypeScript Node.js project",
"auto_init": true,
"gitignores": "Node",
"license": "MIT License"
}
Then provide instructions for setting up TypeScript configuration locally.