Content
# devto-mcp
Go CLI and MCP stdio server for [dev.to](https://dev.to) / [Forem API v1](https://developers.forem.com/api/v1).
Stdlib only. Supports alternate Forem instances with `--base` / `DEVTO_BASE`.
## Install
```bash
make install
# or build locally
make build
```
## Quick start
```bash
# Build both commands.
make build
# Store API key in ~/.config/devto/default.json (0600).
./bin/devto login --api-key "$DEVTO_API_KEY"
# Confirm auth and inspect articles.
./bin/devto whoami
./bin/devto articles me --per-page 20
```
For non-interactive environments, skip local storage:
```bash
export DEVTO_API_KEY='...'
./bin/devto whoami
```
## Authenticate
`devto login` stores one key per profile. Use `--profile work` to maintain separate Forem accounts.
Environment:
- `DEVTO_API_KEY` — API key. Takes precedence over stored profile.
- `DEVTO_BASE` — Forem base URL. Default: `https://dev.to`.
- `DEVTO_PROFILE` — stored credential profile. Default: `default`.
- `DEVTO_CONFIG_DIR` — credential directory override.
- `DEVTO_TIMEOUT` — HTTP timeout. Default: `30s`.
## CLI
```bash
devto whoami
devto articles me --per-page 100
devto articles drafts --per-page 100
devto articles list --tag go --top 7
devto articles search --q "model context protocol"
devto articles get 123
# --draft is safe default. It creates a private DEV draft.
devto articles create --title "Draft" --file post.md --tags go,api --draft
# Explicit public action: publishes existing article.
devto articles update --id 123 --title "New title" --published
# Add or replace cover image with public absolute URL.
devto articles update --id 123 --main-image 'https://example.com/cover.png'
devto comments list --article 123
devto comments create --article 123 --body "Great post"
devto users username ben
devto analytics totals --article 123
devto analytics historical --start 2026-01-01 --end 2026-01-31
devto tags
devto api --method GET --path '/api/articles?tag=go'
```
## MCP configuration
Claude Desktop / compatible hosts:
```json
{
"mcpServers": {
"devto": {
"command": "/absolute/path/to/devto-mcp/bin/devto-mcp",
"env": {
"DEVTO_API_KEY": "your-forem-api-key"
}
}
}
}
```
Or authenticate once with `devto login`; then omit `env`.
## MCP tools
| Group | Tools |
| --- | --- |
| Account | `devto_whoami`, `devto_user_get`, `devto_user_by_username`, `devto_followers` |
| Articles | `devto_articles_list`, `devto_articles_latest`, `devto_articles_search`, `devto_article_get`, `devto_article_by_path`, `devto_articles_me`, `devto_articles_me_published`, `devto_articles_me_unpublished`, `devto_article_create`, `devto_article_update` |
| Comments / reactions | `devto_comments_list`, `devto_comment_get`, `devto_comment_create`, `devto_reaction_create` |
| Analytics | `devto_analytics_totals`, `devto_analytics_historical`, `devto_analytics_past_day`, `devto_analytics_referrers`, `devto_analytics_dashboard`, `devto_analytics_heatmap` |
| Other | `devto_tags`, `devto_readinglist`, `devto_api_call` |
`devto_api_call` returns status/body/error for unsupported endpoints.
## Releases
Install prebuilt binaries from [GitHub Releases](https://github.com/igun997/devto-mcp/releases):
```bash
curl -LO https://github.com/igun997/devto-mcp/releases/download/v0.1.0/devto-mcp_v0.1.0_linux_amd64.tar.gz
tar -xzf devto-mcp_v0.1.0_linux_amd64.tar.gz
```
Maintainers: merge to `main`, wait for CI, then push a semantic tag. Tag CI tests, builds Linux/macOS archives, and creates a GitHub Release.
```bash
git tag v0.1.0
git push origin v0.1.0
```
## API
Uses Forem API v1 headers:
```text
accept: application/vnd.forem.api-v1+json
api-key: <key>
```