mcp-server-deapi: Instructions file for Claude Code

CLAUDE.md

mcp-server-deapi CLAUDE.md is an instructions file for Claude Code from deapi-ai/mcp-server-deapi. It costs 2,783 tokens per session, scanned A, original, MIT.

Repository instructions for Claude Code working on a server that exposes deAPI's AI services through MCP. deAPI is a service for tasks such as transcription, image generation, OCR, video generation, and speech synthesis.

In plain words
What is it for?
Installing dependencies, running the HTTP server, testing its tools, and checking or formatting the source code.
Why use it?
They document setup, commands, testing, and server structure so developers can work on the integration consistently.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions Claude Code.

This is deapi-ai/mcp-server-deapi's own configuration. It tells Claude Code how to work on mcp-server-deapi itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything mcp-server-deapi configures →

Reuse

Borrowing it

Nothing to install: this file belongs to deapi-ai/mcp-server-deapi. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/deapi-ai/mcp-server-deapi/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/deapi-ai/mcp-server-deapi

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mcp-server-deapi CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/deapi-ai/mcp-server-deapi/claude-md/github.svg)](https://agentmods.dev/instructions/deapi-ai/mcp-server-deapi/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/deapi-ai/mcp-server-deapi/claude-md"><img src="https://agentmods.dev/badge/instructions/deapi-ai/mcp-server-deapi/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mcp-server-deapi CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/deapi-ai/mcp-server-deapi/claude-md"><img src="https://agentmods.dev/badge/instructions/deapi-ai/mcp-server-deapi/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,783 This file is loaded in full into every session.
When invoked 2,783 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.02783 $0.02783
Opus 5.5 $0.01113 $0.01113
Sonnet 5.5 $0.00557 $0.00557
Haiku 4.5 $0.00278 $0.00278

Measured 11d ago against content hash 0fd4e8ba4945, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

mcp-server-deapi CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 161 lines

How it starts

The opening of the file, as written. The whole thing — 161 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

This is a production-ready MCP (Model Context Protocol) server for the deAPI REST API — a DePIN AI inference service. It exposes all deAPI endpoints as MCP tools, enabling LLMs to perform audio transcription, image generation, OCR, video generation, text-to-speech, and more.

The OpenAPI 3.0 specification is available at https://docs.deapi.ai/.

Development Commands

Setup

  • uv pip install -e . - Install dependencies (recommended)
  • uv pip install -e ".[dev]" - Install with dev dependencies
  • pip install -e . - Alternative install via pip

Running

  • python -m deapi_mcp.server_remote - Start the HTTP MCP server (localhost:8000)
  • MCP_HOST=0.0.0.0 MCP_PORT=8000 python -m deapi_mcp.server_remote - Start for remote access

Testing

  • pytest - Run all tests
  • pytest tests/test_tools.py - Run tool tests only
  • pytest -k "test_name" - Run specific test

Code Quality

  • black deapi_mcp/ tests/ - Format code
  • ruff check deapi_mcp/ tests/ - Lint code
  • mypy deapi_mcp - Type-check (strict; CI runs ruff, black, mypy and pytest on Python 3.11-3.14)

Architecture

Server

The primary server is deapi_mcp/server_remote.py — an HTTP/SSE-based MCP server built with FastMCP. This is the only server entry point (stdio transport is not used).

Authentication Flow

  1. DeapiAuthProvider in deapi_mcp/fastmcp_auth.py handles OAuth 2.0 (Authorization Code + PKCE)
  2. Authenticated token is stored in current_deapi_token ContextVar (deapi_mcp/auth.py)
  3. Tools call get_client() from deapi_mcp/deapi_client.py which reads the token from the ContextVar
  4. Token is forwarded as Bearer auth to the deAPI REST API

Core Modules

  • deapi_mcp/deapi_client.py - Async HTTP client (DeapiClient) with auth forwarding; HTTP and retries are delegated to the deAPI SDK's transport (deapi-sdk) over one shared connection pool, with the token sent per request
  • deapi_mcp/polling_manager.py - Smart adaptive polling for async job completion
  • deapi_mcp/schemas.py - Pydantic models from the OpenAPI spec
  • deapi_mcp/config.py - Configuration via environment variables (prefix: DEAPI_)
  • deapi_mcp/middleware.py - Model cache middleware that enriches tool descriptions with available models
  • deapi_mcp/auth_code_store.py - Single-use OAuth authorization codes: Redis when DEAPI_REDIS_HOST is set (any replica can redeem a code), in-memory otherwise (single replica only)
  • deapi_mcp/observability.py - Per-call outcome (CallOutcome on a ContextVar, note_* recorders, classify) and injectable no-op sinks; the core has no metrics dependency. classify labels a failed call from its most recent note; work whose failure the call survives runs inside errors_tolerated() (or calls forget_api_error() before a retry) so it never labels the call
  • deapi_mcp/server_remote.py - register_core_tools(server), create_app(server, *, metrics=None) and build_app(); a deployment can import the core and inject a metrics overlay
  • deapi_mcp/webhooks.py - Internal completion webhooks: HMAC-verified receiver at /webhooks/deapi, delivery_id dedupe, and the job registry the poller waits on (JobRegistry protocol; default JobCompletionRegistry in process memory; replace it with create_app(job_registry=...); code reads it through get_job_registry(), never a module global). Only mounted when DEAPI_WEBHOOKS_INTERNAL is set

Read the full file on GitHub · 161 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago Changed · +3 lines · +63 tokens per session 0fd4e8ba4945
  2. 14d ago Changed · +13 lines · +230 tokens per session 55611375d7f9
  3. 17d ago Changed · +32 lines · +1,205 tokens per session c482c565a753
  4. 2mo ago First seen · 113 lines · 1,285 tokens per session scan A a75e73e582dc

Subscribe to this mod's changes

mcp-server-deapi CLAUDE.md is an instructions file published in the GitHub repository deapi-ai/mcp-server-deapi (1 stars, last pushed today), licensed MIT. It adds 2,783 tokens to every session, about $0.0111 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

mcp-server-deapi CLAUDE.md compared with instructions from other repositories

mcp-server-deapi CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
mcp-server-deapi CLAUDE.mddeapi-ai/mcp-server-deapiInstructions file1todayMITA2,783Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file196ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file144ktodayMITA8,130Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file196ktodayMITA5,685GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file150ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file196ktodayMITA3,153GitHub Copilot
generative-ai-for-beginners AGENTS.mdmicrosoft/generative-ai-for-beginnersInstructions file124ktodayMITA2,981Codex, OpenCode