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

@xenergyschool/context-mcp

v0.1.0

Published

MCP server for reading project context documentation

Readme

Context MCP Server

MCP server untuk membaca dan mengambil snippet dari folder context documentation setiap project

🎯 Tujuan

Menyediakan MCP server berbasis stdio yang dapat dipanggil oleh Droid, Claude Desktop, atau AI agent lain untuk membaca dokumentasi context dari folder /docs/context di project manapun.

⚙️ Fitur

1. context.core

Mengembalikan bundle dokumentasi core standar:

  • CORE.md
  • 01-architecture.md
  • 02-style-guide.md
  • 03-api-contracts.md
  • 04-ux-principles.md
  • 05-glossary.md
  • 90-guardrails.md

Input: Tidak ada (optional empty object)

Output:

{
  "ok": true,
  "count": 7,
  "results": [
    {
      "file": "CORE.md",
      "snippet": "...",
      "fullLength": 5432
    }
  ]
}

2. context.get

Mencari dan mengembalikan snippet dari file yang cocok dengan query.

Input:

  • query (required): String pencarian
  • limit (optional): Maksimal hasil (default: 6, max: 20)
  • pattern (optional): Glob pattern untuk filter file (default: **/*.md)

Output:

{
  "ok": true,
  "query": "refund",
  "count": 3,
  "results": [
    {
      "file": "03-api-contracts.md",
      "snippet": "...context around 'refund'...",
      "matchCount": 5
    }
  ]
}

3. context.searchPlan

Mengembalikan bundle lengkap untuk AI planning: core docs + topic-specific snippets.

Input:

  • includeCore (optional): Include core docs (default: true)
  • topics (required): Array of topic strings
  • perTopic (optional): Max results per topic (default: 3, max: 10)

Output:

{
  "ok": true,
  "includeCore": true,
  "topicCount": 2,
  "bundle": {
    "core": [...],
    "topics": {
      "authentication": [...],
      "payment": [...]
    }
  }
}

📦 Instalasi

Quick Start (Recommended)

Gunakan via npx, tidak perlu install:

npx -y @xenergyschool/context-mcp@latest --dir ./docs/context

Install sebagai dependency

npm install @xenergyschool/context-mcp

Install global

npm install -g @xenergyschool/context-mcp

🚀 Cara Pakai

1. Setup di Claude Code (.mcp.json)

Tambahkan ke file .mcp.json di root project:

{
  "mcpServers": {
    "context": {
      "command": "npx",
      "args": [
        "-y",
        "@xenergyschool/context-mcp@latest",
        "--dir",
        "./docs/context"
      ],
      "disabled": false,
      "autoApprove": []
    }
  }
}

Atau via command:

/mcp add context "npx -y @xenergyschool/context-mcp@latest --dir ./docs/context"

2. Setup di Claude Desktop

Edit claude_desktop_config.json:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "context": {
      "command": "npx",
      "args": [
        "-y",
        "@xenergyschool/context-mcp@latest",
        "--dir",
        "/path/to/your/project/docs/context"
      ]
    }
  }
}

3. Test Lokal (Development)

cd context-mcp
npm install
node bin/context-mcp.mjs --dir ./test-docs/context

Server akan berjalan dalam mode stdio (tidak ada output, tunggu input dari MCP client).

4. Verifikasi MCP Tools

Setelah setup, test apakah tools sudah tersedia:

# Di Claude Code
/mcp get context

# Atau via tools list
# context.core - Return core standards bundle
# context.get - Get topic-specific snippets
# context.searchPlan - Get planning bundle

📂 Struktur Project

Setiap project yang menggunakan context-mcp harus memiliki folder docs/context:

my-project/
  docs/
    context/
      CORE.md
      01-architecture.md
      02-style-guide.md
      03-api-contracts.md
      04-ux-principles.md
      05-glossary.md
      90-guardrails.md
      adr/
        2025-10-05-example-decision.md
      guides/
        deployment.md

File-file ini dapat berisi dokumentasi project:

  • Architecture decisions
  • Style guides
  • API contracts
  • UX principles
  • Glossary/terminology
  • Guardrails (aturan yang tidak boleh dilanggar)
  • ADRs (Architecture Decision Records)

🛠️ Development

Install dependencies

npm install

Test local server

node bin/context-mcp.mjs --dir ./test-docs/context

Publish ke npm registry

npm publish --access public

📝 Command Line Options

  • --dir <path> - Path ke folder context documentation (default: ./docs/context)

✅ Requirements

  • Node.js >= 18
  • NPM >= 9

📄 License

MIT

🤝 Contributing

Contributions welcome! Please open an issue or PR.

🔧 Troubleshooting

Server tidak merespon

  • Pastikan folder docs/context ada di project Anda
  • Cek path yang diberikan ke --dir sudah benar
  • Server berjalan dalam mode stdio, tidak akan ada output kecuali error

Tool tidak muncul di MCP client

  • Pastikan server sudah ditambahkan dengan benar: /mcp get context
  • Restart MCP client
  • Cek logs untuk error messages

File tidak ditemukan

  • Pastikan file yang dicari ada di folder context
  • Gunakan pattern glob yang benar untuk context.get
  • File harus berformat text (markdown, txt, dll)