Commit Graph

21 Commits

Author SHA1 Message Date
Bo-Yi Wu 80c8b25d6e refactor!: replace mcp-go with the official MCP Go SDK
- Swap the mark3labs MCP dependency for modelcontextprotocol/go-sdk v1.7.0
- Add a declarative tool definition and JSON Schema builder to the tool package
- Adapt registered tools to the official low-level handler, recovering panics and mapping failures to JSON-RPC errors
- Narrow tool handlers to take a plain argument map instead of an SDK request type
- Rewire stdio and HTTP transports onto the official server, moving Authorization parsing into receiving middleware
- Add a golden contract test that locks the exposed tool schemas, plus SDK integration and helper tests
- Add a test target and run it in the pull request workflow

BREAKING CHANGE: The exported helpers change signature. Tool.RegisterRead and
Tool.RegisterWrite now take tool.ServerTool instead of server.ServerTool, and the
annotation constructors return *mcp.ToolAnnotations from the official SDK. Callers
must build tool definitions with tool.NewDefinition and handlers with the
func(context.Context, map[string]any) signature.

The 30-second SSE heartbeat is removed because the official SDK has no equivalent.
ServerOptions.KeepAlive is deliberately not used as a substitute, since it sends MCP
ping requests and ping is removed in protocol 2026. HTTP stays stateless=false, so
new clients negotiate at most 2025-11-25.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-02 21:30:19 +08:00
bircni a998cc3389 chore(deps): update all dependencies to latest (#212)
Bumps all direct dependencies to their latest versions.

| Dependency                    | From    | To           |
| ----------------------------- | ------- | ------------ |
| `gitea.dev/sdk`               | v1.0.1  | v1.2.0       |
| `github.com/mark3labs/mcp-go` | v0.45.0 | v0.56.0      |
| `go.uber.org/zap`             | v1.27.1 | v1.28.0      |
| `go.uber.org/zap/exp`         | —       | v0.3.0 (new) |

### Required code change
mcp-go v0.56 moved transport logging to `log/slog` and renamed the streamable-HTTP logger option to `WithStreamableHTTPLogger(*slog.Logger)`. Added a `log.Slog()` bridge (via the official `zapslog` adapter) so the HTTP transport keeps logging through the existing zap pipeline, and switched `operation.go` to the new option.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/212
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: bircni <bircni@icloud.com>
2026-07-19 19:53:31 +00:00
Lunny Xiao a35fd26112 replace gitea sdk (#197)
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/197
Reviewed-by: silverwind <2021+silverwind@noreply.gitea.com>
2026-05-28 02:41:43 +00:00
silverwind c8004e9198 Update mcp-go to v0.45.0 (#163)
Update github.com/mark3labs/mcp-go from v0.44.0 to v0.45.0.

Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/163
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-committed-by: silverwind <me@silverwind.io>
2026-03-24 17:07:40 +00:00
silverwind bb9470a259 chore: update Go and Actions dependencies (#132)
## Summary
- Update Go dependencies: gitea SDK v0.22.1→v0.23.2, mcp-go v0.42.0→v0.44.0, zap v1.27.0→v1.27.1, go-version v1.7.0→v1.8.0, x/crypto v0.43.0→v0.48.0, x/sys v0.37.0→v0.41.0
- Update Actions: checkout v4→v6, setup-go v5→v6, build-push-action v5→v6, goreleaser-action v6→v7

## Test plan
- [x] `go test ./...` passes
- [x] `make build` succeeds

Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/132
Co-authored-by: silverwind <me@silverwind.io>
Co-committed-by: silverwind <me@silverwind.io>
2026-02-22 17:10:25 +00:00
silverwind 8728c04748 chore: add golangci-lint, bump Go to 1.26, fix all lint issues (#133)
## Summary
- Add `.golangci.yml` with linter configuration matching the main gitea repo
- Add `lint`, `lint-fix`, `lint-go`, `lint-go-fix`, and `security-check` Makefile targets
- Add `tidy` Makefile target (extracts min Go version from `go.mod` for `-compat` flag)
- Bump minimum Go version to 1.26
- Update golangci-lint to v2.10.1
- Replace `golang/govulncheck-action` with `make security-check` in CI
- Add `make lint` step to CI
- Fix all lint issues across the codebase (formatting, `errors.New` vs `fmt.Errorf`, `any` vs `interface{}`, unused returns, stuttering names, Go 1.26 `new(expr)`, etc.)
- Remove unused `pkg/ptr` package (inlined by Go 1.26 `new(expr)`)
- Remove dead linter exclusions (staticcheck, gocritic, testifylint, dupl)

## Test plan
- [x] `make lint` passes
- [x] `go test ./...` passes
- [x] `make build` succeeds

Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/133
Reviewed-by: techknowlogick <techknowlogick@noreply.gitea.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-committed-by: silverwind <me@silverwind.io>
2026-02-22 17:10:04 +00:00
appleboy ba64780c2f chore: upgrade Go dependencies to latest stable versions
- Update version of code.gitea.io/sdk/gitea to v0.22.1
- Upgrade github.com/mark3labs/mcp-go dependency to v0.42.0
- Bump golang.org/x/crypto to v0.43.0 and golang.org/x/sys to v0.37.0

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2025-10-31 20:56:12 +08:00
Daniel f6b45fdf6e feat(org): add MCP tools for organization-level labels (list/create/edit/delete) (#99) (#102)
This PR adds full support for managing organization-level labels via MCP. It uses the newly added SDK APIs now available on main branch, see https://gitea.com/gitea/go-sdk/issues/732.

Registers following tools under label module and wires them into the MCP server as read/write tools:

- list_org_labels: list labels defined at the organization level (pagination supported)
- create_org_label: create a label in an organization (name, color, description, exclusive)
- edit_org_label: edit an organization label (name, color, description, exclusive)
- delete_org_label: delete an organization label by ID

Dependency note:
go.mod/go.sum updated to use the SDK main branch pseudo-version that includes the org-label APIs.

If you prefer to merge only after a tagged SDK release, I can bump the dependency to the new tag as soon as it’s available.

Thanks for considering!

Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/102
Reviewed-by: Bo-Yi Wu (吳柏毅) <appleboy.tw@gmail.com>
Co-authored-by: Daniel <danielwichers@gmail.com>
Co-committed-by: Daniel <danielwichers@gmail.com>
2025-10-20 01:43:39 +00:00
appleboy 8c028ec48b chore: update project and indirect dependencies to latest versions
- Update dependencies to newer versions for multiple modules
- Upgrade code.gitea.io/sdk/gitea to v0.22.0
- Upgrade github.com/mark3labs/mcp-go to v0.40.0
- Update indirect dependencies: github.com/mailru/easyjson, github.com/spf13/cast, golang.org/x/crypto, and golang.org/x/sys

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2025-09-27 16:17:14 +08:00
Lunny Xiao 62cb6e7830 Use no session id (#75)
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/75
Reviewed-by: hiifong <i@hiif.ong>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2025-07-30 01:01:55 +00:00
appleboy eb6b5a8f92 chore: upgrade Go dependencies to latest stable versions (#73)
- Bump github.com/mark3labs/mcp-go dependency to v0.35.0
- Update github.com/spf13/cast to v1.9.2
- Upgrade golang.org/x/crypto to v0.40.0
- Upgrade golang.org/x/sys to v0.34.0

Signed-off-by: appleboy <appleboy.tw@gmail.com>

Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/73
Co-authored-by: appleboy <appleboy.tw@gmail.com>
Co-committed-by: appleboy <appleboy.tw@gmail.com>
2025-07-27 06:23:38 +00:00
Alex Kirhenshtein b85a523983 Bump go-mcp version to 0.32.0 to mitigate Claude desktop connectivity issue (#63)
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/63
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: Bo-Yi Wu (吳柏毅) <appleboy.tw@gmail.com>
Co-authored-by: Alex Kirhenshtein <alk@netxms.org>
Co-committed-by: Alex Kirhenshtein <alk@netxms.org>
2025-06-21 03:34:17 +00:00
Bo-Yi Wu 34ca5d45db refactor(args): request argument access and update dependencies (#42)
- Update dependencies to newer versions in go.mod
- Refactor all request argument accesses to use req.GetArguments() instead of direct access to req.Params.Arguments
- Change variable declaration for ListRepoCommitsTool from a grouped var block to a single var statement for consistency

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/42
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Co-committed-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2025-05-26 06:10:10 +00:00
hiifong 70b9ac5b80 Support read only mode (#36)
Fix: #35
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/36
Co-authored-by: hiifong <f@ilo.nz>
Co-committed-by: hiifong <f@ilo.nz>
2025-04-20 09:09:29 +00:00
hiifong afada4435e Add Dockerfile (#15)
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/15
Co-authored-by: hiifong <f@ilo.nz>
Co-committed-by: hiifong <f@ilo.nz>
2025-04-06 04:46:27 +00:00
hiifong 2a9504fc5d update (#8)
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/8
2025-03-27 07:31:39 +00:00
hiifong 10ebaa1964 Update go.mod 2025-03-23 14:52:47 +08:00
hiifong 72d9b5a8dd Add debug mode and upgrade mcp-go to v0.14.1 2025-03-20 23:01:05 +08:00
hiifong c4f619a907 Upgrade mcp-go to the latest version 2025-03-18 22:59:58 +08:00
appleboy 051ce0bab4 chore: remove unused dependencies for project cleanup
- Remove `testify` dependency
- Remove `go-spew` indirect dependency
- Remove `go-difflib` indirect dependency
- Remove `yaml.v3` indirect dependency

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2025-03-16 13:57:53 +08:00
hiifong 2dd4aa94ad Initialize commit 2025-03-16 00:21:29 +08:00