Metadata-Version: 2.4
Name: agentrank-mcp
Version: 0.1.0
Summary: MCP server for AgentRank / AgentIndex — search real, verifiable businesses for AI agents.
Author: AgentRank
License: MIT
Keywords: agentrank,agents,business,index,mcp
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27
Requires-Dist: mcp>=1.2.0
Description-Content-Type: text/markdown

# AgentRank MCP server

Give your AI agent access to **real, verifiable businesses** — with provenance and
source URLs, so it never invents phone numbers or addresses.

This is an [MCP](https://modelcontextprotocol.io) server that exposes the
[AgentRank / AgentIndex](https://agentsafepath.com) search to any MCP client
(Claude Desktop, Cursor, and others).

## Tools

- **`search_businesses(intent, limit=10)`** — find businesses by a natural-language
  intent (e.g. `"farmácia em Copacabana com telefone"`, `"software company in California"`).
  Returns ranked results with `fit_score`, `trust_score`, justification, risks and the
  **source URL** of each fact.
- **`get_business_profile(company_id)`** — full profile of a result: location, contact
  channels, hours, offers, policies and evidence, each with provenance and source.

## 1. Get an API key

Register your agent (free, no invite) at
**https://agentsafepath.com/registrar.html** — you receive a key once. It identifies
your agent and is sent as `Authorization: Bearer <key>`.

## 2. Add it to your MCP client

### Claude Desktop

Edit `claude_desktop_config.json` (Settings → Developer → Edit Config) and add:

```json
{
  "mcpServers": {
    "agentrank": {
      "command": "uvx",
      "args": ["agentrank-mcp"],
      "env": { "AGENTRANK_API_KEY": "ak_your_key_here" }
    }
  }
}
```

Restart Claude Desktop. You'll see `search_businesses` and `get_business_profile`
available. (`uvx` comes with [uv](https://docs.astral.sh/uv/); or use the "From source"
option below.)

### Cursor

Add the same block under `mcpServers` in your Cursor MCP settings.

### From source (no packaging)

```bash
pip install -r requirements.txt
AGENTRANK_API_KEY=ak_your_key_here python -m agentrank_mcp.server
```

And point your client's `command` at `python` with `args`
`["-m", "agentrank_mcp.server"]` and the folder on `PYTHONPATH`.

## Environment variables

| Var | Required | Default |
|---|---|---|
| `AGENTRANK_API_KEY` | yes | — |
| `AGENTRANK_BASE_URL` | no | `https://api.agentrank.intelligenceofcode.com` |

The key is never logged.

## How agents should use the data

Every result carries `sources` (source URLs). **Verify provenance before acting** —
data without a source should not be used. `trust_score` (0–100) reflects how safe the
entity is to commit to; `fit_score` reflects match to the intent.
