Gamma MCP Server

by nickloveinvesting

Not rated
GitHub

About

Integrates with the Gamma API to generate presentations from prompts.

Details

Author
nickloveinvesting
Categories
Productivity, Other, API

Setup

Install Gamma MCP Server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/nickloveinvesting/gamma-mcpserver

Follow the installation instructions in the repository README, then restart your MCP client.

This document guides you through setting up and running the Gamma MCP (Model Context Protocol) server, which allows you to generate presentations using the Gamma API directly from MCP clients like Anthropic's Claude for Desktop.

Gammais an AI-powered platform designed to help users create various types of content, with a strong focus on presentations. It leverages artificial intelligence to automatically generate slides, suggest text, and incorporate imagery, allowing for rapid development of polished presentations from simple prompts or existing documents. This MCP server specifically interacts with Gamma's API to bring this presentation generation capability into environments like Claude for Desktop. Check out theGamma API docsto learn more.

This server exposes a tool to an MCP client (like Claude for Desktop) that can take a prompt and various parameters to generate a presentation using the Gamma API. The server will return a link to the generated presentation.

Model Context Protocol servers can provide three main types of capabilities:

- Resources: File-like data that can be read by clients (like API responses or file contents).
- Tools: Functions that can be called by the LLM (with user approval).
- Prompts: Pre-written templates that help users accomplish specific tasks.

This server primarily focuses on providing aTool.

This quickstart assumes you have familiarity with:

- Node.js and TypeScript.
- LLMs like Anthropic's Claude.
- Basic command-line usage.

- Node.js (v16 or higher recommended).
- npm (Node Package Manager) or yarn.
- Access to the Gamma API. You'll need an API key, don't have one? Check out the
Gamma API docsto get one.
-

Clone the Repository / Get the Code:If this project is in a Git repository, clone it:

git clone git@github.com:gamma-app/gamma-mcp-server.git cd gamma-mcp-server

Initialize Your Node.js Project (if not cloned):If you created a new directory, initialize apackage.jsonfile:

Install Dependencies:You'll need the MCP SDK, Zod for validation, node-fetch for API calls, TypeScript, and ts-node to run TypeScript directly.

npm install @modelcontextprotocol/sdk zod node-fetch typescript ts-node @types/node # or # yarn add @modelcontextprotocol/sdk zod node-fetch typescript ts-node @types/node

Configure TypeScript:You might want to adjust thetsconfig.jsonto suit your preferences, but the default should work. EnsuremoduleResolutionis set to"node"or"node16"/"nodenext"andmoduleis compatible (e.g."commonjs"if running withts-nodein a CommonJS context, or adjust for ES Modules). The providedsrc/index.tsuses ES module syntax (import ... from). A commontsconfig.jsonfor ES Modules with Node.js might include:

