# agent-context-api MCP server

> Provides deterministic context preflight for coding agents, including token counting, model-aware budgeting, and credential redaction.

- Repository: https://github.com/dacode-dev/agent-context-api
- Page: https://hostedmcp.org/servers/dacode-dev/agent-context-api
- Transport: remote
- Stars: 0
- License: MIT
- Latest version: 0.7.4

## Install

### Claude Code

```sh
claude mcp add --transport http agent-context-api https://agent-context-api-proxy.agent-context-proxy.workers.dev/mcp
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "agent-context-api": {
      "url": "https://agent-context-api-proxy.agent-context-proxy.workers.dev/mcp"
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "agent-context-api": {
      "type": "http",
      "url": "https://agent-context-api-proxy.agent-context-proxy.workers.dev/mcp"
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"agent-context-api","type":"http","url":"https://agent-context-api-proxy.agent-context-proxy.workers.dev/mcp"}'
```

### Codex

```sh
codex mcp add agent-context-api --url https://agent-context-api-proxy.agent-context-proxy.workers.dev/mcp
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.agent-context-api]
url = "https://agent-context-api-proxy.agent-context-proxy.workers.dev/mcp"
```

### Gemini CLI

```sh
gemini mcp add -s user --transport http agent-context-api https://agent-context-api-proxy.agent-context-proxy.workers.dev/mcp
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "agent-context-api": {
      "url": "https://agent-context-api-proxy.agent-context-proxy.workers.dev/mcp",
      "type": "http"
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `X402_FACILITATOR` | no | no |  |

## FAQ

### What does the context preflight tool do?

It counts GPT-family tokens, applies an optional model-aware budget, and redacts likely credentials to prepare repository text for an LLM.

### Is the context preflight service free?

The local MCP tool provides a free tier for inputs up to 12,000 characters, while larger inputs require the paid HTTP endpoint.

### Does the API send my text to a third party?

No, the API is designed so that processing is done locally and does not send submitted text to a third party.

### How much does a context preflight request cost?

The default price for the paid endpoint is $0.005 per request.
