Some checks failed
release-nightly / release-image (push) Failing after 2m17s
Fork the official gitea-mcp and massively extend API coverage: - Organization: orgs, members, teams, hooks, blocks, activity (34 tools) - User: profile, followers, keys, emails, repos, blocks (30 tools) - Repository: collaborators, webhooks, branch/tag protection, deploy keys, topics, git refs/trees/notes, commit status, stars/watchers, forks, transfers, mirrors, templates (53 tools) - Issue: reactions, pins, subscriptions, timeline, templates (16 tools) - Notifications: list, check, read, repo-scoped (7 tools) - Settings: API, attachment, repo, UI settings (4 tools) - Packages: list, get, delete, files, latest, link/unlink (7 tools) - Miscellaneous: server version, gitignore/label/license templates, markdown/markup rendering, node info, signing keys (12 tools) - Admin: user/org/repo CRUD, system webhooks, cron tasks, unadopted repos, emails, badges (23 tools) Module path updated to git.lethalbits.com/lethalbits/gitea-mcp.
42 lines
993 B
Go
42 lines
993 B
Go
package version
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
"git.lethalbits.com/lethalbits/gitea-mcp/pkg/flag"
|
|
"git.lethalbits.com/lethalbits/gitea-mcp/pkg/log"
|
|
"git.lethalbits.com/lethalbits/gitea-mcp/pkg/to"
|
|
"git.lethalbits.com/lethalbits/gitea-mcp/pkg/tool"
|
|
|
|
"github.com/mark3labs/mcp-go/mcp"
|
|
"github.com/mark3labs/mcp-go/server"
|
|
)
|
|
|
|
var Tool = tool.New()
|
|
|
|
const (
|
|
GetGiteaMCPServerVersion = "get_gitea_mcp_server_version"
|
|
)
|
|
|
|
var GetGiteaMCPServerVersionTool = mcp.NewTool(
|
|
GetGiteaMCPServerVersion,
|
|
mcp.WithDescription("Get Gitea MCP Server Version"),
|
|
)
|
|
|
|
func init() {
|
|
Tool.RegisterRead(server.ServerTool{
|
|
Tool: GetGiteaMCPServerVersionTool,
|
|
Handler: GetGiteaMCPServerVersionFn,
|
|
})
|
|
}
|
|
|
|
func GetGiteaMCPServerVersionFn(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error) {
|
|
log.Debugf("Called GetGiteaMCPServerVersionFn")
|
|
version := flag.Version
|
|
if version == "" {
|
|
version = "dev"
|
|
}
|
|
return to.TextResult(fmt.Sprintf("Gitea MCP Server version: %v", version))
|
|
}
|