
medium-ops
io.github.06ketanPublished by GitHub account 06ketanv0.1.2Updated Oct 24, 2026
Medium CLI + 23-tool MCP server. Your IDE drafts replies. No API keys.
Overview
A local stdio MCP server and CLI that lets an assistant read Medium stories, responses, claps, feed and stats, and draft, approve and post replies.
- What you can do
- Read stories, search posts, fetch post content and metadata, and list the reader feed or profiles and stats, using public RSS or authenticated dashboard queries as a fallback for deeper reads. List responses and the full response tree for a post, and count claps. Draft replies with the host model through a propose step that returns a token and preview, then post the staged reply by token, or draft every response to a file and send only approved rows. Publish stories or drafts and give claps, with writes defaulting to dry-run. Review the audit log and dedup counts for past actions.
- When to use it
- Useful for Medium writers who want an assistant inside their IDE or chat host to triage unanswered responses, draft and approve replies, and check post stats without a separate AI API key. Also handy for reading and searching Medium content and publishing through the official API where a token exists.
- Requirements
- Runs locally as a Python package via uvx or a source install, with the MCP SDK extra recommended. Reads credentials from the host's mcp.json env block, environment variables or a .env file: MEDIUM_SID and MEDIUM_UID for authenticated reads and dashboard writes, MEDIUM_XSRF for writes, MEDIUM_USERNAME for the RSS path, and optionally MEDIUM_INTEGRATION_TOKEN for publishing. Network access to Medium endpoints is required.
Installation
In SourceWeft
- Open medium-ops in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
medium-ops
[PyPI version] [PyPI downloads] [Python 3.12+] [License: MIT] [MCP compatible] [MCP Registry] [Anthropic DXT] [Glama MCP server] [MCP Badge]
Standalone Medium CLI + 22-tool MCP server for Cursor MCP, Claude MCP, OpenCode MCP, and any stdio MCP host. Your IDE drafts the replies. Zero AI API keys.
Stories, responses, claps, feed, profiles, stats, reply engine, MCP server. One Python install, one binary, MIT licensed. Sibling of substack-ops.
TL;DR — MCP-native (no API key, one command)
Your host's LLM (Cursor's, Claude's) does the drafting via the
propose_reply / confirm_reply tools. No ANTHROPIC_API_KEY /
OPENAI_API_KEY needed.
Wrong install?
This project is medium-ops on PyPI — install with uv / uvx, not unrelated npx packages from “Medium MCP” searches. Canonical listing: Glama — 06ketan/medium-ops.
Works with (MCP)
These rows help discovery (search keywords); confirm each host’s current MCP docs before upgrading.
Open source–oriented hosts
Large commercial stacks
OpenCode (copy-paste)
Auto-install:
Manual (~/.config/opencode/opencode.json):
Optional version pin: ["uvx", "medium-ops==0.1.2", "mcp", "serve"] (replace with current PyPI release).
Why a hybrid
Medium exposes three usable surfaces and we use all of them:
- Public RSS (reads, no auth).
medium.com/feed/@{user}returns the author's ~10 most recent stories withbody_html,pubDate,tags, hero image, anddc:creator. Zero credentials, faster than GraphQL, stable. Used by default forlist_posts/get_post/get_post_content. Inspired by Portfolio_V2's blog page. - Dashboard GraphQL (authenticated reads).
medium.com/_/graphql+medium.com/_/api/*with thesidcookie. Used as a fallback when you ask for more than ~10 posts, when the post isn't in the RSS window, or for things RSS can't give you (responses, claps, feed, stats, search). - Official REST (writes).
api.medium.com/v1/*with an Integration Token. SupportscreatePost,createPostInPublication,getUser,getPublications. That's it.
Force a specific transport with --source rss|graphql|auto on posts list,
posts show, and posts content. The dashboard + GraphQL endpoints are
undocumented and Medium can change them at any time. See
Known gaps.
Setup (dev / from source)
Auth is read from ~/.cursor/mcp.json's mcpServers.medium-ops.env (or
medium-api / medium). Override with env or .env.
Command surface
Every write defaults to --dry-run. Flip with --no-dry-run. All writes
land in .cache/audit.jsonl and are dedup-checked against
.cache/actions.db.
Auth (3)
Read — Stories (5)
Read + Write — Responses (3)
Read + Write — Claps (2)
Read — Discovery + Profile (5)
Reply engine (3)
Operations + safety (2)
MCP server (3)
Other (1)
Reply modes
MCP server
Manual config snippet:
If the mcp SDK is not installed, the server falls back to a minimal
stdin/stdout JSON-line dispatcher:
MCP-native draft loop (no API key)
The safety + drafting stack that makes the unattended mode safe:
LLM strategy
Two layers, both free:
- MCP-native (default). Host LLM drafts via
propose_reply/confirm_reply. No env vars, no API key. Use this for interactive replies. - Subprocess CLI (daemon path). For
reply bulkwhen no human is in the loop. Auto-detectsclaude(Claude Code),cursor-agent, orcodexon PATH. Override withMEDIUM_OPS_LLM_CMD.
There is no paid-API-key path.
Auth setup
Medium has two auth layers that map to different feature surfaces:
- Integration Token —
Authorization: Bearer <token>. Used againstapi.medium.com/v1/*. Gets you:publish_post,list_own_publications. Token generation at https://medium.com/me/settings → "Integration tokens". Note: Medium stopped issuing new tokens in 2023. If you never generated one, the write path will 401 and you'll have to use the sid-cookie response path for any writes. - sid cookie — from
medium.com(Application → Cookies →sid). Used againstmedium.com/_/graphqlandmedium.com/_/api/*. Gets you: all reads (stories, responses, claps, feed, stats, profile), plusclap_postandpost_response(fragile — undocumented).
Refreshing auth from a HAR
When cookies rotate or Medium changes a GraphQL schema, the fastest fix is:
- Open
medium.comin Chrome with devtools → Network panel. - Reproduce the failing action (publish a draft, post a response, etc.).
- Right-click any request → "Save all as HAR with content".
medium-ops auth har ./medium.har
This:
- merges fresh
sid,uid,xsrf,cf_clearancecookies into.env(preserving everything else) - writes a redacted snapshot to
.cache/har-snapshot.jsonlisting every Medium GraphQL operation observed plus its request-variable / response-data key shapes — useful for diffing against the queries hard-coded inclient.pyto spot schema drift before users hit it.
Don't have these yet? See docs/AUTH-SETUP.md for a 5-minute browser-DevTools walkthrough. The Medium Integration Token API has been deprecated since 2023 — most users today use cookie-based auth via
MEDIUM_SID.
Env vars (or ~/.cursor/mcp.json → mcpServers.medium-ops.env):
Architecture
Endpoints used
Related MCPs
- slideshot — HTML → slides (PNG / PDF / PPTX); npm
slideshot-mcp. - substack-ops — Substack posts, notes, comments + MCP (PyPI
substack-ops).
Tests
Coverage: auth loading, client transports + XSSI stripping, dedup DB, audit log search, MCP tool registry + dispatcher, MCP install host-config merging, propose/confirm flow + token expiry, reply-engine template matching + dedup+audit flow, subprocess LLM detection.
Known gaps
- Medium stopped issuing new Integration Tokens in 2023. If you never
got one,
publish_post/list_own_publicationswill 401. The read + response + clap paths still work via sid. The RSS read path needs no credentials at all. - RSS is capped at ~10 posts and lacks clap/response counts and stats.
When you need more, pass
--source graphql(requires sid) or set--limit > 10and the client will auto-fall back to GraphQL. - GraphQL operation names and schemas change silently. The queries in
client.pymirror what the dashboard uses today — expect breakage every couple of months. Pin this package's version. post_responseuses GraphQLsavePostResponse(deltas: [Delta!]!, inResponseToPostId: ID!). Delta shape is{type: 1, index: N, paragraph: {type: 1, text, markups: []}}(type=1 means insert; paragraph.type=1 is P). Reverse-engineered from error messages.update_draft_contentuses dashboardPOST /p/{id}/deltaswith{baseRev, rev, deltas}. For a brand-new draft,baseRev=-1, rev=0. Subsequent edits should bump both.clap_poststill uses the undocumented/_/api/posts/{id}/clapshape; not yet re-validated against the new GraphQL surface. Dry-run first.- Members-only stories return a paywall preview unless the
sidbelongs to a paying member. - No "restack" equivalent. Medium doesn't have reshares; the closest is
a clap + a response. Use
clap_post+post_responsetogether for that. - No notes / short-form. Medium killed short-form in 2018.
- Chrome cookie auto-grab (the
auth_chromeflow from substack-ops) is not yet implemented. Paste yoursidinto.envfor now. - TUI not yet implemented; the extras pin is there for future work.
License
MIT. See LICENSE.
Source: README.md at commit 94e22a4
Tools
0Version history
1- v0.1.2LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts