Skip to main content
Glama

NPM Package Docs MCP

A Model Context Protocol (MCP) tool that provides up-to-date documentation for npm packages directly in your IDE. This tool fetches the latest README documentation from either the package's GitHub repository or the README bundled with the npm package itself.

What it does

This MCP tool helps your IDE (like Cursor) get the most current documentation for any npm package instead of relying on outdated or incomplete information. It works by:

  1. GitHub Repository First: If the package has a GitHub repository, it fetches the README directly from the repository's main branch (trying master, main, or develop branches)

  2. NPM Package Fallback: If no GitHub repository is available, it downloads the package tarball and extracts the README file from the bundled package

  3. Real-time Updates: Always gets the latest documentation, ensuring you have the most current information

Related MCP server: MCP LLMS.txt Explorer

Why this matters

  • No more guesswork: Get accurate, up-to-date documentation instead of relying on potentially outdated IDE suggestions

  • Better development experience: Understand package APIs and usage patterns with current documentation

  • Reduced errors: Avoid issues caused by using outdated API references or deprecated methods

  • Seamless integration: Works directly in your IDE through the MCP protocol

Tools Provided

get_docs_for_npm_package

Description: Retrieves the latest documentation for any npm package

Parameters:

  • packageName (string): The name of the npm package (e.g., "react", "lodash", "express")

Returns: The README content as text, either from the GitHub repository or the package tarball

Example Usage:

// In your IDE, you can now ask for documentation like:
// "Show me the docs for express"
// "What's the latest API for react-router-dom?"
// "Get documentation for axios"

How it Works

  1. Package Lookup: Queries the npm registry to get package metadata

  2. Repository Detection: Checks if the package has a GitHub repository URL

  3. GitHub Fetch: If available, fetches README.md from the repository's main branch

  4. Tarball Extraction: If no GitHub repo, downloads and extracts the package tarball to find the README

  5. Content Return: Returns the documentation content to your IDE

Installation

Prerequisites

  • Node.js (v16 or higher)

  • Cursor IDE (or any MCP-compatible IDE)

Installation

Add to Cursor

Install MCP Server

Add manually to Cursor

Edit your Cursor MCP configuration file (usually located at ~/.cursor/mcp.json):

{
  "mcpServers": {
    "npm-package-docs-mcp": {
      "command": "npx",
      "args": [
        "meanands/npm-package-docs-mcp"
      ]
    }
  }
}
  1. Restart Cursor: Restart Cursor IDE to load the new MCP server

Usage

Once installed, you can use the tool in Cursor by:

  1. Opening the command palette (Cmd/Ctrl + Shift + P)

  2. Typing your request, for example:

    • "Get docs for express"

    • "Show me the latest react documentation"

    • "What's new in lodash v4?"

The tool will fetch and display the current documentation for the requested package.

Development

Running in Development Mode

npm run dev

Building for Production

npm run build

Project Structure

npm-docs-mcp/
├── src/
│   ├── server.ts          # Main MCP server implementation
│   └── types/
│       └── index.ts       # TypeScript type definitions
├── package.json
├── tsconfig.json
└── README.md

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see the LICENSE file for details.

Support

If you encounter any issues or have questions, please open an issue on the GitHub repository.

Available Tools

1 tool
get_docs_for_npm_packageGet docs for an npm packageC

Get the docs for an npm package

ParametersJSON Schema
NameRequiredDescriptionDefault
packageNameYesName of the npm package

TDQS

C2/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states the action without detailing how it works—such as source of docs (e.g., npm registry, GitHub), format of return (e.g., markdown, JSON), error handling, or any constraints like rate limits or authentication needs. This is inadequate for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, straightforward sentence that efficiently conveys the core action. It is front-loaded with no unnecessary words, making it easy to parse. However, it is overly terse, missing details that could enhance usability without sacrificing brevity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and a simple input schema, the description is incomplete. It fails to explain what 'docs' include, the return format, or any behavioral aspects like error cases. For a tool with minimal structured data, the description should provide more context to guide the agent effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the parameter 'packageName' clearly documented. The description does not add any meaning beyond the schema, as it only repeats the tool's purpose without elaborating on parameter usage (e.g., package naming conventions or validation). With high schema coverage, the baseline score of 3 is appropriate, as the schema handles parameter documentation adequately.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get the docs for an npm package' restates the title and name with minimal elaboration. It specifies the verb 'Get' and resource 'docs for an npm package', but lacks detail on what 'docs' entails (e.g., README, API documentation, or installation guides) or how they are retrieved. Without sibling tools, differentiation isn't needed, but the purpose remains vague beyond basic restatement.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool. The description does not mention prerequisites, alternatives, or context for usage (e.g., vs. searching npm registry or checking package versions). With no sibling tools, explicit alternatives aren't required, but general usage context is missing, leaving the agent without direction.

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.

  1. 1 tool update
    • First observedget_docs_for_npm_package

TDQS

C2.5/5.0
Disambiguation5/5

With only one tool, there is no possibility of confusion or overlap between tools. The tool's purpose is singular and clearly defined, making disambiguation perfect.

Naming Consistency5/5

The single tool name follows a clear verb_noun pattern (get_docs_for_npm_package), and with only one tool, consistency is inherently perfect as there are no other names to compare against.

Tool Count2/5

A single tool for an 'NPM Package Docs' server feels too thin and under-scoped. The server's purpose suggests potential for more operations like searching packages, listing versions, or getting specific documentation sections, but only one basic retrieval tool is provided.

Completeness2/5

The tool surface is severely incomplete for the apparent domain of npm package documentation. It only allows getting docs for a package, with no support for operations like searching, filtering, or handling multiple packages, which are likely needed for effective agent workflows.

Maintenance

ActivityInactive
ResponsivenessSyncing

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

Related MCP Servers

  • A
    license
    A
    quality
    A
    maintenance
    A Model Context Protocol server that fetches up-to-date, version-specific documentation and code examples from libraries directly into LLM prompts, helping developers get accurate answers without outdated or hallucinated information.
    2
    879,513
    61,623
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Provides comprehensive contextual information about npm packages including README files, versions, dependencies, download statistics, and search functionality. Enables users to explore and analyze npm packages through natural language queries with intelligent GitHub README fetching and branch fallback.
    9
    MIT

Latest Blog Posts

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/meanands/npm-package-docs-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server