# DataGoKr MCP — Agent Setup

These are setup instructions for an AI coding agent (Claude Code, Codex CLI, Cursor, Gemini CLI, Windsurf, or any MCP-capable client). Complete every step yourself by running the commands directly. Do not ask the user to run them. Report the result at the end.

이 문서는 AI 에이전트가 직접 실행하기 위한 설정 지시서입니다. 아래 단계를 사용자에게 시키지 말고 에이전트가 직접 수행한 뒤 결과를 보고하세요.

## What you are installing

`datagokr` is a read-only MCP server for Korea's public data portal (data.go.kr): 109k datasets indexed down to 1.5M column names, hybrid (bge-m3 + lexical) search. Tools: `search`, `show`, `record`, `fields`, `get_preview`, `download_url`. No API key is needed for search; previews of portal files accept the user's own key via the `X-DataGoKr-Key` header. Rate limit: 30 requests/minute and 2,000/day per IP.

Remote MCP URL (Streamable HTTP, no authentication): `https://datagokr.dev/mcp`

## Step 1 — Detect your client and register the remote server

Run exactly one block that matches the agent you are.

### Claude Code
```
claude mcp add --transport http datagokr https://datagokr.dev/mcp -s user
claude mcp list
```

### Codex CLI
```
codex mcp add datagokr --url https://datagokr.dev/mcp
codex mcp list
```

### Cursor — add to `~/.cursor/mcp.json` (or `.cursor/mcp.json` in the project) under `"mcpServers"`
```json
"datagokr": { "url": "https://datagokr.dev/mcp" }
```

### Gemini CLI — add to `~/.gemini/settings.json` under `"mcpServers"`
```json
"datagokr": { "httpUrl": "https://datagokr.dev/mcp" }
```

### Windsurf — add to `~/.codeium/windsurf/mcp_config.json` under `"mcpServers"`
```json
"datagokr": { "serverUrl": "https://datagokr.dev/mcp" }
```

### Any other MCP client
Register a Streamable HTTP server named `datagokr` with URL `https://datagokr.dev/mcp`. No headers are required.

## Step 2 — (Optional) local package for downloads and applications

Only if the user wants to download files or submit access applications with their own data.go.kr account:
```
pip install datagokr-mcp
datagokr --version
```
Then register the local stdio server as well (Claude Code example): `claude mcp add datagokr-local -s user -- datagokr-mcp`. Configuration (`DATAGOKR_API_KEY`, login cookie) is documented at https://github.com/datagokr-dev/datagokr. Never put the user's key or cookie into chat, logs, or commits.

## Step 3 — Verify

After registration (restart the client session if tools do not appear), call the `search` tool with query `전국 주차장` and `n` = 1. It must return one dataset with an `id`, `title` and `page_url`. If the server answers HTTP 429, wait for the `Retry-After` seconds and retry once.

## Step 4 — Tell the user

```
┌─ DataGoKr MCP Setup Complete ────────────────────────┐
│  ✓ Remote  https://datagokr.dev/mcp  (tools: 6)      │
│  ✓ Verified search("전국 주차장")                    │
│  ○ Local package (optional): pip install datagokr-mcp│
│                                                      │
│  Try: "위도·경도 컬럼 있는 서울 데이터 찾아줘"       │
│       "전국 세차장 데이터 있어? 어떻게 받아?"        │
│       "15012896 컬럼 구조 보여줘"                    │
└──────────────────────────────────────────────────────┘
```

Source, docs and issues: https://github.com/datagokr-dev/datagokr · Registry: https://smithery.ai/servers/zlans28/datagokr-public
These instructions are published at https://datagokr.dev/agent-setup/prompt.md so you can re-verify them.
