Enables AI assistants to interact with Medium's content platform, providing tools for publishing, updating, and deleting articles, managing drafts, accessing user profiles and publications, and searching articles by keywords and tags.
Medium MCP Server
Version 2.0.0 - Production-ready MCP server for Medium API integration
Overview
Medium MCP (Model Context Protocol) server enables AI assistants to interact with Medium's content platform programmatically. Publish, update, delete articles, manage drafts, and more - all through a unified MCP interface with robust error handling and automatic retries.
🎯 Key Features
✅ Complete CRUD Operations - Publish, update, delete, and retrieve articles
✅ OAuth 2.0 Authentication - Secure token management with automatic refresh
✅ Smart Retry Logic - Exponential backoff for failed requests
✅ Rate Limit Handling - Automatic detection and waiting
✅ Draft Management - Create, retrieve, and manage drafts
✅ User Profile Access - Get user information and publications
✅ Search Functionality - Find articles by keywords and tags
✅ Type Safety - Full TypeScript support with validation
✅ Comprehensive Tests - Jest test suite with 92% coverage
🛠️ Technology Stack
TypeScript - Type-safe development
Model Context Protocol (MCP) - AI assistant integration
Axios - HTTP client with interceptors
Zod - Schema validation
Jest - Testing framework
🚀 Quick Start
Prerequisites
Node.js v16 or later
npm or yarn
Medium account
Installation
Development Mode
Run Tests
📚 Available Tools
Article Management
publish-article
Publish a new article on Medium.
Parameters:
title(string, required): Article titlecontent(string, required): Article content in Markdown formattags(string[], optional): Up to 5 tagspublishStatus('public' | 'draft' | 'unlisted', optional): Publication status (default: 'draft')publicationId(string, optional): Publish to a specific publicationnotifyFollowers(boolean, optional): Notify followers when publishing
Example:
update-article
Update an existing article.
Parameters:
articleId(string, required): ID of the article to updatetitle(string, optional): New titlecontent(string, optional): New contenttags(string[], optional): New tagspublishStatus('public' | 'draft' | 'unlisted', optional): New status
delete-article
Delete an article or draft.
Parameters:
articleId(string, required): ID of the article to delete
get-article
Get details of a specific article.
Parameters:
articleId(string, required): ID of the article
User & Profile
get-user-profile
Retrieve authenticated user's profile information.
Returns: User ID, username, name, URL, and image URL.
get-drafts
Retrieve all draft articles for the authenticated user.
get-publications
Retrieve all publications the user contributes to.
Search
search-articles
Search and filter Medium articles.
Parameters:
keywords(string[], optional): Search keywordspublicationId(string, optional): Filter by publicationtags(string[], optional): Filter by tags
🔧 Development
Run in Development Mode
Run Tests
Build the Project
🏗️ Architecture
🔒 Authentication
Option 1: Integration Token (Recommended)
Scroll to "Integration tokens"
Enter description: "MCP Server"
Click "Get integration token"
Add to
.env:MEDIUM_ACCESS_TOKEN=your_token_here
Option 2: OAuth (For Applications)
Register at Medium Developers
Get Client ID and Client Secret
Add to
.env:MEDIUM_CLIENT_ID=your_client_id MEDIUM_CLIENT_SECRET=your_client_secret MEDIUM_AUTH_CODE=authorization_code
⚡ Features in Detail
Error Handling
Exponential Backoff: Automatic retry with 1s → 2s → 4s delays
Rate Limit Detection: Monitors API limits and waits automatically
Detailed Error Messages: Clear error info with status codes
Token Management
Persistent Storage: Tokens saved in
.medium-tokens.jsonAuto Refresh: Expired tokens refreshed automatically
Security: Token files excluded from git
Type Safety
Full TypeScript implementation
Zod schema validation
Comprehensive interfaces
🐛 Troubleshooting
Authentication Errors
Build Errors
Rate Limiting
The client automatically handles rate limits. Check rate limit status:
📊 What's New in v2.0.0
Added
✅ Real OAuth 2.0 authentication with token refresh
✅ Update article tool
✅ Delete article tool
✅ Get article details tool
✅ Get user profile tool
✅ Get drafts tool
✅ Exponential backoff retry logic
✅ Rate limit detection and handling
✅ Comprehensive test suite (Jest)
✅ Token persistence
Enhanced
✅ Publish article tool (added status & notify options)
✅ Better error messages
✅ Improved type safety
✅ Enhanced documentation
🚀 Roadmap
Phase 2 (Coming Soon)
📊 Analytics and article statistics
🖼️ Image upload support
🔍 Advanced search filters
🎯 SEO optimization tools
📝 Draft scheduling
Phase 3 (Future)
🤖 AI-powered content suggestions
📦 Bulk operations
🔄 Import/export functionality
👥 Collaboration features
🔔 Webhook support
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
📞 Support
Medium API Docs: https://github.com/Medium/medium-api-docs
MCP Protocol: https://github.com/modelcontextprotocol/sdk
Issues: Create a GitHub issue for bugs or feature requests
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables AI assistants to interact with Medium's platform for publishing, updating, and managing articles and drafts through OAuth 2.0 authentication with automatic retry logic and rate limit handling.