telegraph-mcp

NehoraiHadad/telegraph-mcp

3.2

If you are the rightful owner of telegraph-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The Telegraph MCP Server is a Model Context Protocol server that provides access to the Telegraph API, enabling AI assistants to manage Telegraph pages programmatically.

Tools
9
Resources
0
Prompts
0

Telegraph MCP Server

npm version License: MIT

An MCP (Model Context Protocol) server that exposes the Telegraph API as tools for Claude and other LLM clients. This allows AI assistants to create, edit, and manage Telegraph pages programmatically.

Related Projects

This is part of the Telegraph tools ecosystem:

ProjectDescriptionPackage
telegraph-mcp (this)MCP Server for AI assistants (TypeScript)npm
telegraph-mcp-pyMCP Server for AI assistants (Python)PyPI
telegraph-jsJavaScript/TypeScript librarynpm
telegraph-pyPython libraryPyPI

Quick Start

npx telegraph-mcp

Or add to Claude Code:

claude mcp add telegraph -- npx telegraph-mcp

Features

  • 13 Telegraph API tools covering all Telegraph functionality
  • Create and manage Telegraph accounts
  • Create, edit, and retrieve Telegraph pages
  • View statistics for pages
  • Markdown support - Write content in Markdown, automatically converted to Telegraph format
  • Templates - Pre-built templates for blog posts, documentation, articles, changelogs, and tutorials
  • Export/Backup - Export pages to Markdown or HTML, backup entire accounts
  • MCP Resources - Access Telegraph pages as MCP resources
  • MCP Prompts - Pre-defined prompts for common tasks

Installation

Option 1: Via npm (Recommended)

# With Claude Code
claude mcp add telegraph -- npx telegraph-mcp

# Or globally
npm install -g telegraph-mcp

Option 2: From Source

git clone https://github.com/NehoraiHadad/telegraph-mcp.git
cd telegraph-mcp
npm install
npm run build
claude mcp add telegraph -- node $(pwd)/dist/index.js

Usage with Claude Code

claude mcp add telegraph -- npx telegraph-mcp

Usage with Claude Desktop

Add this to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Linux: ~/.config/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "telegraph": {
      "command": "npx",
      "args": ["-y", "telegraph-mcp"]
    }
  }
}

Available Tools

Account Management

ToolDescriptionAuth Required
telegraph_create_accountCreate a new Telegraph accountNo
telegraph_edit_account_infoUpdate account informationYes
telegraph_get_account_infoGet account detailsYes
telegraph_revoke_access_tokenRevoke and regenerate access tokenYes

Page Management

ToolDescriptionAuth Required
telegraph_create_pageCreate a new Telegraph page (supports Markdown!)Yes
telegraph_edit_pageEdit an existing pageYes
telegraph_get_pageGet a page by pathNo
telegraph_get_page_listList all pages for an accountYes
telegraph_get_viewsGet view statistics for a pageNo

Templates

ToolDescriptionAuth Required
telegraph_list_templatesList all available page templatesNo
telegraph_create_from_templateCreate a page using a templateYes

Export & Backup

ToolDescriptionAuth Required
telegraph_export_pageExport a page to Markdown or HTMLNo
telegraph_backup_accountBackup all pages from an accountYes

Example Usage

Creating an Account

Use telegraph_create_account with:
- short_name: "MyBot"
- author_name: "AI Assistant"

This returns an access_token that you should save for future operations.

Creating a Page

Use telegraph_create_page with:
- access_token: "your_token_here"
- title: "My First Telegraph Page"
- content: "<p>Hello <b>world</b>!</p><p>This is my first Telegraph page.</p>"

Creating a Page with Markdown

Use telegraph_create_page with:
- access_token: "your_token_here"
- title: "My Markdown Page"
- content: "# Hello World\n\nThis is **bold** and *italic*.\n\n- List item 1\n- List item 2"
- format: "markdown"

Using Templates

Use telegraph_create_from_template with:
- access_token: "your_token_here"
- template: "blog_post"
- title: "My Blog Post"
- data: {
    "intro": "Welcome to my blog!",
    "sections": [
      {"heading": "First Section", "content": "Section content here"}
    ],
    "conclusion": "Thanks for reading!"
  }

Available templates: blog_post, documentation, article, changelog, tutorial

Content Format

The content parameter accepts:

  • Markdown (with format: "markdown"): "# Hello\n\n**Bold** and *italic*"
  • HTML strings: "<p>Hello <b>world</b></p>"
  • JSON Node arrays: [{"tag": "p", "children": ["Hello ", {"tag": "b", "children": ["world"]}]}]
Supported Markdown Syntax
SyntaxResult
# HeaderH3 heading
## SubheaderH4 heading
**bold**Bold text
*italic*Italic text
[text](url)Link
![alt](url)Image
- itemUnordered list
1. itemOrdered list
> quoteBlockquote
`code`Inline code
```code```Code block
---Horizontal rule
Supported HTML Tags

a, aside, b, blockquote, br, code, em, figcaption, figure, h3, h4, hr, i, iframe, img, li, ol, p, pre, s, strong, u, ul, video

Supported Attributes
  • href - for <a> tags
  • src - for <img>, <video>, <iframe> tags

MCP Resources

Access Telegraph pages as MCP resources:

telegraph://page/{path}

Example: telegraph://page/Sample-Page-12-15

MCP Prompts

Available prompts for guided workflows:

PromptDescription
create-blog-postGuide for creating a blog post
create-documentationGuide for creating documentation
summarize-pageSummarize an existing page

Development

# Install dependencies
npm install

# Build TypeScript
npm run build

# Run directly (for testing)
npm start

Testing with MCP Inspector

npx @modelcontextprotocol/inspector node dist/index.js

API Reference

This server implements all methods from the Telegraph API:

  1. createAccount - Create a new Telegraph account
  2. editAccountInfo - Update account information
  3. getAccountInfo - Get account details
  4. revokeAccessToken - Revoke access token
  5. createPage - Create a new page
  6. editPage - Edit an existing page
  7. getPage - Get a page
  8. getPageList - Get list of pages
  9. getViews - Get page view statistics

License

MIT