A powerful integration between Claude AI and LaTeX editors using Anthropic's Model Context Protocol (MCP). Enhance your academic writing, equation generation, document formatting, speculative fiction, and philosophical works with AI assistance directly in your LaTeX editor.
The Claude-LaTeX MCP Integration connects Claude's AI capabilities with LaTeX document preparation systems, creating a seamless workflow for researchers, students, creative writers, and academic authors. This project implements an MCP server that exposes LaTeX-specific tools and editor plugins that bring Claude's assistance directly into popular LaTeX editors.
- AI-Powered Equation Generation: Convert natural language descriptions to properly formatted LaTeX equations
- Document Structure Assistance: Get help organizing your academic papers with section suggestions and templates
- Intelligent Formatting: Automatically format LaTeX code according to best practices
- Citation Management: Generate and format BibTeX entries from paper references
- Academic Writing Support: Receive suggestions to improve clarity and adhere to academic writing standards
- Worldbuilding Documentation: Create structured LaTeX documents for developing fictional worlds with detailed sections for history, geography, magic systems, technology, and more
- Character Development Profiles: Generate comprehensive character profiles with customizable detail levels
- Dialogue Formatting: Format dialogue in various styles (novel, script, play) with special handling for non-human speech and thought text
- Timeline Visualization: Create sophisticated timelines in linear, branching, parallel, or circular formats
- Argument Structure Templates: Generate properly structured philosophical arguments of various types (deductive, inductive, thought experiments, etc.)
- Concept Mapping: Create visual diagrams of philosophical concepts and their relationships
- Citation Formatting: Format citations according to philosophical traditions and academic standards
- Dialectical Structures: Support for thesis-antithesis-synthesis and other dialectical writing patterns
The integration consists of several components:
- LaTeX MCP Server: Core component that handles communication between Claude and LaTeX editors
- Editor Plugins: Interface components for popular LaTeX editors (Overleaf, TeXStudio, VS Code)
- Claude MCP Client: Leverages Claude's capabilities through the Model Context Protocol
- LaTeX Tools: Specialized tools for equation generation, document formatting, and more
- Extensions: Specialized modules for creative writing and philosophical content
The structure below shows the intended layout of the project. Several of the listed directories are not yet implemented in this repository and represent future work.
claude-latex-mcp/
├── config/ # Configuration files
│ ├── default.json # Default configuration
│ └── test.json # Test configuration
├── dist/ # Compiled JavaScript files
├── docs/ # Documentation
│ ├── images/ # Diagrams and screenshots
│ ├── api/ # API documentation
│ └── guides/ # User guides
├── examples/ # Example usage and templates
│ ├── academic/ # Academic writing examples
│ ├── creative/ # Speculative fiction examples
│ └── philosophy/ # Philosophical writing examples
├── scripts/ # Utility scripts
├── src/ # Source code
│ ├── core/ # Core MCP server implementation
│ │ ├── server.ts # Main server implementation
│ │ ├── client.ts # Client implementation
│ │ └── protocols/ # MCP protocol implementation
│ ├── extensions/ # Specialized extensions
│ │ ├── speculative/ # Speculative fiction extension
│ │ └── philosophy/ # Philosophical writing extension
│ ├── plugins/ # Editor plugins
│ │ ├── overleaf/ # Overleaf plugin
│ │ ├── texstudio/ # TeXStudio plugin
│ │ └── vscode/ # VS Code extension
│ ├── tools/ # Tool implementations
│ │ ├── equation/ # Equation generation tool
│ │ ├── document/ # Document structure tool
│ │ ├── format/ # LaTeX formatting tool
│ │ ├── worldbuilding/ # Worldbuilding tools
│ │ ├── character/ # Character development tools
│ │ ├── argument/ # Philosophical argument tools
│ │ └── citation/ # Citation tools
│ └── utils/ # Utility functions
├── tests/ # Tests
│ ├── unit/ # Unit tests
│ ├── integration/ # Integration tests
│ └── fixtures/ # Test fixtures
├── .env.example # Example environment variables
├── .gitignore # Git ignore file
├── package.json # NPM package config
├── tsconfig.json # TypeScript configuration
└── README.md # This file
- Node.js 16+
- Python 3.10+ (optional, for some tools)
- Anthropic API key
- LaTeX distribution (TeX Live, MiKTeX, etc.)
# Clone the repository
git clone https://github.com/yourusername/claude-latex-mcp.git
cd claude-latex-mcp
# Install dependencies
npm install
# Configure your environment
cp .env.example .env
# Edit .env to add your Anthropic API key
# See `src/ENVIRONMENT.md` for details on the required variables
# Start the MCP server
npm run server
The Overleaf plugin can be installed as a browser extension:
- Go to Chrome/Firefox extension store
- Search for "Claude LaTeX Assistant"
- Install the extension
- Configure the MCP server URL in the extension settings
- Open VS Code
- Go to Extensions marketplace
- Search for "Claude LaTeX Assistant"
- Install and reload VS Code
- Configure the MCP server URL in extension settings
In your LaTeX editor, highlight text describing an equation and use the context menu:
I need an equation for the normal distribution probability density function
Claude will generate:
\begin{equation}
f(x | \mu, \sigma^2) = \frac{1}{\sqrt{2\pi\sigma^2}} e^{-\frac{(x-\mu)^2}{2\sigma^2}}
\end{equation}
Ask Claude to help structure your document:
Help me organize a research paper on quantum computing algorithms
Claude will generate a document structure with appropriate sections.
Generate a comprehensive worldbuilding document for your speculative fiction setting:
Tool: create-worldbuilding-document
Parameters:
worldName: "Eldoria"
worldType: "fantasy"
keyElements: ["Magic System", "Political Factions", "Religions", "Ancient History"]
description: "A high fantasy world where magic is tied to celestial cycles and ancient ruins hold forgotten technologies."
Generate a detailed character profile for a speculative fiction character:
Tool: create-character-profile
Parameters:
characterName: "Admiral Zara Vex"
characterType: "antagonist"
basicDescription: "A brilliant military strategist who believes the only path to galactic peace is through unified authoritarian control."
worldContext: "In a space opera setting where multiple species vie for control of wormhole networks."
detailLevel: "comprehensive"
Create a structured philosophical argument or thought experiment:
Tool: create-philosophical-argument
Parameters:
argumentType: "thought-experiment"
title: "The Ship of Theseus in Digital Consciousness"
premise: "If a human mind is uploaded to a digital substrate and then gradually replaced neuron by neuron, at what point does it cease to be the original consciousness?"
tradition: "analytic"
includeCounterarguments: true
Create a visual map of philosophical concepts and their relationships:
Tool: create-concept-map
Parameters:
centralConcept: "Existential Freedom"
relatedConcepts: ["Responsibility", "Anxiety", "Authenticity", "Bad Faith", "Choice"]
relationships: [
{ "from": "Existential Freedom", "to": "Responsibility", "type": "derives_from", "description": "Freedom necessitates responsibility" },
{ "from": "Existential Freedom", "to": "Anxiety", "type": "generates", "description": "The burden of choice creates anxiety" }
]
diagramType: "tikz-mindmap"
- Basic MCP server implementation
- Equation generation tool
- Document structure tool
- LaTeX formatting tool
- Speculative fiction extension (basic)
- Philosophical writing extension (basic)
- Initial Overleaf plugin
- Basic testing and validation
- Citation management tool
- Academic writing assistance
- Advanced equation generation with multi-line support
- Enhanced speculative fiction tools (narrative structure, worldbuilding)
- Advanced philosophical argument templates and analysis
- VS Code and TeXStudio plugins
- User preference management
- Collaborative writing support
- Document review and feedback
- Interactive equation editing
- Integration with reference managers
- Advanced styling options for different journals/conferences
- Specialized visualization tools for epistemological frameworks
- Narrative structure analysis for fiction
- Performance optimizations and caching
- Discipline-specific extensions
- Integration with academic databases
- Journal/conference submission preparation
- Custom package development assistance
- Template sharing community
- Cloud-hosted version with enterprise features
- Support for non-Western philosophical traditions
-
Setup Development Environment
- Install MCP SDK and development tools
- Configure development servers and test environments
- Setup continuous integration pipeline
-
Core Server Implementation
- Implement basic MCP server with essential tools
- Develop equation generation with Claude integration
- Create document structure analysis capabilities
- Build LaTeX formatting and validation
-
Editor Integration
- Develop browser extension for Overleaf
- Create user interface components
- Implement communication with MCP server
- Test with various LaTeX document types
-
Extension Development
- Implement speculative fiction tools
- Develop philosophical writing assistants
- Create specialized templates for different genres and traditions
- Build concept visualization tools
-
Testing and Validation
- Create test suite for MCP server
- Validate equation generation with complex examples
- Test integration with various LaTeX editors
- Perform user testing with academic writers, fiction authors, and philosophers
Contributions are welcome! We especially need help with:
- Editor integrations for different LaTeX environments
- Additional templates for specialized documents
- Support for non-Western philosophical traditions
- Enhanced visualization options for worldbuilding
- Testing with different LaTeX editors and environments
Please see CONTRIBUTING.md for guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.
- Anthropic for developing Claude and the Model Context Protocol
- The LaTeX community for their tools and resources
- All contributors to this project