pkg-api-mcp
Retrieves version-pinned TypeScript declaration files for npm packages from the jsDelivr CDN.
Enables MCP clients to query the exported API surface and type signatures of any npm package, including functions, classes, interfaces, types, and enums, by reading from the package's published TypeScript declaration files.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@pkg-api-mcpWhat does zod@3.23.8 export?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
pkg-api-mcp
The antidote to your coding agent inventing functions that don't exist.
An MCP server that feeds Claude, Cursor, and any MCP client the real exported API surface and type signatures of any npm package — extracted straight from its published .d.ts declarations. If a function isn't in the output, the package doesn't export it. Full stop.
Why this exists
The most common way an AI coding agent wastes your time: confidently calling library.doThing(...) where doThing never existed, or passing an option the API doesn't accept. The ground truth — the package's own TypeScript declarations — is sitting on a CDN. This server puts it in the agent's context, version-pinned, before it writes the call.
Related MCP server: dag-mcp-server
Tools
Tool | What it does |
| The exported surface of |
| The raw |
| Every declaration file in the package — for split types or submodule imports. |
No API key. Types are read from jsDelivr, version-pinned.
Quick start
npx pkg-api-mcpClaude Code
claude mcp add pkg-api -- npx -y pkg-api-mcpClaude Desktop / Cursor / Windsurf / any MCP client
{
"mcpServers": {
"pkg-api": {
"command": "npx",
"args": ["-y", "pkg-api-mcp"]
}
}
}Example prompts
"What does zod@3.23.8 actually export? Use pkg-api before writing the schema."
"Show me the real signature of
formatin date-fns@latest.""I need the exact props type for the Query client in @tanstack/react-query — pull the raw types."
Config
Env var | Default | Purpose |
|
| Max characters returned per call, to protect the context window. |
How it works
package[@version]
│
├─ jsDelivr resolve ──► exact version
├─ read package.json "types"/"typings" (or derive from "main")
├─ fetch the .d.ts from the CDN
└─ extract every `export …` ──► grouped, signature-level API indexThe extractor is deliberately dependency-free (no TypeScript compiler in your runtime) and handles functions, classes, consts, interfaces, types, enums, namespaces, export default, and export { … } from/export * re-exports.
Develop
npm install
npm run build
node dist/index.jsCaveats
Packages that ship no types (pure JS, no bundled
.d.ts) won't resolve here — their types usually live in a separate@types/<name>package; runpackage_apion that instead.The extractor is regex-based, not a full TS parse: it's built for an accurate at-a-glance index. For byte-exact overloads, use
package_types.
License
MIT © Anicodeth
Available Tools
3 toolslist_type_filesList declaration files in a packageA
List every TypeScript declaration (.d.ts) file shipped in an npm package@version. Use when package_api can't find the entry, when a package splits its types across many files, or to locate the declaration for one submodule/export.
| Name | Required | Description | Default |
|---|---|---|---|
| package | Yes | npm package name. | |
| version | No | Version or dist-tag. Defaults to 'latest'. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the transparency burden. It clearly implies a read-only listing operation, but does not explicitly state the return format, network behavior, or any side effects. For a simple list tool, this is adequate but not rich in behavioral detail.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, front-loaded with the core action and then usage conditions. Every word earns its place; no fluff or redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple 2-parameter tool with no output schema, the description covers purpose and usage scenarios effectively. It does not describe the return value, but for a listing operation that is self-evident; overall complete enough for an agent to invoke correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% (both package and version are described). The description adds context by combining package@version in the purpose, but does not add significant meaning beyond the schema. Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action: 'List every TypeScript declaration (.d.ts) file shipped in an npm package@version.' This specifies the verb (list), resource (declaration files), and scope (package@version), distinguishing it from sibling tools like package_api and package_types.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicit usage conditions are given: 'Use when package_api can't find the entry, when a package splits its types across many files, or to locate the declaration for one submodule/export.' This provides when-to-use guidance and names an alternative, making sibling differentiation clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
package_apiExported API surface of a packageA
Get the REAL exported API — functions, classes, constants, interfaces, types — of an npm package at a specific version, extracted from its published TypeScript declarations (.d.ts). Reach for this WHENEVER you're about to call into a library and aren't 100% certain a function/option exists with that exact name and signature. It is the antidote to inventing APIs: if it isn't in this list, the package doesn't export it. Grouped by kind, with one-line signatures.
| Name | Required | Description | Default |
|---|---|---|---|
| entry | No | Override the .d.ts entry path (e.g. 'dist/index.d.ts') if auto-detection misses it. | |
| package | Yes | npm package name, e.g. 'zod', 'date-fns', '@tanstack/react-query'. | |
| version | No | Exact version or dist-tag (e.g. '3.23.8', 'latest', 'next'). Defaults to 'latest'. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It discloses that the API is extracted from published TypeScript declarations (.d.ts), a key behavioral constraint, and reveals the output structure ('Grouped by kind, with one-line signatures'). Edge cases like missing .d.ts files aren't covered, but for a read-only introspection tool this is reasonably transparent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is three sentences and front-loaded with the core purpose, with each sentence contributing what, when, and why. There is minor redundancy ('antidote to inventing APIs' restates the previous sentence), but overall it's efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, the description gives a partial return shape ('Grouped by kind, with one-line signatures') but doesn't elaborate on the exact structure or error behavior. It covers the main use case well but lacks sufficient detail about limitations, given the tool's complexity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema already provides 100% description coverage for all three parameters (package, version, entry), so the baseline is 3. The description echoes the version concept but adds no additional semantics beyond what the schema documents.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb 'Get' with a precise resource ('REAL exported API' of an npm package at a specific version) and explicitly enumerates what's included (functions, classes, constants, interfaces, types). It distinguishes itself from sibling tools by claiming to be the authoritative source ('antidote to inventing APIs: if it isn't in this list, the package doesn't export it').
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides an explicit when-to-use: 'Reach for this WHENEVER you're about to call into a library and aren't 100% certain a function/option exists with that exact name and signature.' This is clear context, though it does not name sibling tools or exclusions, so it stops short of a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
package_typesRaw TypeScript declarations of a packageA
Return the raw .d.ts declaration text for an npm package@version — the ground-truth type definitions. Use when you need exact signatures, generic parameters, overloads, or option-object shapes that a summary can't capture (e.g. the precise props of a component or the full options of a function). Defaults to the package's types entry; pass file (from list_type_files) to read a specific declaration file.
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | Specific .d.ts path to read (from list_type_files). Defaults to the types entry. | |
| package | Yes | npm package name. | |
| version | No | Version or dist-tag. Defaults to 'latest'. | |
| maxChars | No | Truncate output (default 16000) to protect the context window. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It clearly implies a read-only operation ('Return the raw .d.ts declaration text') and explains the default and override behavior. It lacks an explicit statement about non-destructiveness, but the framing is sufficient. It does not cover edge cases like missing packages, but that's not required for basic transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three sentences, front-loaded with the core purpose. The first sentence states what it does, the second explains when to use it, and the third provides a practical default and override. No redundant or filler content—every sentence earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple read tool, the description covers the key aspects: what it returns, when to prefer it, and how to specify a particular file. Combined with the fully-documented schema and absence of an output schema (raw text), the description provides adequate context for selecting and using the tool. It even references the sibling `list_type_files` to complete the usage flow.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema already covers 100% of parameters, so the baseline is 3. The description adds value by linking `file` to `list_type_files`, clarifying the `package@version` syntax, and noting the default types entry. This goes beyond mere schema repetition, earning a 4.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a clear and specific verb phrase: 'Return the raw .d.ts declaration text for an npm package@version'. It explicitly identifies the resource (TypeScript declaration files) and distinguishes itself from siblings by mentioning 'ground-truth type definitions' and 'a summary can't capture', which sets it apart from package_api.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage guidance is explicit: 'Use when you need exact signatures, generic parameters, overloads, or option-object shapes that a summary can't capture'. It also clarifies when to use the `file` parameter ('from list_type_files') and the default behavior, effectively directing the agent to the right alternative.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
3 tool updates
v0.1.0- First observed
list_type_files - First observed
package_api - First observed
package_types
TDQS
Each tool has a distinct role: package_api provides a summarized list of exports, list_type_files lists declaration files, and package_types returns raw text. The descriptions clearly differentiate these, so an agent can choose correctly without confusion.
Two tools follow a package_ prefix pattern (package_api, package_types) but the third uses a verb_noun style (list_type_files). This mixed convention is readable but not fully consistent.
With 3 tools, the server is minimal but well-scoped. Each tool covers a necessary aspect of inspecting package declarations, and none feel redundant.
The toolset covers the full read-only workflow: locate declaration files, get a summarized API, and retrieve raw type text. There are no obvious gaps for its stated purpose.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Provide AI-powered real-time analysis and intelligence on NPM packages, including security, depend…
Package intelligence for AI agents across npm, PyPI, crates.io and deps.dev. No API keys.
Package intelligence for AI agents across npm, PyPI, crates.io and deps.dev. No API keys.
61Dive into the world of npm with our NPM Package Info MCP. Access crucial metadata about any npm
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides AI assistants with instant access to TypeScript type definitions from your project dependencies. Enables generation of complete, type-safe mocks and test data by automatically discovering and exposing interface structures from node_modules.81MIT
- AlicenseNot gradedqualityDmaintenanceProvides intelligent, version-aware access to npm library documentation. Supports semantic search, API validation, and version comparison to assist developers in using libraries correctly.2MIT

Augments MCP Serverofficial
AlicenseAqualityDmaintenanceA next-generation framework documentation provider for Claude Code via Model Context Protocol (MCP). Returns types + prose + examples with context-aware formatting for any npm package — not just curated ones.852128MIT- AlicenseAqualityCmaintenanceMCP server that provides npm package information for AI agents during TypeScript development.7191MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Anicodeth/pkg-api-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server