{ "compilerOptions": { "target": "ES2020", "module": "ESNext", "moduleResolution": "node", "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "strict": true, "skipLibCheck": true, "outDir": "./dist" // Optional: if you plan to compile }, "include": ["src//"], "exclude": ["node_modules"] }

Also, in yourpackage.json, add"type": "module"if you are using ES Modules.

API Key Configuration:The server requires your Gamma API key. We use thedotenvpackage to load this key from a.envfile in the project root.
- Create a file named.envin the root of your project (e.g., alongside yourpackage.json).
- Add your Gamma API key to this file like so:

GAMMA_API_KEY="your_actual_gamma_api_key_here"

IMPORTANT:The.envfile is included in the project's.gitignorefile, so itWILL NOTbe committed to your Git repository. This is crucial for keeping your API key secret. Do not remove.envfrom.gitignoreor commit your API key directly into your codebase.

If theGAMMA_API_KEYis not found in the environment (e.g., if the.envfile is missing or the key isn't set), the server will log a fatal error and exit upon starting.

Understanding the Server Code (src/index.ts)

Let's break down the key parts of thesrc/index.tsfile:

import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import { z } from "zod"; import fetch from "node-fetch";

These lines import the necessary MCP server classes, Zod for schema definition and validation, andnode-fetchfor making HTTP requests.

const GAMMA_API_URL = "https://api.gamma.app/public-api/v0.1/generate"; const GAMMA_API_KEY = "YOUR_GAMMA_API_KEY_HERE"; // Replace or use env var

This sets up the base URL for the Gamma API and the API key.

generatePresentationHelper Function:Thisasyncfunction is responsible for making the POST request to the Gamma API with the provided parameters and handling the response or errors.

const server = new McpServer({ name: "gamma-presentation", version: "1.0.0", capabilities: { resources: {}, tools: {}, }, });

This initializes a new MCP server with a name and version.

server.tool( "generate-presentation", "Generate a presentation using the Gamma API...", { / Zod schema for parameters / }, async (params) => { / Tool execution logic / } );

- "generate-presentation": The name of the tool that clients will call.
- "Generate a presentation...": A description of what the tool does. This is important for the LLM to understand how and when to use the tool.
-
Schema (zodobject):Defines the input parameters the tool expects (e.g.,inputText,tone,audience).zodis used to describe the type, whether it's optional, and provide a description for each parameter.

- inputText: The main topic or prompt.
- tone: Optional, e.g., 'humorous and sarcastic'.
- audience: Optional, e.g., 'students'.
- textAmount: Optional, 'short', 'medium', or 'long'.
- textMode: Optional, 'generate' or 'summarize'.
- numCards: Optional, number of slides (1-20).
- And others likeimageModel,imageStyle,editorMode,additionalInstructions.

async function main() { const transport = new StdioServerTransport(); await server.connect(transport); console.error("Gamma MCP Server running on stdio"); } main().catch(/ ... /);

This function sets up the server to communicate over standard input/output (stdio) and starts it.
-

Set theGAMMA_API_KEYEnvironment Variable:Before running the server, ensure you have set theGAMMA_API_KEYenvironment variable as described in the "API Key Configuration" section above.

Start the Server:With the environment variable set, you can run the server usingts-node:

Alternatively, you can add a script to yourpackage.json:

// package.json "scripts": { "start": "ts-node src/index.ts", // if you compile to JS first: // "build": "tsc", // "start:prod": "node dist/index.js" },

The server is now running and waiting for an MCP client to connect via stdio.

Testing Your Server with Claude for Desktop

To use this server with Claude for Desktop, you need to configure Claude for Desktop to know how to launch your server.
-

Install Claude for Desktop:Make sure you have Claude for Desktop installed. You can get it from the official source. Ensure it's updated to the latest version.

Locate Claude for Desktop Configuration File:The configuration file is typically located at:

- macOS:~/Library/Application Support/Claude/claude_desktop_config.json
-
Windows:%APPDATA%\Claude\claude_desktop_config.json(e.g.,C:\Users\<YourUser>\AppData\Roaming\Claude\claude_desktop_config.json)
-
Linux:~/.config/Claude/claude_desktop_config.json

If the file or directories don't exist, create them.

Configure Your Server inclaude_desktop_config.json:Openclaude_desktop_config.jsonin a text editor. Add your Gamma server to themcpServersobject.

Important:You need theabsolute pathto your project directory and tots-node(ornodeif you compile to JS).

- Finding absolute path to your project:Navigate to yourgamma-mcp-serverdirectory in the terminal and runpwd(macOS/Linux) orcd(Windows, then copy the path).
-
Finding absolute path tonpxorts-node:

- Fornpx: Runwhich npx(macOS/Linux) orwhere npx(Windows).
- Often,npxis used, which then findsts-nodein your project'snode_modules/.binor globally. If Claude has trouble withnpx, you might need to provide the direct path tots-node.
- A more robust way for thecommandmight be to use the absolute path to your Node.js executable, and then specifyts-nodeandsrc/index.tsas arguments, ensuring thecwd(Current Working Directory) is set correctly.

Here's an example configuration.You MUST replace/ABSOLUTE/PATH/TO/YOUR/gamma-mcp-serverwith the actual absolute path.

You will also need to ensure that theGAMMA_API_KEYenvironment variable is available to the process launched by Claude for Desktop. How to do this depends on your OS and how Claude for Desktop launches processes. Some common methods include:

- Setting the environment variable globally on your system.
- If Claude for Desktop is launched from a terminal whereGAMMA_API_KEYis already exported, it might inherit it.
- Modifying thecommandorargsinclaude_desktop_config.jsonto explicitly pass the environment variable if your shell/Node.js setup allows (e.g.,"command": "env", "args": ["GAMMA_API_KEY=your_key", "npx", "ts-node", ...]- this can be tricky and OS-dependent).
- Using a wrapper script as thecommandthat first sets the environment variable and then executesnpx ts-node src/index.ts.

A simple way for testing is often to ensureGAMMA_API_KEYis set in your user's global shell environment (e.g., in~/.bashrc,~/.zshrc, or system-wide environment variables on Windows) before launching Claude for Desktop.

{ "mcpServers": { "gamma-presentation-generator": { "command": "npx", // Or absolute path to npx, or node "args": [ "ts-node", // If command is 'npx' // If command is absolute path to node: // "/PATH/TO/gamma-mcp-server/node_modules/ts-node/dist/bin.js", "src/index.ts" ], "cwd": "/ABSOLUTE/PATH/TO/YOUR/gamma-mcp-server" // Current Working Directory for the server } } }

- "gamma-presentation-generator": This is the name you give to your server configuration within Claude. It can be anything descriptive.
- "command": The executable to run.npxis convenient as it resolvests-nodefrom your project. If this causes issues, use the absolute path to your Node.js executable.
- "args": Arguments passed to the command.

- Ifcommandisnpx, the first arg ists-node, followed by the path to your main server file (src/index.ts), relative to thecwd.
- Ifcommandis an absolute path tonode, args would be["/ABSOLUTE/PATH/TO/YOUR/gamma-mcp-server/node_modules/ts-node/dist/bin.js", "src/index.ts"]or similar, making surets-node's entry script is correctly referenced.

Save and Restart Claude for Desktop:Save theclaude_desktop_config.jsonfile and completely restart Claude for Desktop.

Test with Commands:Once Claude for Desktop restarts, it should attempt to connect to your server.

- Look for the tool icon (often a hammer знают) in the Claude for Desktop interface. Clicking it should show yourgenerate-presentationtool.
- Try prompting Claude:

- "Generate a presentation about the future of artificial intelligence."
- "Make a presentation on sustainable energy sources, targeting college students, make it medium length."
- "Use the gamma tool to create a short, humorous presentation for developers about the importance of documentation."

Claude should recognize the request, identify your tool, and (after your approval if configured) execute it. Your server (running in its own terminal or process) will then call the Gamma API, and the link to the presentation should appear in Claude's response.

When you ask a question in Claude for Desktop:
- The client (Claude for Desktop) sends your question to the Claude LLM.
- Claude analyzes the available tools (including yourgenerate-presentationtool) and decides if and how to use it.
- If Claude decides to use your tool, it sends a request to Claude for Desktop.
- Claude for Desktop executes the chosen tool by communicating with your MCP server (which it launched based onclaude_desktop_config.json) over stdio.
- Your server runs the tool logic (calls the Gamma API).
- The results (presentation URL or error) are sent back from your server to Claude for Desktop, then to the LLM.
- Claude formulates a natural language response incorporating the tool's output.
- The response is displayed to you!

- Server Not Detected by Claude for Desktop:*

- Double-check the absolute paths inclaude_desktop_config.jsonforcwdand potentiallycommand.
- Ensure your server name in the config (gamma-presentation-generatorin the example) is unique.
- Verify thatclaude_desktop_config.jsonis correctly formatted JSON.
- Make sure your server runs correctly on its own usingnpx ts-node src/index.tsbefore trying to integrate with Claude. Check for any errors in the server's console output.
- Ensure there are no firewalls or security software blockingnpxornodefrom executing or communicating.

- Check the console output of yourgamma-mcp-server(the terminal where you rannpx ts-node src/index.ts). It might show errors from the Gamma API or within the server logic.
- Ensure yourGAMMA_API_KEYis correct and has not expired.
- Verify network connectivity.

- Make sure the tool description insrc/index.ts(server.tool(...)) is clear and accurately describes what the tool does and its parameters. This helps the LLM decide when to use it.
- Ensure the parameter descriptions in the Zod schema are also clear.

- Ensuretypescriptandts-nodeare installed locally in your project (npm ls ts-node typescript).
- Check yourtsconfig.jsonfor compatibility with your Node.js version and module system (ESM vs CommonJS). If using ESM ("type": "module"inpackage.json), ensurets-nodeis compatible or usets-node-esm. The providedindex.tsuses ES module imports.

This guide should provide a comprehensive overview of setting up and using your Gamma MCP server. Happy presenting!

Generates PowerPoint presentations (PPTs) based on specified topics using the Gezhe API.

Product mockup rendering API. Upload PSD templates, render photorealistic mockups with 9 MCP tools including AI render.

Interact with the Umbraco CMS Management API for administrative tasks.

Apify-hosted MCP server for Webflow with 22+ tools. Sites, CMS collections, pages, content management, and publishing. No local setup needed.

Manage WordPress sites via the REST API. Enables AI assistants to handle content, posts, and site configurations.

Interact with Cloudinary's media management platform using natural language.

Dacast MCP Live Stream Server connects your AI tools to Dacast’s live streaming and video hosting APIs, so you can create and manage live streams, playlists, thumbnails, and simulcasts using simple natural-language prompts.

Zernio is a social media scheduling platform that lets you manage and publish content across all major platforms from a single API

Generate images using the Together AI API. Supports custom aspect ratios, save paths, and batch generation.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.