# @cryptoapis-io/mcp-shared

> Shared HTTP client, error types, blockchain constants, and schemas for Crypto APIs MCP servers

Latest version **0.4.0** (published 2026-09-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install @cryptoapis-io/mcp-shared
pnpm add @cryptoapis-io/mcp-shared
yarn add @cryptoapis-io/mcp-shared
bun add @cryptoapis-io/mcp-shared
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2026-09-24 |
| First published | 2026-03-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 180.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Crypto APIs, Inc. |
| Maintainers | crypto-apis |
| Keywords | cryptoapis, mcp, blockchain, shared |

## Links

- npm: https://www.npmjs.com/package/@cryptoapis-io/mcp-shared
- Repository: https://github.com/CryptoAPIs-io/cryptoapis-mcp-shared
- Homepage: https://github.com/CryptoAPIs-io/cryptoapis-mcp-shared#readme
- Issues: https://github.com/CryptoAPIs-io/cryptoapis-mcp-shared/issues
- npm.io page: https://npm.io/package/@cryptoapis-io/mcp-shared

## Dependencies (3)

- [zod](https://npm.io/package/zod.md) ^3.25.76
- [express](https://npm.io/package/express.md) ^4.22.1
- [@modelcontextprotocol/sdk](https://npm.io/package/@modelcontextprotocol/sdk.md) ^1.27.1

## Alternatives

- [@gemini-wallet/core](https://npm.io/package/@gemini-wallet/core.md) — 515.6K weekly downloads
- [utility](https://npm.io/package/utility.md) — 416.6K weekly downloads
- [@primno/dpapi](https://npm.io/package/@primno/dpapi.md) — 7.2K weekly downloads
- [pi-readseek](https://npm.io/package/pi-readseek.md) — 3.7K weekly downloads
- [@emilia-protocol/verify](https://npm.io/package/@emilia-protocol/verify.md) — 1.1K weekly downloads

## Recent versions

- 0.4.0 (latest) — 2026-09-24
- 0.3.2 — 2026-08-04
- 0.3.1 — 2026-08-04
- 0.3.0 — 2026-03-13
- 0.2.3 — 2026-03-05
- 0.2.2 — 2026-03-05
- 0.2.1 — 2026-03-04
- 0.2.0 — 2026-03-04
- 0.1.0 — 2026-03-02

## README

# @cryptoapis-io/mcp-shared

Shared HTTP client, error types, blockchain constants, and schemas used by all [Crypto APIs](https://cryptoapis.io/) MCP servers.

> **API Version:** Compatible with Crypto APIs version **2024-12-12**

## What's Inside

- **HTTP client** — `CryptoApisHttpClient` for making authenticated REST API calls
- **Error types** — `CryptoApisError` with code, status, and details
- **Blockchain constants** — `BLOCKCHAIN_NETWORKS`, `EVM_BLOCKCHAINS`, `UTXO_BLOCKCHAINS`, chain IDs, network mappings
- **Zod schemas** — Blockchain/network schemas, cursor/offset pagination, request metadata
- **Credits** — `formatCreditsForDescription()` and credit types for tool cost metadata
- **Confirmation** — Token-based confirmation flow for dangerous actions (sync, delete, activate)
- **Config** — `loadSharedConfig()` with support for per-request API keys via `runWithApiKey()`
- **System info tool** — Built-in `system_info` tool providing blockchain, credits, and API documentation

## Installation

```bash
npm install @cryptoapis-io/mcp-shared
```

## Usage

This package is primarily used as a dependency by other `@cryptoapis-io/mcp-*` packages. You typically don't use it directly unless building a custom MCP server for Crypto APIs.

```typescript
import {
    CryptoApisHttpClient,
    loadSharedConfig,
    EVM_BLOCKCHAINS,
    UTXO_BLOCKCHAINS,
    EvmBlockchainSchema,
    CursorPaginationSchema,
    formatCreditsForDescription,
} from "@cryptoapis-io/mcp-shared";

const config = loadSharedConfig();
const client = new CryptoApisHttpClient(config);

const result = await client.request("GET", "/blockchain-data/ethereum/mainnet/addresses/{address}/balance");
```

## License

MIT

---
_Source: https://npm.io/package/@cryptoapis-io/mcp-shared · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
