api-server-mcp

api-server-mcp is a skill for Claude Code, Codex from xberg-io/xberg. It costs 12 tokens per session (1,490 once invoked), scanned A, original, MIT.

A guide to the Rust server that exposes Xberg document extraction through REST APIs and the Model Context Protocol, a standard way for AI tools to call external capabilities. It documents routes for extraction, detection, jobs, formats, health, version information, caching, and document conversion.

In plain words
What is it for?
Use it to add or diagnose API and MCP integrations, accept files or URLs for extraction, queue or cancel jobs, detect document formats, check service health, inspect cache state, and connect external conversion clients.
Why use it?
Knowing the exact routes and handlers prevents integrations from targeting files or endpoints that do not exist. It also clarifies how to submit synchronous or queued extraction work and how to inspect or manage jobs and caches.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

About the project

Xberg is a document-intelligence engine that reads files, URLs, archives, and source trees and extracts text, metadata, images, tables, and structured data, with additional code-language understanding. Developers use it through language bindings, a command-line tool, REST API, or MCP server, and the catalogue entries support those integrations.

xberg-io/xberg · 9,265 stars · on GitHub · docs.xberg.io

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/xberg-io/xberg/api-server-mcp
Any agent
npx skills add xberg-io/xberg --skill api-server-mcp
Clone the repo
git clone --depth 1 https://github.com/xberg-io/xberg

Made for: Claude Code, Codex.

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 api-server-mcp

README.md
[![agentmods](https://agentmods.dev/badge/skills/xberg-io/xberg/api-server-mcp.svg)](https://agentmods.dev/skills/xberg-io/xberg/api-server-mcp)
Your own site
<a href="https://agentmods.dev/skills/xberg-io/xberg/api-server-mcp"><img src="https://agentmods.dev/badge/skills/xberg-io/xberg/api-server-mcp.svg" alt="Measured on agentmods" height="20"></a>
Per session 12 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,490 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00012 $0.01490
Opus 5 $0.00006 $0.00745
Sonnet 5 $0.00002 $0.00298
Haiku 4.5 $0.00001 $0.00149

Measured 6d ago against content hash 2878f4ce0fd5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

api-server-mcp 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 6d 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.

.ai-rulez/skills/api-server-mcp/SKILL.md · 122 lines

How it starts

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

API Server & MCP Protocol

Axum server for document extraction, plus the rmcp Model Context Protocol surface

Locations: crates/xberg/src/api/ (router.rs, handlers.rs, startup.rs, types.rs, error.rs, jobs.rs) and crates/xberg/src/mcp/. There is no api/server.rs.

REST routes

Registered in api/router.rs, all on one Router:

Route Handler
POST /extract extract_handler — multipart files, URL fields, or JSON; builds ExtractInput
POST /extract-async extract_async_handler — queues a job
GET/DELETE /jobs/{job_id} job_status_handler / cancel_job_handler
POST /detect detect_handler
GET /formats formats_handler
GET /health health_handler
GET /info, GET /version info_handler, version_handler
GET /cache/stats cache_stats_handler
DELETE /cache/clear cache_clear_handler
GET /cache/manifest, POST /cache/warm cache_manifest_handler, cache_warm_handler
PUT /process, POST /v1/convert/file openweb_external_handler, openweb_docling_handler (api/openweb.rs)
GET /openapi.json openapi_schema_handler (feature api)
GET /metrics metrics_handler (feature prometheus)

There is no POST /extract-url (URL ingestion is a field on ExtractInput passed to /extract) and no POST /batch (batch is /extract-async + /jobs/{job_id}).

Middleware, in order: DefaultBodyLimit::max(limits.max_request_body_bytes) + RequestBodyLimitLayer (default 100 MB), CORS, request-id, compression, catch-panic, sensitive-header stripping, tracing. CORS is built explicitly as CorsLayer::new().allow_origin(Any).allow_methods(Any).allow_headers(Any) and warns loudly; restrict it with XBERG_CORS_ORIGINS.

Caching

crates/xberg/src/cache/GenericCache is a filesystem-backed store with LRU-style eviction, not an in-memory map. Keys are BLAKE3 content hashes (blake3_hash_bytes / blake3_hash_file, cache/utilities.rs). Eviction is bounded by max_age_days, max_cache_size_mb and min_free_space_mb — there is no entry-count limit.

Read the full file on GitHub · 122 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. 6d ago First seen · 122 lines · 12 tokens per session scan A 2878f4ce0fd5

Subscribe to this mod's changes

api-server-mcp is a skill published in the GitHub repository xberg-io/xberg (9,265 stars, last pushed yesterday), licensed MIT. It adds 12 tokens to every session and 1,490 once invoked, about $0.0001 per session on Opus 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-30.

Related

Other skills, from other repositories

doc-reader

PDF/DOCX/XLSX/image document intelligence — text extraction, table parsing, OCR, financial statement analysis, contract clause detection, document classification, and format conversion. Use when reading, analyzing, extracting data from, or converting documents.

JansenAnalytics/claudex · 51 tokens

bump-dependency

Bumps a Python package dependency across Home Assistant Core integrations, regenerates core requirement files, runs verification tests and prek lint, and prepares a pull request with proper release/compare links.

home-assistant/core · 42 tokens

mem0-vercel-ai-sdk

Mem0 provider for Vercel AI SDK (@mem0/vercel-ai-provider). TRIGGER when: user mentions "vercel ai sdk", "@mem0/vercel-ai-provider", "createMem0", "retrieveMemories", "addMemories", "getMemories", "searchMemories", "mem0 vercel", "AI SDK provider", "AI SDK memory", or is using generateText/streamText with mem0. Also…

mem0ai/mem0 · 146 tokens

schema-exploration

Lists tables, describes columns and data types, identifies foreign key relationships, and maps entity relationships in a database. Use when the user asks about database schema, table structure, column types, what tables exist, ERD, foreign keys, or how entities relate.

langchain-ai/deepagents · 57 tokens

matlab

Build, review, migrate, and safely plan MATLAB or GNU Octave numerical workflows, including arrays, tabular/time data, tests, projects, graphics, MAT files, and explicit Python interoperability.

K-Dense-AI/scientific-agent-skills · 42 tokens

pennylane

Hardware-agnostic quantum ML framework with automatic differentiation. Use when training quantum circuits via gradients, building hybrid quantum-classical models, or needing device portability across IBM/Google/Rigetti/IonQ. Best for variational algorithms (VQE, QAOA), quantum neural networks, and integration with…

K-Dense-AI/scientific-agent-skills · 98 tokens