forgejo-vault-mcp
Reads and writes an Obsidian vault repository hosted on Codeberg via the Forgejo/Gitea REST API, supporting file listing, note reading/searching, creating or appending notes, moving/deleting files, journal entries, and commit history.
Integrates with Forgejo's REST API to access an Obsidian vault repository, enabling tools to list files, read and search notes, create or replace notes, append to notes, move/delete notes, manage daily journals, and inspect note history.
Works with Gitea-hosted vault repositories through the Gitea/Forgejo REST API, providing note listing, reading, searching, writing, appending, moving, deletion, and commit-history operations.
Operates on an Obsidian vault stored in a git repository, providing tools to list, read, search, create, append, move, delete notes, manage daily journal entries, and inspect note history.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
forgejo-vault-mcp
A stateless MCP bridge for Obsidian vaults stored on Forgejo / Gitea / Codeberg. One file, zero dependencies, ~0 EUR/month on serverless.
If your Obsidian vault lives in a git repository, this project turns it into a Model Context Protocol server your AI assistant can read and (with your approval) write. Deploy it as a serverless function, register it as a custom connector, and your assistant can list, read, search and append to your vault from anywhere. Your notes stay in git the entire time; every write is a real commit.
How it works
graph LR
A["MCP client<br/>(Claude, Vibe, ...)"] -->|"HTTPS + Bearer key"| B["Serverless function<br/>forgejo-vault-mcp"]
B -->|"Forgejo REST API"| C[("Obsidian vault<br/>(git repository)")]Stateless: speaks MCP Streamable HTTP with plain JSON responses, so it runs on any scale-to-zero platform.
No dependencies: one JavaScript file, no npm packages, no build step.
Git-native: every write is one commit; history is your audit log.
Host-agnostic: defaults to Codeberg, works with any Forgejo or Gitea instance.
Related MCP server: Obsidian MCP Server
Tools
Tool | What it does |
| List vault files, optionally under one folder (paged: |
| Read a note; long notes come in parts ( |
| Read up to 50 notes in one call, within one shared size budget |
| Case-insensitive text search over all markdown notes and file names ( |
| Create or fully replace a note |
| Append to a note, creating it if missing |
| Append to today's daily note (timezone-aware, path template configurable) |
| Move or rename a note or attachment in one commit |
| Delete a note / create a folder via a |
| Commit history of a note |
| Vault overview and latest daily notes |
Every result is capped at about 40,000 characters and says how to get the rest, so results fit inside MCP client limits.
Deploy on Scaleway (about 10 minutes)
Serverless -> Functions -> Create: Node.js 20 or newer runtime, 256 MB, min scale 0, timeout 300 s.
Privacy: Public (the function guards itself with your Bearer key), HTTPS-only: Enabled, POST.
Paste
vault-mcp.jsinto the inline editor; handler string<filename>.handle.Set the environment variables below (mark secrets as Secrets).
Deploy, then run the smoke test.
Environment variables
Variable | Required | Default | Purpose |
| yes | - |
|
| yes (secret) | - | token with read/write on that repository |
| yes (secret) | - | Bearer key clients must present ( |
| no |
| any Forgejo/Gitea instance |
| no | repository default | branch to read and write |
| no |
| timezone for daily notes |
| no |
| daily-note path; must contain |
| no | off |
|
| no | generic guidance | instructions sent to the MCP client |
Smoke test
curl -s "$URL" -H "Authorization: Bearer $MCP_API_KEY" -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"vault_stats","arguments":{}}}'You should get a JSON-RPC result with your file counts. Without the header you get a 401.
Run it anywhere else
vault-mcp.js is also a standalone server (Node 20 or newer):
VAULT_REPO=me/vault FORGEJO_TOKEN=... MCP_API_KEY=... node vault-mcp.jsIt listens on 127.0.0.1:8787 (HOST, PORT to change) and speaks plain HTTP: put a TLS reverse proxy in front before exposing it. For other serverless platforms, call the exported handle({ httpMethod, headers, body }); it returns { statusCode, headers, body }.
Use with Claude
Claude Code
claude mcp add --transport http vault https://<your-function-url> \
--header "Authorization: Bearer <MCP_API_KEY>"claude.ai / Claude Desktop: Settings -> Connectors -> Add custom connector. Enter the function URL, choose No sign-in, and add a request header named authorization with the value Bearer <MCP_API_KEY>.
The read tools are marked read-only, so clients can pre-approve them and keep the writing tools on manual approval. Other clients (Vibe, ...) work the same way: function URL plus Bearer key.
Security model
The function URL is reachable by necessity; every request must carry
Authorization: Bearer <MCP_API_KEY>or it receives a 401 before the code touches the git host.Note paths are validated:
.and..segments, backslashes and control characters are rejected, and every request to the git host is checked to stay inside the vault repository. A prompt-injected note cannot steer a tool at another repository or API endpoint.Give
FORGEJO_TOKENaccess to the vault repository only (Forgejo: repository-scoped access token; on hosts without those, a dedicated account that is a collaborator on that one repository).Rotate
MCP_API_KEYon the platform and in your client to revoke access instantly.VAULT_READONLY=1turns the server into a read-only view.
How it stays fast and correct
The file list is cached per head commit and re-checked with one cheap request at most every 15 seconds, so notes pushed from another device show up without re-reading the whole tree.
Note content is cached by git blob id (which never changes). The first search downloads the vault as one archive; later searches only fetch what changed.
Writes are read-modify-write with the file's sha. If the note changed in between, the write is recomputed on top of the new version. If the host's answer is lost, the server checks whether the commit landed before sending it again, so a journal entry is never duplicated.
Limitations (honest ones)
All caches live in the memory of a warm instance; a cold start re-reads the file list, and the first search after it downloads the archive again.
Vaults over 32 MB (attachments included) skip the archive and read notes one by one; a search then has a 20-second budget per call and tells you if it could not cover everything (repeat the call to continue).
Search is plain substring matching per line: no regular expressions, no ranking.
move_notedoes not rewrite links in other notes.
Development
npm test # node --test, zero dependencies, runs against an in-memory fake ForgejoRules for changing this project are in AGENTS.md.
License
MIT - see LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Connect AI assistants to your GitHub-hosted Obsidian vault to seamlessly access, search, and analy…
Search and reason over your Obsidian-style Markdown vault, right from ChatGPT.
Operate GitHub from your AI assistant: repos, PRs, issues, Actions. Previews and read-only mode.
Search your Obsidian vault to quickly find notes by title or keyword, summarize related content, a…
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to read, write, search, and navigate Obsidian vault notes with support for CRUD operations, full-text search, graph navigation, daily notes, and frontmatter management.3,650 npm-
- AlicenseNot gradedqualityDmaintenanceEnables LLMs like Claude and ChatGPT to access and manage git-backed Obsidian vaults through tools for file operations, search, tags, and journal logging.17MIT
- AlicenseAqualityDmaintenanceProvides AI agents with direct filesystem access to an Obsidian vault for note management, task orchestration, context persistence, and git synchronization.2738 npm3MIT
- AlicenseNot gradedqualityDmaintenanceEnables agents to search, read, and write notes in an Obsidian vault, including creating and updating notes in an inbox and syncing changes with Gitea/GitHub.MIT