media-cloud-mcp
An MCP server for Media Cloud, the open archive of online news used for media research. It lets an AI assistant measure how much attention news media pay to a topic, compare sources and countries, examine the language of coverage, and find story URLs.
This is an independent project, not an official Media Cloud product. It is built on the official mediacloud Python client.
Setup
You need a Media Cloud API key. Sign in to Media Cloud, click the person icon at the top right, choose Profile, and copy your API key.
The server runs over stdio. With uv installed, add this to your MCP client's configuration, such as claude_desktop_config.json:
{
"mcpServers": {
"media-cloud": {
"command": "uvx",
"args": ["media-cloud-mcp"],
"env": { "MC_API_KEY": "your-api-key" }
}
}
}
For Claude Code:
claude mcp add media-cloud --env MC_API_KEY=your-api-key -- uvx media-cloud-mcp
Or install it with pip install media-cloud-mcp and use media-cloud-mcp as the command. Python 3.11 or newer is required.
To confirm it works, ask your assistant to run the check_connection tool.
Tools
All tools are read-only.
| Tool | What it does |
|---|---|
check_connection |
Verifies the API key and shows API parameters such as rate limits |
count_stories |
Matching stories, total stories in scope, and their ratio |
count_stories_over_time |
Daily counts and ratios |
count_stories_by_source_over_time |
Counts and ratios per source, per day or week |
list_stories |
Story metadata and URLs, with pagination |
sample_stories |
A random sample of matching stories |
get_story |
Metadata for one story |
top_words |
Most used terms in a sample of matching stories |
top_sources |
Sources publishing the most matching stories |
top_languages |
Most common languages among matching stories |
search_collections |
Find collections, often by country or state |
get_collection |
Details of one collection |
search_sources |
Find sources by name or domain, or list a collection's sources |
get_source |
Details of one source |
list_feeds |
RSS feeds Media Cloud collects from |
The mediacloud://query-guide resource documents the query syntax. The server also sends it to the assistant as part of its instructions.
Example prompts
- "How much did US national media cover climate change in November 2023 compared with Indian national media?"
- "Which Nigerian news sources wrote the most about fuel subsidies last year?"
- "Chart the weekly share of stories about 'artificial intelligence' in the Washington Post in 2024."
- "What words most often appear in coverage of the housing crisis in Boston Globe stories?"
Limits
- Story text: Media Cloud returns metadata and URLs. Copyright restrictions keep full text limited to accounts with elevated access.
- Rate limit and quota: requests are rate limited per account, and the client library waits when it reaches the limit, so a burst of calls can be slow. Your account also has a weekly quota. Contact Media Cloud if you need more.
Development
uv sync
uv run pytest
uv run ruff check .
Tests replace only the HTTP layer and don't need an API key. To try the server interactively:
MC_API_KEY=your-api-key uv run media-cloud-mcp
Releasing
Update __version__ in src/media_cloud_mcp/__init__.py, then build and publish:
rm -rf dist && uv build
uv publish --token "$PYPI_TOKEN"
License
MIT
Metadata
Release files for media-cloud-mcp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| media_cloud_mcp-0.1.0.tar.gz | 12.3 kB | Without provenance | Details for media_cloud_mcp-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| media_cloud_mcp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for media_cloud_mcp-0.1.0-py3-none-any.whl |
Total release size: 23.7 kB
Release files / media_cloud_mcp-0.1.0.tar.gz
| Download URL | media_cloud_mcp-0.1.0.tar.gz |
|---|---|
| Size | 12.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
337e49c4cda13db3839d248c118543ecc17bbec78a4df5aae7bfe0aa44ed484b
|
|
BLAKE2b-256 checksum How to use checksums |
ed53e91114fe348a1b37f3df11946d5c313f92aebb2f72a56d765e637a4bc50a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.15.1
|
Release files / media_cloud_mcp-0.1.0-py3-none-any.whl
| Download URL | media_cloud_mcp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 11.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
55507ca860d3fb530e59894f92eb1ea95d66386b2d5382aaaeb389258a4486be
|
|
BLAKE2b-256 checksum How to use checksums |
027c35490f09d060771873592bd0463ddbe004ad7362f67a4506b9aeeffe54e9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.15.1
|
Security for media-cloud-mcp 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.