Skip to content

context-machine-lab/Beamer-MCP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Beamer MCP Server

A Model Context Protocol (MCP) server for creating professional slides and posters using LaTeX Beamer. This server enables AI assistants like Claude to generate beautiful presentations and research posters programmatically.

Features

  • Create Presentations: Generate Beamer slide decks with customizable themes
  • Create Posters: Build research posters using beamerposter
  • Multiple Themes: Support for all standard Beamer themes and color schemes
  • Flexible Content: Add slides, sections, columns, images, and custom frames
  • LaTeX Compilation: Compile documents to PDF directly
  • Easy Integration: Works seamlessly with Claude and other MCP-compatible clients

Prerequisites

  • Node.js (v18 or higher)
  • LaTeX distribution with pdflatex (e.g., TeX Live, MiKTeX)
  • For posters: beamerposter package

Installing LaTeX

Ubuntu/Debian:

sudo apt-get install texlive-latex-extra texlive-fonts-recommended

macOS:

brew install --cask mactex

Windows: Download and install MiKTeX or TeX Live

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/Beamer-MCP.git
cd Beamer-MCP
  1. Install dependencies:
npm install
  1. Build the server:
npm run build

Configuration

Claude Desktop Configuration

Add to your Claude Desktop config file (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "beamer": {
      "command": "node",
      "args": ["/absolute/path/to/Beamer-MCP/dist/index.js"],
      "env": {
        "BEAMER_OUTPUT_DIR": "/path/to/output/directory"
      }
    }
  }
}

Environment Variables

  • BEAMER_OUTPUT_DIR: Directory where .tex and .pdf files will be saved (defaults to current working directory)

Available Tools

1. create_presentation

Create a new Beamer presentation.

Parameters:

  • id (required): Unique identifier for the presentation
  • title (required): Presentation title
  • author: Author name
  • date: Date (defaults to \today)
  • institute: Institution name
  • theme: Beamer theme (default: "Madrid")
  • colorTheme: Color theme

Example:

{
  "id": "my-talk",
  "title": "Introduction to AI",
  "author": "John Doe",
  "theme": "Copenhagen",
  "colorTheme": "dolphin"
}

2. create_poster

Create a new Beamer poster.

Parameters:

  • id (required): Unique identifier for the poster
  • title (required): Poster title
  • author: Author name
  • institute: Institution name
  • size: Paper size (default: "a0paper")
  • orientation: "portrait" or "landscape" (default: "portrait")

3. add_slide

Add a simple slide with title and content.

Parameters:

  • id (required): Document identifier
  • title (required): Slide title
  • content (required): Slide content in LaTeX

Example:

{
  "id": "my-talk",
  "title": "Key Points",
  "content": "\\begin{itemize}\n  \\item First point\n  \\item Second point\n  \\item Third point\n\\end{itemize}"
}

4. add_section

Add a section divider to organize your presentation.

Parameters:

  • id (required): Document identifier
  • title (required): Section title

5. add_columns

Add a slide with multiple columns.

Parameters:

  • id (required): Document identifier
  • title (required): Slide title
  • columns (required): Array of column objects with width and content

Example:

{
  "id": "my-talk",
  "title": "Comparison",
  "columns": [
    {
      "width": "0.5\\textwidth",
      "content": "Left column content"
    },
    {
      "width": "0.5\\textwidth",
      "content": "Right column content"
    }
  ]
}

6. add_image

Add a slide with an image.

Parameters:

  • id (required): Document identifier
  • title (required): Slide title
  • imagePath (required): Path to the image file
  • width: Image width (default: "0.8\textwidth")
  • caption: Image caption

7. add_frame

Add a custom frame with full LaTeX control.

Parameters:

  • id (required): Document identifier
  • content (required): Full frame content in LaTeX

8. save_document

Save the document to a .tex file.

Parameters:

  • id (required): Document identifier
  • filename (required): Output filename (without .tex extension)

9. compile_latex

Compile the LaTeX document to PDF.

Parameters:

  • id (required): Document identifier
  • filename (required): Filename to compile

10. list_themes

List all available Beamer themes and color themes.

Usage Examples

Creating a Simple Presentation

User: Create a presentation about Python programming with 3 slides

Claude will use the tools to:
1. create_presentation with appropriate metadata
2. add_section for "Introduction"
3. add_slide for each topic
4. save_document to create the .tex file
5. compile_latex to generate the PDF

Creating a Research Poster

User: Create an A0 portrait research poster about climate change

Claude will use the tools to:
1. create_poster with the specified size and orientation
2. add_frame with custom column layout for poster sections
3. save_document and compile_latex

Themes

Presentation Themes

Madrid, Berlin, Copenhagen, Darmstadt, Frankfurt, Hannover, Ilmenau, Luebeck, Malmoe, Marburg, Montpellier, PaloAlto, Pittsburgh, Rochester, Singapore, Szeged, Warsaw, and more.

Color Themes

default, albatross, beaver, beetle, crane, dolphin, dove, fly, lily, orchid, rose, seagull, seahorse, whale, wolverine

Use the list_themes tool to see all available options.

Development

Building

npm run build

Watching for Changes

npm run watch

Running Locally

npm start

Examples

See the examples/ directory for complete examples:

  • simple-presentation.md: Basic presentation example
  • poster-example.md: Research poster example

Troubleshooting

PDF Compilation Fails

  • Ensure pdflatex is installed and in your PATH
  • Check that all referenced images exist
  • Review LaTeX errors in the compilation output

MCP Server Not Responding

  • Check Claude Desktop config file syntax
  • Verify the absolute path to dist/index.js
  • Restart Claude Desktop after configuration changes

Missing Packages

Some LaTeX features require additional packages. Install the full TeX Live distribution:

sudo apt-get install texlive-full  # Ubuntu/Debian

Contributing

Contributions are welcome! Please feel free to submit issues and pull requests.

License

MIT License - see LICENSE file for details

Resources

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •