Metadata-Version: 2.4
Name: coonet-mcp
Version: 0.1.0
Summary: MCP server for querying the CooNet Croatian news database — articles, entities, and trends
Project-URL: Homepage, https://github.com/svantip/CooNet
Project-URL: Repository, https://github.com/svantip/CooNet
Project-URL: Issues, https://github.com/svantip/CooNet/issues
Author: Svan Tipuric
Keywords: claude,croatian,llm,mcp,model-context-protocol,ner,news,nlp
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Text Processing :: Linguistic
Requires-Python: >=3.11
Requires-Dist: asyncpg<1,>=0.29
Requires-Dist: click<9,>=8.0
Requires-Dist: fastmcp<3,>=2.5
Requires-Dist: sqlalchemy[asyncio]<3,>=2.0
Description-Content-Type: text/markdown

# coonet-mcp

MCP server for querying the [CooNet](https://github.com/svantip/CooNet) Croatian news database. Exposes 8 tools over the Model Context Protocol, allowing any MCP-compatible LLM to search articles, entities, and trends using natural language.

## Install

```bash
pip install coonet-mcp
```

## Setup

All you need is a PostgreSQL connection string to a CooNet database.

### Claude Code

Place `.mcp.json` at your project root:

```json
{
  "mcpServers": {
    "coonet": {
      "command": "coonet-mcp",
      "env": {
        "DATABASE_URL": "postgresql+asyncpg://coonet:coonet_dev@localhost:5432/coonet"
      }
    }
  }
}
```

### Claude Desktop

Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "coonet": {
      "command": "coonet-mcp",
      "env": {
        "DATABASE_URL": "postgresql+asyncpg://coonet:coonet_dev@localhost:5432/coonet"
      }
    }
  }
}
```

### With uvx (no install needed)

```json
{
  "mcpServers": {
    "coonet": {
      "command": "uvx",
      "args": ["coonet-mcp"],
      "env": {
        "DATABASE_URL": "postgresql+asyncpg://coonet:coonet_dev@localhost:5432/coonet"
      }
    }
  }
}
```

## Available tools

| Tool | Description |
|---|---|
| `get_stats()` | Database statistics: total articles, portals, entity count, date range |
| `list_portals()` | All news portals with IDs and status |
| `list_categories()` | All distinct article categories |
| `search_articles(...)` | Keyword search with portal, category, date filters |
| `get_article(id)` | Full article content by ID with optional NER entities |
| `get_entity_mentions(...)` | Most frequently mentioned entities (PER/ORG/LOC) |
| `get_entity_co_occurrences(...)` | Entities that co-occur with a given entity |
| `get_articles_by_entity(...)` | Articles mentioning a specific entity via NER tags |

## Requirements

- Python 3.11+
- A reachable PostgreSQL database with the CooNet schema

