npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@datorama/mci-mcp-sdk

v0.1.1

Published

Local stdio MCP server for Marketing Cloud Intelligence (MCI). Owns the OAuth2 token lifecycle and pass-through-proxies MCP JSON-RPC to an MCI dato /api/mcp endpoint.

Downloads

284

Readme

@datorama/mci-mcp-sdk

A tiny, local stdio MCP server for Marketing Cloud Intelligence (MCI). You launch it via npx from your MCP client's config; it owns the entire OAuth2 token lifecycle (mint from your service-account key, cache, refresh on demand) and pass-through-proxies MCP JSON-RPC to an MCI dato /api/mcp endpoint.

There is nothing to paste and nothing that expires on you: no more copying a bearer header that dies every hour. You give the SDK a key file and a URL; it does the rest.

What it is (and isn't)

  • It is a pure relay + a token manager. Every MCP message — initialize, tools/list, tools/call, and anything added later — is forwarded verbatim to your MCI endpoint with a fresh Authorization: Bearer … injected. It defines no tools of its own; the tool list you see comes from the server. New server-side tools appear automatically with no SDK update.
  • It isn't where any business logic lives. All validation, data access, and authorization happen server-side; the SDK is treated as untrusted and the server re-validates every call.

Setup

Add this to your MCP client's server config (e.g. Claude Code / Cursor mcpServers):

{
  "mcpServers": {
    "mci-mcp": {
      "command": "npx",
      "args": ["-y", "@datorama/mci-mcp-sdk"],
      "env": {
        "PRIVATE_KEY_PATH": "<path to the step-1 service-account JSON>",
        "HOST": "https://<your dato env>/api/mcp"
      }
    }
  }
}
  • PRIVATE_KEY_PATH — path to the service-account artifact JSON you were issued (it contains serviceAccountId, discoveryEndpoint, and privateKey). The SDK derives the IdP/token URL from this file; you don't configure an IdP URL. The key is read in-memory only — never logged, never put on the command line, never written to disk.
  • HOST — your MCI dato MCP endpoint (…/api/mcp).

Reload your client. The mci_* tools appear with no pasted header. As you keep working, the SDK transparently re-mints the bearer when it nears expiry — you never notice.

Optional env

| Var | Default | Purpose | |---|---|---| | MCI_INSECURE_TLS | off | Allow a self-signed cert. Honored only for dev hosts (localhost, 127.0.0.1, *.dev.datorama.io); ignored for production. | | MCI_TIMEOUT_MS | 30000 | Per-request timeout to HOST. | | DATO_MCI_STATE_DIR | OS state dir | Override the token-cache directory (tests/power users). |

Local development

npm install
npm run build       # tsc → dist/
npm test            # vitest (unit + proxy relay)

# Smoke-test the built binary against a live endpoint:
PRIVATE_KEY_PATH=/path/to/sa.json HOST=https://127.0.0.1:8081/api/mcp MCI_INSECURE_TLS=1 \
  node scripts/stdio-smoke.mjs mci_list_workspaces

Local gotcha: use 127.0.0.1, not localhost, for a locally-run dato — Node resolves localhost to IPv6 ::1, but a local Jetty typically binds IPv4 only (ECONNREFUSED ::1).

Security

  • Private key: in-memory only. Never logged, never on argv, never persisted.
  • Token cache: only the short-lived bearer, written atomically at mode 0600 in a 0700 state dir.
  • stdout is reserved for the MCP protocol stream; all diagnostics go to stderr.
  • Tokens are masked and IdP error bodies redacted in any human-readable output.
  • The server is the security boundary — it enforces per-user authorization on the service-account identity regardless of what the client (or a tampered SDK) sends.