Skip to main content

Read-only MCP server for querying Kenda token spend and waste

Project description

ingestion-mcp

A small, read-only Model Context Protocol server that lets an AI host (e.g. Claude Code) answer questions about your Kenda token spend and waste straight from the terminal — "how much did I spend this week?", "which agent is wasting the most?".

It is a query surface only: it never captures or writes usage. It reads the token-authed /collector/* endpoints of the Kenda API using the endpoint + token from ~/.kenda/config.json (the same ingest token the Kenda collector writes), which resolve the token to its org server-side — so the terminal needs no browser/Auth0 session.

Tools

Tool Endpoint Returns
kenda_spend_summary GET /collector/summary Top-line spend, waste, and health for your org
kenda_waste_by_agent GET /collector/agents Per-agent spend and redundant (wasted) dollars

Install

uv tool install ingestion-mcp     # or: pipx install ingestion-mcp

The console script kenda-mcp runs the stdio server. uvx ingestion-mcp runs it without installing anything.

uv and pipx are recommended over a bare pip install because this ships a command-line entry point, and pip refuses to install into a Homebrew or distro-managed interpreter at all (error: externally-managed-environment, PEP 668). If you only have pip, use pip install --user ingestion-mcp. Both uv and pipx install into ~/.local/bin, which is not on PATH by default on macOS — if kenda-mcp is not found afterwards, that is why.

Configure

The server reads ~/.kenda/config.json:

{
  "endpoint": "https://api.kenda.app",
  "token": "kenda_your-ingest-token"
}

Only endpoint and token are required for queries. Both are written for you by kenda-collect init (the Kenda collector) or the Claude Code plugin's /kenda-setup. Environment variables override the file (KENDA_ENDPOINT, KENDA_TOKEN) for CI and power users.

Use with your AI host

The server is plain stdio MCP: every host below runs the same one-line command, kenda-mcp — only the config file differs. After registering, ask your assistant: "what did I spend this week?" or "which agent is wasting the most?".

Claude Code

.mcp.json in the project (or claude mcp add kenda -- kenda-mcp):

{
  "mcpServers": {
    "kenda": { "command": "kenda-mcp" }
  }
}

Cursor

~/.cursor/mcp.json (all projects) or .cursor/mcp.json (one project):

{
  "mcpServers": {
    "kenda": { "command": "kenda-mcp" }
  }
}

Windsurf

~/.codeium/windsurf/mcp_config.json (docs):

{
  "mcpServers": {
    "kenda": { "command": "kenda-mcp" }
  }
}

VS Code (Copilot agent mode)

.vscode/mcp.json for one workspace — or run MCP: Open User Configuration from the command palette to register it for all workspaces. Note the key is servers here, not mcpServers:

{
  "servers": {
    "kenda": { "type": "stdio", "command": "kenda-mcp" }
  }
}

Codex CLI

~/.codex/config.toml (or codex mcp add kenda -- kenda-mcp):

[mcp_servers.kenda]
command = "kenda-mcp"

Gemini CLI

~/.gemini/settings.json (or .gemini/settings.json in a project):

{
  "mcpServers": {
    "kenda": { "command": "kenda-mcp" }
  }
}

Troubleshooting

If your host reports the server as failed, run the built-in self-test — it works even when the mcp package is broken, and tells you whether the problem is your config, the network, or the host:

kenda-mcp --check

It prints the version, the config it resolved (token masked), and the result of one live API call; exit code 0 means the server side is healthy, so the problem is host config.

Develop

python -m venv .venv && . .venv/bin/activate
pip install -e ".[dev]"
ruff check .
pytest

The HTTP query layer is pure stdlib and unit-tested (tests/test_query.py); the MCP transport is driven end-to-end with an in-memory client (tests/test_server.py), including a schema-regression test that pins host-safe tool shapes; the --check doctor mode is covered by tests/test_check.py. The mcp package is a runtime dependency, so all suites run in CI.

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ingestion_mcp-0.2.0.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ingestion_mcp-0.2.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file ingestion_mcp-0.2.0.tar.gz.

File metadata

  • Download URL: ingestion_mcp-0.2.0.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for ingestion_mcp-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b937f193e4d87d44b6e4cdc399d2856d27dd166cd0032cd31328889cde228e65
MD5 20daceb0040b71db6f03b17480c5ce5d
BLAKE2b-256 d78885df12011b2cba417322ef06ac97ec6f4088ee8b8c4924022e2cd672a7fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for ingestion_mcp-0.2.0.tar.gz:

Publisher: release.yml on kenda-co/ingestion-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ingestion_mcp-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ingestion_mcp-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for ingestion_mcp-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cd5cca74bfb0f9356469d566deb33f98e3cdd086805eedbb4a2652d6ab773936
MD5 816ee3938bf8909bfeedf2c841ffbc56
BLAKE2b-256 c3af2d9e206be15a58b4715336cb190882bdb01371542a92ca4f24a66582edb0

See more details on using hashes here.

Provenance

The following attestation bundles were made for ingestion_mcp-0.2.0-py3-none-any.whl:

Publisher: release.yml on kenda-co/ingestion-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page