Skip to main content
Glama
designly1
by designly1
README.md
# MCP Medium Server

![NPM Version](https://img.shields.io/npm/v/mcp-medium)
![Static Badge](https://img.shields.io/badge/build-passing-brightgreen)
![NPM License](https://img.shields.io/npm/l/mcp-medium)

![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?logo=typescript&logoColor=white)
![Node.js](https://img.shields.io/badge/Node.js-339933?logo=nodedotjs&logoColor=white)
![Medium](https://img.shields.io/badge/Medium-12100E?logo=medium&logoColor=white)

A [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server that enables AI assistants to publish posts to Medium.

## Features

- **Publish Posts**: Create and publish articles to Medium
- **Draft Support**: Publish as draft, unlisted, or public
- **Tag Management**: Add tags to your posts
- **Canonical URLs**: Set canonical URLs for SEO
- **Follower Notifications**: Optionally notify followers when publishing

## Installation

### Via npx (Recommended)

```bash
npx mcp-medium
```

### Local Development

```bash
git clone <repository-url>
cd mcp-medium
pnpm install
pnpm build
pnpm start
```

## Setup

### 1. Get Medium API Token

1. Go to [Medium Settings](https://medium.com/me/settings)
2. Scroll down to "Integration tokens"
3. Generate a new token
4. Copy the token for use in your environment

### 2. Set Environment Variable

```bash
export MEDIUM_TOKEN="your_medium_token_here"
```

### 3. Configure MCP Client

Add this server to your MCP client configuration:

**Claude Desktop (config.json):**
```json
{
  "mcpServers": {
    "medium": {
      "command": "npx",
      "args": ["mcp-medium"],
      "env": {
        "MEDIUM_TOKEN": "your_medium_token_here"
      }
    }
  }
}
```

**Other MCP Clients:**
```bash
npx mcp-medium
```

## Usage

Once configured, you can ask your AI assistant to publish posts to Medium:

> "Please publish this article to Medium as a draft with the tags 'programming' and 'typescript'"

> "Publish this post to Medium publicly and notify my followers"

### Available Parameters

- **title** (required): The post title
- **content** (required): The post content (HTML format)
- **tags** (optional): Array of tags for the post
- **canonicalUrl** (optional): Canonical URL for SEO
- **publishStatus** (optional): "draft", "unlisted", or "public" (default: "draft")

## Example

```typescript
// The AI assistant can call this tool:
publishPost({
  title: "My First MCP Post",
  content: "<h1>Hello World</h1><p>This is my first post via MCP!</p>",
  tags: ["mcp", "automation"],
  publishStatus: "draft"
})
```

## Development

### Build

```bash
pnpm build
```

### Development Mode

```bash
pnpm dev
```

### Lint

```bash
pnpm lint
pnpm fix
```

## Requirements

- Node.js 18+
- Medium account with API access
- Valid Medium integration token

## License

MIT

## Author

**Jay Simons**
- Website: [https://yaa.bz](https://yaa.bz)

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## Support

If you encounter any issues or have questions, please file an issue on the repository.