{"_id":"@mjyoo2/overleaf-mcp","name":"@mjyoo2/overleaf-mcp","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@mjyoo2/overleaf-mcp","version":"1.0.0","description":"MCP server that lets AI assistants read Overleaf projects, parse LaTeX document structure, and push section-level edits back via Git.","type":"module","main":"overleaf-mcp-server.js","bin":{"overleaf-mcp":"overleaf-mcp-server.js"},"scripts":{"start":"node overleaf-mcp-server.js"},"dependencies":{"@modelcontextprotocol/sdk":"^1.0.0"},"engines":{"node":">=18.0.0"},"author":{"name":"Minjong Yoo","url":"https://github.com/mjyoo2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/mjyoo2/OverleafMCP.git"},"bugs":{"url":"https://github.com/mjyoo2/OverleafMCP/issues"},"homepage":"https://github.com/mjyoo2/OverleafMCP#readme","keywords":["mcp","mcp-server","model-context-protocol","overleaf","latex","claude","claude-desktop","anthropic","ai-tools"],"license":"MIT","_id":"@mjyoo2/overleaf-mcp@1.0.0","gitHead":"7b8fd0b82a9a0d515118935b0a410ddb98267f51","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-fKgj2SzAwaN4YGcNhQUQQohZ/N8zJfDU5/ZqNY3exwgom/pTjl5L5TqqcZhFsk8/uBT6oHlRwma1Q4GH2r5W+Q==","shasum":"1401dcece3eefed4d837b2aeb3b648cf36365c59","tarball":"https://registry.npmjs.org/@mjyoo2/overleaf-mcp/-/overleaf-mcp-1.0.0.tgz","fileCount":4,"unpackedSize":34667,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAD/GMVr+PZ7ukIrfrMi8Z8R22UnLTdto7ZVQ4NIPrv4AiBRzBzhTydcfGfDqftmyOO0Wg6jClp5mJOPsezh4/QBKg=="}]},"_npmUser":{"name":"mjyoo2","email":"mjyoo222@gmail.com"},"directories":{},"maintainers":[{"name":"mjyoo2","email":"mjyoo222@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/overleaf-mcp_1.0.0_1777827550745_0.3625248169628421"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-03T16:59:10.656Z","1.0.0":"2026-05-03T16:59:10.894Z","modified":"2026-05-03T16:59:11.094Z"},"maintainers":[{"name":"mjyoo2","email":"mjyoo222@gmail.com"}],"description":"MCP server that lets AI assistants read Overleaf projects, parse LaTeX document structure, and push section-level edits back via Git.","homepage":"https://github.com/mjyoo2/OverleafMCP#readme","keywords":["mcp","mcp-server","model-context-protocol","overleaf","latex","claude","claude-desktop","anthropic","ai-tools"],"repository":{"type":"git","url":"git+https://github.com/mjyoo2/OverleafMCP.git"},"author":{"name":"Minjong Yoo","url":"https://github.com/mjyoo2"},"bugs":{"url":"https://github.com/mjyoo2/OverleafMCP/issues"},"license":"MIT","readme":"# Overleaf MCP Server\n\nAn MCP (Model Context Protocol) server that provides access to Overleaf projects via Git integration. This allows Claude and other MCP clients to read LaTeX files, analyze document structure, extract content, and write files from and to Overleaf projects.\n\n## Features\n\n- 📄 **File Management**: List, read, and write files from and to Overleaf projects\n- 📋 **Document Structure**: Parse LaTeX sections and subsections\n- 🔍 **Content Extraction**: Extract specific sections by title\n- 📊 **Project Summary**: Get overview of project status and structure\n- 🏗️ **Multi-Project Support**: Manage multiple Overleaf projects\n\n## Quick Start (recommended)\n\n> Requires `@mjyoo2/overleaf-mcp` to be published to npm. If you're reading this from a freshly-cloned repo and the package isn't on the registry yet, jump to [Local Development](#local-development) for a working local install.\n\nNo clone, no `npm install`. Add this block to your Claude Desktop config and restart Claude Desktop.\n\n**Config file location**\n\n| OS      | Path |\n|---------|------|\n| Windows | `%APPDATA%\\Claude\\claude_desktop_config.json` |\n| macOS   | `~/Library/Application Support/Claude/claude_desktop_config.json` |\n| Linux   | `~/.config/claude/claude_desktop_config.json` |\n\n**macOS / Linux**\n\n```json\n{\n  \"mcpServers\": {\n    \"overleaf\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@mjyoo2/overleaf-mcp\"],\n      \"env\": {\n        \"OVERLEAF_PROJECT_ID\": \"YOUR_OVERLEAF_PROJECT_ID\",\n        \"OVERLEAF_GIT_TOKEN\": \"YOUR_OVERLEAF_GIT_TOKEN\"\n      }\n    }\n  }\n}\n```\n\n**Windows** — Claude Desktop on Windows needs `cmd /c` to find `npx`:\n\n```json\n{\n  \"mcpServers\": {\n    \"overleaf\": {\n      \"command\": \"cmd\",\n      \"args\": [\"/c\", \"npx\", \"-y\", \"@mjyoo2/overleaf-mcp\"],\n      \"env\": {\n        \"OVERLEAF_PROJECT_ID\": \"YOUR_OVERLEAF_PROJECT_ID\",\n        \"OVERLEAF_GIT_TOKEN\": \"YOUR_OVERLEAF_GIT_TOKEN\"\n      }\n    }\n  }\n}\n```\n\nRestart Claude Desktop. The `overleaf` tools should appear in the 🔧 menu.\n\n## Getting Overleaf Credentials\n\n1. **Project ID** — open your Overleaf project; the ID is in the URL: `https://www.overleaf.com/project/[PROJECT_ID]`\n2. **Git Token** — Overleaf → Account Settings → Git Integration → \"Create Token\"\n\n## Configuration Reference\n\nThe server picks the **first** matching configuration source:\n\n1. **Env vars (single project)** — `OVERLEAF_PROJECT_ID` + `OVERLEAF_GIT_TOKEN`. Optional: `OVERLEAF_PROJECT_NAME` for the display name.\n2. **Token from a file** — set `OVERLEAF_PROJECT_ID` together with `OVERLEAF_GIT_TOKEN_FILE=/path/to/token.txt` (instead of `OVERLEAF_GIT_TOKEN`). Useful when you don't want the token in the Claude Desktop JSON. The file is read once at startup and any trailing whitespace/newline is trimmed.\n3. **Multi-project file** — `OVERLEAF_PROJECTS_CONFIG=/absolute/path/projects.json`.\n4. **User config dir** — `projects.json` in:\n   - Windows: `%APPDATA%\\overleaf-mcp\\projects.json`\n   - macOS / Linux: `$XDG_CONFIG_HOME/overleaf-mcp/projects.json` (defaults to `~/.config/overleaf-mcp/projects.json`)\n5. **Working directory** — `./projects.json`\n6. **Package directory** — `projects.json` next to the server script (legacy, for clone-based installs).\n\nWhen env vars are set and a file is also present, env vars win and a notice is logged to stderr so the shadowing is visible.\n\n### `projects.json` schema (multi-project)\n\n```json\n{\n  \"projects\": {\n    \"default\": {\n      \"name\": \"Main Paper\",\n      \"projectId\": \"...\",\n      \"gitToken\": \"olp_...\"\n    },\n    \"paper2\": {\n      \"name\": \"Second Paper\",\n      \"projectId\": \"...\",\n      \"gitToken\": \"olp_...\"\n    }\n  }\n}\n```\n\nThen specify the project in tool calls: `projectName: \"paper2\"`.\n\n## Local Development\n\nIf you want to hack on the server, test changes before publishing, or use it without the npm package being available, you have three local-install options.\n\n### Option 1 — Run the cloned script directly\n\n```bash\ngit clone https://github.com/mjyoo2/OverleafMCP.git\ncd OverleafMCP\nnpm install\n```\n\nThen point Claude Desktop at the script and pass credentials via env vars (the same loader path the npm package uses):\n\n```json\n{\n  \"mcpServers\": {\n    \"overleaf\": {\n      \"command\": \"node\",\n      \"args\": [\"/absolute/path/to/OverleafMCP/overleaf-mcp-server.js\"],\n      \"env\": {\n        \"OVERLEAF_PROJECT_ID\": \"...\",\n        \"OVERLEAF_GIT_TOKEN\": \"olp_...\"\n      }\n    }\n  }\n}\n```\n\nOn Windows, `args` should use `\"C:\\\\Users\\\\you\\\\OverleafMCP\\\\overleaf-mcp-server.js\"`.\n\nIf you'd rather use a multi-project file:\n\n```bash\ncp projects.example.json projects.json   # then edit it\n```\n\n`projects.json` next to the script is the lowest-priority fallback, so this still works without env vars.\n\n### Option 2 — Test the would-be npm package via a local tarball\n\nThis validates the same code path users will hit after `npm publish` (excluding registry resolution):\n\n```bash\nnpm pack\n# → mjyoo2-overleaf-mcp-0.2.0.tgz\n```\n\nPoint Claude Desktop at the tarball — `npx` accepts a file path:\n\n```json\n{\n  \"mcpServers\": {\n    \"overleaf\": {\n      \"command\": \"cmd\",\n      \"args\": [\"/c\", \"npx\", \"-y\", \"/absolute/path/to/mjyoo2-overleaf-mcp-0.2.0.tgz\"],\n      \"env\": {\n        \"OVERLEAF_PROJECT_ID\": \"...\",\n        \"OVERLEAF_GIT_TOKEN\": \"olp_...\"\n      }\n    }\n  }\n}\n```\n\n(Drop the `cmd /c` wrapper on macOS / Linux: `\"command\": \"npx\", \"args\": [\"-y\", \"/path/to/...tgz\"]`.)\n\n### Option 3 — Smoke-test the MCP protocol from the shell\n\nNo Claude Desktop required:\n\n```bash\nOVERLEAF_PROJECT_ID=... OVERLEAF_GIT_TOKEN=... node overleaf-mcp-server.js\n```\n\nYou should see `Overleaf MCP server running on stdio` on stderr. The process stays open waiting for JSON-RPC on stdin; Ctrl+C to exit.\n\n## Available Tools\n\n### `list_projects`\nList all configured projects.\n\n### `list_files`\nList files in a project (default: .tex files).\n- `extension`: File extension filter (optional)\n- `projectName`: Project identifier (optional, defaults to \"default\")\n\n### `read_file`\nRead a specific file from the project.\n- `filePath`: Path to the file (required)\n- `projectName`: Project identifier (optional)\n\n### `get_sections`\nGet all sections from a LaTeX file.\n- `filePath`: Path to the LaTeX file (required)\n- `projectName`: Project identifier (optional)\n\n### `get_section_content`\nGet content of a specific section.\n- `filePath`: Path to the LaTeX file (required)\n- `sectionTitle`: Title of the section (required)\n- `projectName`: Project identifier (optional)\n\n### `status_summary`\nGet a comprehensive project status summary.\n- `projectName`: Project identifier (optional)\n\n### `write_file`\nWrite the full content of a file to the project.\n- `filePath`: Path to the file (required)\n- `content`: Content to write to the file (required)\n- `commitMessage`: Commit message (required)\n- `projectName`: Project identifier (optional)\n\n### `write_section`\nWrite the content of a specific section to the project.\n- `filePath`: Path to the file (required)\n- `sectionTitle`: Title of the section (required)\n- `newContent`: Replacement content for the section, including the section heading (required)\n- `commitMessage`: Commit message (required)\n- `projectName`: Project identifier (optional)\n\n## Usage Examples\n\n```\n# List all projects\nUse the list_projects tool\n\n# Get project overview\nUse status_summary tool\n\n# Read main.tex file\nUse read_file with filePath: \"main.tex\"\n\n# Get Introduction section\nUse get_section_content with filePath: \"main.tex\" and sectionTitle: \"Introduction\"\n\n# List all sections in a file\nUse get_sections with filePath: \"main.tex\"\n\n# Write the full content of a file to the project\nUse write_file with filePath: \"main.tex\", content: \"...\", commitMessage: \"...\"\n\n# Write the content of a specific section to the project\nUse write_section with filePath: \"main.tex\", sectionTitle: \"Introduction\", newContent: \"\\\\section{Introduction}\\n...\", commitMessage: \"...\"\n```\n\n## Security Notes\n\n- The Overleaf Git token grants full read/write access to your project — treat it like a password.\n- Prefer `OVERLEAF_GIT_TOKEN_FILE` over inlining the token in the Claude Desktop JSON if your config file is backed up or synced.\n- `projects.json` is `.gitignore`d in this repo. Never commit real project IDs or Git tokens.\n- File paths supplied through MCP tool calls are restricted to the cloned project directory; `..` traversal and absolute paths are rejected.\n\n## License\n\nMIT License\n","readmeFilename":"README.md","_rev":"1-2f3f8905976da30682ea93904eb8c810"}