# MCP, Skills & SDKs

Besides plain HTTP there are three official open-source ways in: an MCP server for AI assistants, Agent Skills for agents, and TypeScript / Python SDKs for your own code. All three need one environment variable, DATAFORGEO_API_KEY, and bill exactly like direct API calls.

| Option | Best for | Install |
| --- | --- | --- |
| MCP server | Gives Claude, Cursor and other AI assistants query tools | `npx -y @dataforgeo/mcp` |
| Agent Skills | Lets an agent run audits, competitor benchmarks, citation audits and weekly reports end to end | `/plugin install dataforgeo@dataforgeo` |
| SDKs | Integrate from your own TypeScript / Python code | `npm install @dataforgeo/client` |

### MCP server

Adds six tools to Claude Code, Claude Desktop, Cursor, Windsurf and any other MCP client. Runs over stdio with npx and needs Node.js 20 or later. Every tool description states its cost, so the assistant knows what a call will spend before it makes it.

```bash
claude mcp add dataforgeo -e DATAFORGEO_API_KEY=$DATAFORGEO_API_KEY -- npx -y @dataforgeo/mcp
```

```json
{
  "mcpServers": {
    "dataforgeo": {
      "command": "npx",
      "args": [
        "-y",
        "@dataforgeo/mcp"
      ],
      "env": {
        "DATAFORGEO_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}
```

| tool | API | Description | Cost |
| --- | --- | --- | --- |
| `geo_answer` | POST /v1/geo/answer | Answers for one prompt across engines, with mentions, citations and competitors | Same as API |
| `geo_index` | POST /v1/geo/index | Same, plus GEO Index KPIs (Pro and up) | Same as API |
| `geo_index_summary` | GET /v1/geo/index/summary | KPIs, trends and breakdowns of past runs | 0 |
| `get_job` | GET /v1/jobs/{job_id} | Fetch an async job; wait_seconds polls until done | 0 |
| `get_account` | GET /v1/account | Plan, balance and this month’s usage | 0 |
| `estimate_credits` | local | Estimates the credits a call or batch would hold, without calling the API | 0 |

| Variable | Required | Description |
| --- | --- | --- |
| `DATAFORGEO_API_KEY` | Yes | Your API key, sent as the x-api-key header |
| `DATAFORGEO_BASE_URL` | No | Overrides the API base URL |
| `DATAFORGEO_MAX_CREDITS_PER_CALL` | No | Max credits a single geo_answer / geo_index may hold; above it the call is refused locally and never sent. Recommended for autonomous agents |

https://github.com/DataForGEO/mcp

### Agent Skills

Ready-made GEO workflows for Claude Code, Claude.ai and any other agent that supports Agent Skills (Codex CLI, Cursor, Gemini CLI and more). Skills that spend credits check your balance, estimate the hold and ask before any batch run. Each skill ships a zero-dependency CLI, dfgeo.py, that needs only Python 3.8+.

```text
/plugin marketplace add DataForGEO/skills
/plugin install dataforgeo@dataforgeo
```

| skill | Description | Spends credits |
| --- | --- | --- |
| `dataforgeo-api` | Basics: single answer / index / summary calls, balance, credit estimates, async jobs | Per call |
| `geo-prompt-set-builder` | Designs a prompt set by intent × audience × language, exports JSONL and estimates cost | No |
| `geo-visibility-audit` | Brand AI visibility audit: runs prompts × engines and writes an evidence-backed report with actions | Yes, after an estimate and your OK |
| `geo-competitor-benchmark` | Competitor benchmark: share of voice, top-pick rate, average position, per-prompt wins | Yes, same as above |
| `geo-citation-audit` | Citation audit: which sites AI cites, your own citation rate, content / outreach / PR to-dos | Reuses existing results at no extra cost |
| `geo-index-report` | Weekly / monthly GEO Index reports and a fixed-tag weekly tracker | Reports free; tracking per call |

Claude.ai / Claude Desktop: run python3 scripts/package.py in the repo to build zips, upload them under Settings → Capabilities → Skills, and turn on code execution. Skills and MCP work together.

https://github.com/DataForGEO/skills

### SDK

TypeScript / JavaScript: @dataforgeo/client. Python: dataforgeo.

```bash
npm install @dataforgeo/client
pip install dataforgeo
```

```ts
import { DataForGEO } from "@dataforgeo/client";

const client = new DataForGEO(); // reads DATAFORGEO_API_KEY
const res = await client.geo.answer({
  prompt: "东京有哪些适合家庭入住的民宿？",
  engines: ["chatgpt"],
  brand: "晓宅",
  location: "JP",
  language: "zh-CN",
});
console.log(res.answers[0].brand?.mentioned, res._meta.creditsRemaining);
```

```python
from dataforgeo import DataForGEO

client = DataForGEO()  # reads DATAFORGEO_API_KEY
res = client.geo.answer(
    prompt="东京有哪些适合家庭入住的民宿？",
    engines=["chatgpt"],
    brand="晓宅",
    location="JP",
    language="zh-CN",
)
print(res["answers"][0]["brand"]["mentioned"], res.meta.credits_remaining)
```

- The two SDKs mirror each other and cover every endpoint, error code, usage header (x-credits-used and friends), async job and webhook signature check.
- Request params and response fields match the API (snake_case), with no renaming.
- 429, 408 and 5xx are retried automatically (errors are free). Network errors retry GET only, never POST, so you are never charged twice.

https://github.com/DataForGEO/client
