Commit Graph

14 Commits

Author SHA1 Message Date
Mathias Bergqvist
e4a9d058f0 feat(tools): code_search (single-repo)
Adds SearchCode to gitea.Client and code_search MCP tool for single-repo
code search via GET /api/v1/repos/{owner}/{repo}/search?type=code.
Fan-out placeholder returns ErrValidation (lands in 7.3).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 22:47:33 +02:00
Mathias Bergqvist
61cce37ff5 feat(tools): repo_search with allowlist post-filter
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 22:44:44 +02:00
Mathias Bergqvist
ba172e3db8 feat(tools): workflow_run_trigger 2026-05-04 22:25:10 +02:00
Mathias Bergqvist
c4874ae8d1 feat(tools): pr_get 2026-05-04 22:21:20 +02:00
Mathias Bergqvist
9972dcd94e feat(tools): pr_create with identity footer 2026-05-04 22:20:33 +02:00
Mathias Bergqvist
5af8addc26 feat(tools): file_write_branch
Add BranchExists/CreateBranch/UpsertFile gitea client methods and the
file_write_branch MCP tool. Branch is auto-created from base (or repo
default_branch) when it doesn't exist; file is upserted via PUT contents.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 22:15:39 +02:00
Mathias Bergqvist
044086b067 feat(tools): file_read with default-branch resolution
Adds GetFileContents to the gitea client and a file_read MCP tool.
When ref is omitted, the tool resolves the repo default_branch via
GetRepo before fetching contents. Decoded content capped at 1 MiB.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 22:11:50 +02:00
Mathias Bergqvist
f10cc9ac4b feat(tools): repo_get 2026-05-04 22:08:24 +02:00
Mathias Bergqvist
33ad02d369 feat(tools): repo_list 2026-05-04 22:07:44 +02:00
Mathias Bergqvist
4dba4ca192 feat(main): wire caller middleware into /mcp 2026-05-04 21:20:37 +02:00
Mathias Bergqvist
ba5068648b refactor(mcp): compose origin allowlist as middleware, remove duplication
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 20:58:08 +02:00
Mathias Bergqvist
36765b8360 feat(mcp): streamable HTTP transport with session, init, and dispatch
Implements the Streamable HTTP transport: POST routing handles initialize
(issues session ID), tools/list, tools/call, and unknown methods; GET SSE
emits a keepalive comment then blocks on context cancellation. A minimal
registry stub is introduced so the server compiles and tools/list returns
an empty array until Phase 6+ registers real tools.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 20:49:54 +02:00
Mathias Bergqvist
d399a216c1 feat(config): env-var loading
Add internal/config package with Config struct and Load() function.
Reads GITEA_BASE_URL, GITEA_API_TOKEN, GITEA_MCP_ALLOWED_OWNERS,
GITEA_MCP_ORIGIN_ALLOWLIST, GITEA_MCP_PORT with sensible defaults.
Wire cfg.Port into main.go. TDD: tests written first, then impl.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 20:19:31 +02:00
Mathias Bergqvist
a77fa7506b feat: initial scaffold with /healthz
Go module gitea.d-ma.be/mathias/gitea-mcp, minimal HTTP server with a
/healthz probe, Taskfile build targets, and .gitignore/README updates.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 20:13:41 +02:00