overleaf-forge 2.7.1 → 2.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -3
- package/overleaf-mcp-server.js +8 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -33,14 +33,17 @@ Editing a LaTeX project through an AI normally means one of two bad options: pas
|
|
|
33
33
|
|
|
34
34
|
## Install
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
**Recommended: npx.** Nothing to clone, nothing to keep updated by hand. The whole install is a few lines of JSON in your MCP client, plus two values from Overleaf.
|
|
37
|
+
|
|
38
|
+
1. Get your two values: an Overleaf **git token** (Account Settings → Git Integration → create token) and your **project id** (the `<ID>` in `https://www.overleaf.com/project/<ID>`).
|
|
39
|
+
2. Add this block to your client's config file (locations in the table below):
|
|
37
40
|
|
|
38
41
|
```json
|
|
39
42
|
{
|
|
40
43
|
"mcpServers": {
|
|
41
44
|
"overleaf": {
|
|
42
45
|
"command": "npx",
|
|
43
|
-
"args": ["-y", "overleaf-forge"],
|
|
46
|
+
"args": ["-y", "overleaf-forge@latest"],
|
|
44
47
|
"env": {
|
|
45
48
|
"OVERLEAF_GIT_TOKEN": "olp_xxxxxxxxxxxxxxxxxxxxxxxx",
|
|
46
49
|
"OVERLEAF_PROJECT_ID": "0123456789abcdef01234567"
|
|
@@ -50,7 +53,17 @@ For most clients the whole install is a few lines of JSON: point the client at t
|
|
|
50
53
|
}
|
|
51
54
|
```
|
|
52
55
|
|
|
53
|
-
|
|
56
|
+
3. Restart the client (or reload its MCP servers). That's it.
|
|
57
|
+
|
|
58
|
+
`npx` fetches and runs the published package on demand. The token and project id are the entire setup for a single project, with no config file (this is **env-only mode**). `@latest` means each client restart picks up the newest published version automatically; pin `overleaf-forge@2.7.1` instead to freeze a version. For multiple projects, per-project contexts, or the SSA bootstrap, see [Configuration](#configuration).
|
|
59
|
+
|
|
60
|
+
An MCP server is not an app you launch yourself: the client starts it as a subprocess, so "installing" it just means making its command available to the client. The `npx` form above needs no install step. If you would rather have a real command on your `PATH`, install it globally:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npm install -g overleaf-forge
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
and set `"command": "overleaf-forge"` with no `args` (keep the same `env` block). A global install does not auto-update: refresh it yourself with `npm update -g overleaf-forge`. `npx` is recommended precisely because it skips that step.
|
|
54
67
|
|
|
55
68
|
To hack on the server instead, run it from source:
|
|
56
69
|
|
|
@@ -75,6 +88,20 @@ The `mcpServers` schema is identical across clients; only the file location diff
|
|
|
75
88
|
|
|
76
89
|
Restart the client (or reload its MCP servers) after editing, so it spawns the server with the new config.
|
|
77
90
|
|
|
91
|
+
## Updating
|
|
92
|
+
|
|
93
|
+
**As a user.** With `overleaf-forge@latest` in your config (the recommended form), restart the client or reload its MCP servers and it fetches the newest published version. If you pinned a version (`overleaf-forge@2.7.1`), change the number. If `npx` seems to keep running an old version, clear its cache with `npx clear-npx-cache` and restart. If you installed globally instead, update with `npm update -g overleaf-forge`.
|
|
94
|
+
|
|
95
|
+
**As the maintainer (publishing a new release).** From the repository:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
npm version patch # or minor / major; bumps package.json and tags
|
|
99
|
+
npm publish # enter your npm 2FA one-time code when prompted
|
|
100
|
+
git push --follow-tags # push the commit and the version tag
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Anyone on `@latest` picks the new version up on their next client restart.
|
|
104
|
+
|
|
78
105
|
## Configuration
|
|
79
106
|
|
|
80
107
|
Two modes, smallest first.
|
package/overleaf-mcp-server.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
ListToolsRequestSchema,
|
|
8
8
|
} from '@modelcontextprotocol/sdk/types.js';
|
|
9
9
|
import { readFile, writeFile, access, mkdir, readdir, stat, rm, rename, copyFile } from 'fs/promises';
|
|
10
|
-
import { existsSync, realpathSync } from 'fs';
|
|
10
|
+
import { existsSync, realpathSync, readFileSync } from 'fs';
|
|
11
11
|
import { promisify } from 'util';
|
|
12
12
|
import { execFile as execFileCallback } from 'child_process';
|
|
13
13
|
import path from 'path';
|
|
@@ -30,6 +30,12 @@ const execFile = promisify(execFileCallback);
|
|
|
30
30
|
// cache. Anything a user edits resolves user-copy-first, bundled-default-last.
|
|
31
31
|
const PACKAGE_DIR = __dirname;
|
|
32
32
|
|
|
33
|
+
// Single source of truth for the version: read it from the shipped package.json
|
|
34
|
+
// so `npm version` is the only place a release number changes. Fall back to '0.0.0'
|
|
35
|
+
// if package.json is somehow unreadable (never fatal).
|
|
36
|
+
let PKG_VERSION = '0.0.0';
|
|
37
|
+
try { PKG_VERSION = JSON.parse(readFileSync(path.join(PACKAGE_DIR, 'package.json'), 'utf-8')).version || PKG_VERSION; } catch { /* keep fallback */ }
|
|
38
|
+
|
|
33
39
|
// Expand a leading ~ to the user's home. Plain join elsewhere assumes absolute.
|
|
34
40
|
function expandHome(p) {
|
|
35
41
|
if (!p) return p;
|
|
@@ -927,7 +933,7 @@ async function readContext(projectKey, project) {
|
|
|
927
933
|
|
|
928
934
|
// MCP server
|
|
929
935
|
const server = new Server(
|
|
930
|
-
{ name: 'overleaf-forge', version:
|
|
936
|
+
{ name: 'overleaf-forge', version: PKG_VERSION },
|
|
931
937
|
{ capabilities: { tools: {} } }
|
|
932
938
|
);
|
|
933
939
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "overleaf-forge",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.2",
|
|
4
4
|
"description": "MCP server to read, edit, compile, and verify Overleaf/LaTeX projects over git: conflict-safe edits, figure upload, clean-build verification, citation and voice linting.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "overleaf-mcp-server.js",
|