Skip to main content
Glama
ravintambimuttu-eng

Publisher Content MCP Server

README.md
# Publisher Content MCP Server

A small [Model Context Protocol](https://modelcontextprotocol.io) server that exposes a publisher's journalism to LLMs and agent frameworks as a **first-class platform** — with search, retrieval, source grounding and consistent citation.

I built this as a working demonstration of the primitives behind "LLM connector and retrieval experiences": defined schemas, tool/function calling, retrieval with context, grounding, and clear attribution at the boundary between authoritative content and external AI systems.

## Why it exists

As large language models become a primary gateway to information, publishers need to decide *how* their content is queried, grounded and cited inside AI systems — rather than leaving it to the model's priors. This server treats an AI assistant as a distribution platform and gives it:

- **Accurate retrieval** — search and fetch the right material with context.
- **Grounding metadata** — source, author, section, publish/update dates, and an `authority` level (staff-reported vs analysis vs opinion).
- **Consistent citation** — a single citation format every agent can follow.
- **A runtime policy tool** — `citation_policy()` exposes the rules for representing the content, so agents fetch and follow them at call time.

## Tools

| Tool | Purpose |
|------|---------|
| `search_articles(query, limit)` | Keyword search across title, summary and topics; returns grounding metadata |
| `get_article(article_id)` | Full article body with citation and grounding |
| `list_topics()` | Available topics with article counts, to scope a query |
| `citation_policy()` | The publisher's rules for how AI systems must attribute and characterise content |

## Run it

```bash
pip install -r requirements.txt
python server.py            # serves over stdio
```

Or use the MCP Inspector to explore the tools interactively:

```bash
mcp dev server.py
```

### Use with an MCP client (e.g. Claude Desktop)

Add to your client's MCP config:

```json
{
  "mcpServers": {
    "publisher-content": {
      "command": "python",
      "args": ["/absolute/path/to/server.py"]
    }
  }
}
```

Then ask the assistant something like *"What does the publisher have on AI and news discovery? Cite your source."* — it will call `search_articles`, `get_article`, and apply the citation policy.

## Design notes

- **Schemas over prose.** Every tool returns a stable, typed shape so downstream agents can rely on it.
- **Grounding is explicit.** `is_authoritative` and `authority` let an agent distinguish verified reporting from opinion — central to responsible representation of journalism.
- **Policy as a tool.** Making citation rules retrievable at runtime is more robust than hoping the model remembers them.

## Note on content

`articles.json` contains **synthetic sample content** written for this demo. It is not affiliated with, or copied from, any real publication.

---

Built by Ravin Tambimuttu as a hands-on exploration of MCP connector and retrieval patterns for publisher content.