Skip to main content
Glama
Emlog MCP Server
by eraincc

Emlog MCP Server

GitHub License English 简体中文 繁體中文

An Emlog blog system integration service based on Model Context Protocol (MCP), allowing AI assistants to interact with Emlog blogs through standardized interfaces.

Features

Resources

  • Blog Articles (emlog://articles) - Get all blog article lists

  • Categories (emlog://categories) - Get all category information

  • Comments (emlog://comments) - Get comment lists (based on latest articles)

  • Micro Notes (emlog://notes) - Get micro note lists

  • Draft Articles (emlog://drafts) - Get all draft article lists

  • User Information (emlog://user) - Get current user information

Tools

  • create_article - Create new blog articles

  • update_article - Update existing blog articles

  • get_article - Get specific article details

  • search_articles - Search articles (supports keyword, tag, category filtering)

  • like_article - Like articles

  • add_comment - Add comments

  • get_comments - Get comment lists for specific articles

  • create_note - Create micro notes

  • upload_file - Upload files (images and other media resources)

  • get_user_info - Get user information

  • get_draft_list - Get draft article lists

  • get_draft_detail - Get detailed information of specific drafts

Related MCP server: MCP Adapter Implementation Example

Tech Stack

  • TypeScript - Type-safe JavaScript superset

  • Node.js - JavaScript runtime environment

  • MCP SDK - Model Context Protocol TypeScript SDK

  • Axios - HTTP client library

  • Zod - TypeScript-first schema validation library

  • form-data - Multipart form data processing

Installation and Configuration

Use emlog-mcp directly in Claude Desktop configuration without local installation. Jump to MCP Client Configuration section.

Method 2: Local Development Installation

1. Clone the Project

git clone https://github.com/eraincc/emlog-mcp.git
cd emlog-mcp

2. Install Dependencies

npm install

3. Environment Variable Configuration

Copy the example configuration file and edit:

cp .env.example .env

Set the following environment variables in the .env file:

# Emlog API base URL (required)
EMLOG_API_URL=https://your-emlog-site.com

# Emlog API key (required)
EMLOG_API_KEY=your_api_key_here

Getting API Key:

  1. Log in to your Emlog backend management system

  2. Go to "Settings" → "API Interface"

  3. Enable API functionality and generate API key

  4. Copy the generated key to the .env file

4. Build Project

npm run build

5. Run Service

npm start

Or development mode:

npm run dev

MCP Client Configuration

Claude Desktop Configuration

Add to Claude Desktop configuration file (usually located at ~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "emlog": {
      "command": "npx",
      "args": ["emlog-mcp"],
      "env": {
        "EMLOG_API_URL": "https://your-emlog-site.com",
        "EMLOG_API_KEY": "your_api_key_here"
      }
    }
  }
}

Note: The configuration now directly uses the published npm package emlog-mcp, no local installation or compilation required. npx will automatically download and run the latest version.

The project also provides an example configuration file claude-desktop-config.json for reference.

Other MCP Clients

For other MCP-supporting clients, please refer to their respective documentation for stdio transport configuration.

API Interface Documentation

This service is built on Emlog's REST API, supporting the following main operations:

Article Management

  • GET /api/article_list - Get article lists

  • GET /api/article_view - Get specific article details

  • POST /api/article_save - Create/update articles

  • POST /api/article_like - Like articles

Draft Management

  • GET /api/draft_list - Get draft lists

  • GET /api/draft_detail - Get specific draft details

Category Management

  • GET /api/sort_list - Get category lists

Comment Management

  • GET /api/comment_list - Get comment lists

  • POST /api/comment_save - Publish comments

Micro Notes

  • GET /api/note_list - Get micro note lists

  • POST /api/note_save - Publish micro notes

File Upload

  • POST /api/upload - Upload files

User Management

  • GET /api/userinfo - Get user information

Usage Examples

Create Blog Article

// Through MCP tool call
{
  "name": "create_article",
  "arguments": {
    "title": "My New Article",
    "content": "This is the article content, supporting HTML and Markdown formats.",
    "sort_id": 1,
    "tag": "technology,programming,MCP",
    "is_private": "n",
    "allow_comment": "y"
  }
}

Search Articles

// Search articles containing keywords
{
  "name": "search_articles",
  "arguments": {
    "keyword": "technology",
    "page": 1,
    "count": 10
  }
}

Get Article List

// Through MCP resource access
{
  "uri": "emlog://articles"
}

Get Draft List

// Get draft list
{
  "name": "get_draft_list",
  "arguments": {
    "count": 10
  }
}

Get Draft Details

// Get detailed information of specific draft
{
  "name": "get_draft_detail",
  "arguments": {
    "id": 123
  }
}

Upload File

// Upload image file
{
  "name": "upload_file",
  "arguments": {
    "file_path": "/path/to/image.jpg"
  }
}

Create Micro Note

// Publish micro note
{
  "name": "create_note",
  "arguments": {
    "content": "This is a micro note",
    "is_private": false
  }
}

Error Handling

The service includes comprehensive error handling mechanisms:

  • Network Errors - Automatic retry and timeout handling

  • API Errors - Detailed error information return

  • Authentication Errors - API key validation failure prompts

  • Parameter Errors - Input parameter validation and prompts

Development and Debugging

Available Scripts

# Build project
npm run build

# Start service
npm start

# Development mode (auto restart)
npm run dev

# Watch mode (auto compile)
npm run watch

# Run tests
npm test

Log Output

The service outputs runtime status information to stderr for debugging:

Emlog MCP server running on stdio

Test Service

The project includes a simple test script test-server.js to verify if the service is working properly:

node test-server.js

Security Considerations

  1. API Key Protection - Ensure API keys are not leaked, use environment variables for storage

  2. HTTPS Connection - Recommend using HTTPS connection to Emlog API in production

  3. Permission Control - Ensure API keys have appropriate permission scope

  4. Input Validation - All user inputs are validated and sanitized

Troubleshooting

Common Issues

  1. Connection Failure

    • Check if EMLOG_API_URL is correct

    • Confirm Emlog site is accessible

  2. Authentication Failure

    • Verify if EMLOG_API_KEY is valid

    • Check API key permissions

  3. Tool Call Failure

    • Check specific reasons in error messages

    • Confirm parameter format is correct

Project Structure

emlog-mcp/
├── src/                    # Source code directory
│   ├── index.ts           # MCP service main entry
│   └── emlog-client.ts    # Emlog API client
├── dist/                  # Compiled output directory
├── docs/                  # Documentation directory
│   └── api_doc.md        # Detailed Emlog API documentation
├── .env.example          # Environment variable example file
├── .gitignore            # Git ignore file configuration
├── claude-desktop-config.json  # Claude Desktop configuration example
├── test-server.js        # Test script
├── package.json          # Project configuration and dependencies
├── tsconfig.json         # TypeScript configuration
└── README.md             # Project documentation

Contributing

Welcome to submit Issues and Pull Requests to improve this project. Before submitting code, please ensure:

  1. Code passes TypeScript compilation checks

  2. Follows project code style

  3. Adds appropriate error handling

  4. Updates relevant documentation

License

MIT License

Available Tools

12 tools
add_commentAdd CommentC

Add a comment to an article

Inputs: comment (required), comname (required), gid (required), commail, +2 more.

create_articleCreate ArticleC

Create a new blog article

Inputs: content (required), title (required), allow_remark, cover, +5 more.

create_noteCreate NoteC

Create a new micro-note

Inputs: t (required), private.

get_articleGet ArticleC

Get a specific article by ID

Inputs: id (required), password.

get_commentsGet CommentsC

Get comments for an article (with pagination support)

Inputs: id (required), page.

get_draft_detailGet Draft DetailC

Get details of a specific draft

Inputs: id (required).

get_draft_listGet Draft ListC

Get list of draft articles

Inputs: count.

get_user_infoGet User InfoB

Get current user information

Inputs: no named parameters.

like_articleLike ArticleC

Like an article

Inputs: gid (required), avatar, name.

search_articlesSearch ArticlesC

Search articles by keyword, tag, or category

Inputs: count, keyword, order, page, +2 more.

update_articleUpdate ArticleB

Update an existing blog article. If the article is currently a draft and no draft parameter is specified, it will remain as a draft.

Inputs: id (required), title (required), content, cover, +4 more.

upload_fileUpload FileC

Upload a file (image, document, etc.)

Inputs: file_path (required), sid.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 12 tools

    Disambiguation4/5

    Most tools have clearly distinct purposes targeting specific resources like articles, comments, drafts, and files, with minimal overlap. However, 'create_article' and 'create_note' might cause slight confusion if notes are a type of article, but their descriptions help differentiate them as separate entities.

    Naming Consistency5/5

    All tools follow a consistent verb_noun naming pattern (e.g., add_comment, create_article, get_draft_list), using snake_case throughout. This predictability makes it easy for agents to understand and select tools based on their actions and targets.

    Tool Count5/5

    With 12 tools, this server is well-scoped for a blog management system, covering core operations like article CRUD, commenting, drafts, and file uploads. Each tool serves a distinct function without unnecessary bloat, fitting typical workflows for content creation and management.

    Completeness4/5

    The toolset provides strong coverage for blog management, including CRUD for articles, comments, drafts, and user info, with search and like functionality. Minor gaps include no update/delete for comments or notes, and no direct management of tags/categories, but agents can work around these with available tools.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to manage Halo blog systems through natural language, supporting article creation/editing/publishing, categories, tags, attachments, and includes 10 AI writing prompts for content optimization and SEO.
      18
      MIT
    • -
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to manage WordPress content, menus, Elementor layouts, and Polylang translations through the Model Context Protocol.
      -